[GIT PULL for v6.7] vfs io updates

From: Christian Brauner
Date: Fri Oct 27 2023 - 10:43:00 EST


Hey Linus,

/* Summary */
This contain's David's iov_iter cleanup work to convert the iov_iter
iteration macros to inline functions:

* Remove last_offset from iov_iter as it was only used by ITER_PIPE.
* Add a __user tag on copy_mc_to_user()'s dst argument on x86 to match
that on powerpc and get rid of a sparse warning.
* Convert iter->user_backed to user_backed_iter() in the sound PCM
driver.
* Convert iter->user_backed to user_backed_iter() in a couple of
infiniband drivers.
* Renumber the type enum so that the ITER_* constants match the order in
iterate_and_advance*().
* Since the preceding patch puts UBUF and IOVEC at 0 and 1, change
user_backed_iter() to just use the type value and get rid of the extra
flag.
* Convert the iov_iter iteration macros to always-inline functions to
make the code easier to follow. It uses function pointers, but they
get optimised away.
* Move the check for ->copy_mc to _copy_from_iter() and
copy_page_from_iter_atomic() rather than in memcpy_from_iter_mc()
where it gets repeated for every segment. Instead, we check once and
invoke a side function that can use iterate_bvec() rather than
iterate_and_advance() and supply a different step function.
* Move the copy-and-csum code to net/ where it can be in proximity with
the code that uses it.
* Fold memcpy_and_csum() in to its two users.
* Move csum_and_copy_from_iter_full() out of line and merge in
csum_and_copy_from_iter() since the former is the only caller of the
latter.
* Move hash_and_copy_to_iter() to net/ where it can be with its only
caller.

/* Testing */
clang: Debian clang version 16.0.6 (16)
gcc: gcc (Debian 13.2.0-5) 13.2.0

All patches are based on v6.6-rc2 and have been sitting in linux-next.
No build failures or warnings were observed.

/* Conflicts */
At the time of creating this PR no merge conflicts were reported from
linux-next and no merge conflicts showed up doing a test-merge with
current mainline.

The following changes since commit ce9ecca0238b140b88f43859b211c9fdfd8e5b70:

Linux 6.6-rc2 (2023-09-17 14:40:24 -0700)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.7.iov_iter

for you to fetch changes up to b5f0e20f444cd150121e0ce912ebd3f2dabd12bc:

iov_iter, net: Move hash_and_copy_to_iter() to net/ (2023-10-09 09:35:14 +0200)

Please consider pulling these changes from the signed vfs-6.7.iov_iter tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.7.iov_iter

----------------------------------------------------------------
David Howells (12):
iov_iter: Remove last_offset from iov_iter as it was for ITER_PIPE
iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user()
sound: Fix snd_pcm_readv()/writev() to use iov access functions
infiniband: Use user_backed_iter() to see if iterator is UBUF/IOVEC
iov_iter: Renumber ITER_* constants
iov_iter: Derive user-backedness from the iterator type
iov_iter: Convert iterate*() to inline funcs
iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()
iov_iter, net: Move csum_and_copy_to/from_iter() to net/
iov_iter, net: Fold in csum_and_memcpy()
iov_iter, net: Merge csum_and_copy_from_iter{,_full}() together
iov_iter, net: Move hash_and_copy_to_iter() to net/

arch/x86/include/asm/uaccess.h | 2 +-
arch/x86/lib/copy_mc.c | 8 +-
drivers/infiniband/hw/hfi1/file_ops.c | 2 +-
drivers/infiniband/hw/qib/qib_file_ops.c | 2 +-
include/linux/iov_iter.h | 274 +++++++++++++++++++
include/linux/skbuff.h | 3 +
include/linux/uio.h | 34 +--
lib/iov_iter.c | 437 ++++++++++---------------------
net/core/datagram.c | 75 +++++-
net/core/skbuff.c | 40 +++
sound/core/pcm_native.c | 4 +-
11 files changed, 540 insertions(+), 341 deletions(-)
create mode 100644 include/linux/iov_iter.h