new iov_iter flavour - ITER_UBUF
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 May 2022 18:59:25 +0000 (14:59 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 9 Aug 2022 02:37:15 +0000 (22:37 -0400)
commitfcb14cb1bdacec5b4374fe161e83fb8208164a85
tree06b308b8f6b67c65e0c1e90d2e97e61ae66f232a
parentfa9db655d0e112c108fe838809608caf759bdf5e
new iov_iter flavour - ITER_UBUF

Equivalent of single-segment iovec.  Initialized by iov_iter_ubuf(),
checked for by iter_is_ubuf(), otherwise behaves like ITER_IOVEC
ones.

We are going to expose the things like ->write_iter() et.al. to those
in subsequent commits.

New predicate (user_backed_iter()) that is true for ITER_IOVEC and
ITER_UBUF; places like direct-IO handling should use that for
checking that pages we modify after getting them from iov_iter_get_pages()
would need to be dirtied.

DO NOT assume that replacing iter_is_iovec() with user_backed_iter()
will solve all problems - there's code that uses iter_is_iovec() to
decide how to poke around in iov_iter guts and for that the predicate
replacement obviously won't suffice.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 files changed:
block/fops.c
fs/ceph/file.c
fs/cifs/file.c
fs/direct-io.c
fs/fuse/dev.c
fs/fuse/file.c
fs/gfs2/file.c
fs/iomap/direct-io.c
fs/nfs/direct.c
include/linux/uio.h
lib/iov_iter.c
mm/shmem.c