Re: linux-next: manual merge of the block tree with the mm tree

From: Stephen Rothwell
Date: Wed Mar 22 2023 - 20:03:22 EST


Hi all,

On Wed, 22 Mar 2023 16:26:38 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> fyi, Lorenzo has sent out v7 of this series. I'll be pushing this in
> an hour or so. After which I suggest Stephen removes those (now) two
> lines and sends out one of his "build fix" emails which can be the
> basis for Linus's resolution.

I have not picked up v7 (I will get that tomorrow), but I have gone
back in today's tree and changed the merge resolution to be as below.
--
Cheers,
Stephen Rothwell

diff --cc lib/iov_iter.c
index 48ca1c5dfc04,fad95e4cf372..389cc8a53097
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@@ -821,60 -532,6 +532,29 @@@ size_t copy_page_from_iter_atomic(struc
}
EXPORT_SYMBOL(copy_page_from_iter_atomic);

+size_t copy_page_to_iter_atomic(struct page *page, unsigned offset, size_t bytes,
+ struct iov_iter *i)
+{
+ char *kaddr = kmap_local_page(page);
+ char *p = kaddr + offset;
+ size_t copied = 0;
+
+ if (!page_copy_sane(page, offset, bytes) ||
+ WARN_ON_ONCE(i->data_source))
+ goto out;
+
- if (unlikely(iov_iter_is_pipe(i))) {
- copied = copy_page_to_iter_pipe(page, offset, bytes, i);
- goto out;
- }
-
+ iterate_and_advance(i, bytes, base, len, off,
+ copyout(base, p + off, len),
+ memcpy(base, p + off, len)
+ )
+ copied = bytes;
+
+out:
+ kunmap_local(kaddr);
+ return copied;
+}
+EXPORT_SYMBOL(copy_page_to_iter_atomic);
+
- static void pipe_advance(struct iov_iter *i, size_t size)
- {
- struct pipe_inode_info *pipe = i->pipe;
- int off = i->last_offset;
-
- if (!off && !size) {
- pipe_discard_from(pipe, i->start_head); // discard everything
- return;
- }
- i->count -= size;
- while (1) {
- struct pipe_buffer *buf = pipe_buf(pipe, i->head);
- if (off) /* make it relative to the beginning of buffer */
- size += abs(off) - buf->offset;
- if (size <= buf->len) {
- buf->len = size;
- i->last_offset = last_offset(buf);
- break;
- }
- size -= buf->len;
- i->head++;
- off = 0;
- }
- pipe_discard_from(pipe, i->head + 1); // discard everything past this one
- }
-
static void iov_iter_bvec_advance(struct iov_iter *i, size_t size)
{
const struct bio_vec *bvec, *end;

Attachment: pgpcRB9jJF5P6.pgp
Description: OpenPGP digital signature