From: David Howells <dhowells@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@infradead.org>
Cc: David Howells <dhowells@redhat.com>,
Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
Jeff Layton <jlayton@kernel.org>,
David Hildenbrand <david@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Logan Gunthorpe <logang@deltatee.com>,
Hillf Danton <hdanton@sina.com>,
Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [RFC PATCH 00/11] iov_iter: Use I/O direction from kiocb, iomap & request rather than iov_iter
Date: Fri, 30 Jun 2023 16:25:13 +0100 [thread overview]
Message-ID: <20230630152524.661208-1-dhowells@redhat.com> (raw)
Hi Jens, Christoph,
Here are some patches to switch from using the I/O direction indication in the
iov_iter struct to using the I/O direction flags to be found in the kiocb
struct, the iomap_iter struct and the request struct. The iterator's I/O
direction is then only used in some internal checks.
The patches also add direction flags into iov_iter_extract_pages() so that it
can perform some checks. New constants are defined rather than using READ and
WRITE so that a check can be made that one of them is specified. The problem
with the READ constant is that it is zero and is thus the same as no direction
being specified - but if we're modifying the buffer contents (ie. reading into
it), we need to know to set FOLL_WRITE. Granted this would be the default if
unspecified, but it seems better that this case should be explicit.
There are also patches to make 9P and SCSI use iov_iter_extract_pages().
I've pushed the patches here also:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-extract
David
David Howells (11):
iov_iter: Fix comment refs to iov_iter_get_pages/pages_alloc()
vfs: Set IOCB_WRITE in iocbs that we're going to write from
vfs: Use init_kiocb() to initialise new IOCBs
iov_iter: Use IOCB_WRITE rather than iterator direction
iov_iter: Use IOMAP_WRITE rather than iterator direction
iov_iter: Use op_is_write() rather than iterator direction
cifs: Drop the check using iov_iter_rw()
iov_iter: Drop iov_iter_rw() and fold in last user
iov_iter: Use I/O dir flags with iov_iter_extract_pages()
9p: Pin pages rather than ref'ing if appropriate
scsi: Use extract_iter_to_sg()
block/bio.c | 6 ++
block/blk-map.c | 5 +-
block/fops.c | 8 +--
crypto/af_alg.c | 5 +-
crypto/algif_hash.c | 3 +-
drivers/block/loop.c | 11 ++--
drivers/nvme/target/io-cmd-file.c | 5 +-
drivers/target/target_core_file.c | 2 +-
drivers/vhost/scsi.c | 79 ++++++++------------------
fs/9p/vfs_addr.c | 2 +-
fs/affs/file.c | 4 +-
fs/aio.c | 9 ++-
fs/btrfs/ioctl.c | 4 +-
fs/cachefiles/io.c | 10 ++--
fs/ceph/file.c | 6 +-
fs/dax.c | 6 +-
fs/direct-io.c | 28 ++++++----
fs/exfat/inode.c | 6 +-
fs/ext2/inode.c | 2 +-
fs/f2fs/file.c | 10 ++--
fs/fat/inode.c | 4 +-
fs/fuse/dax.c | 2 +-
fs/fuse/file.c | 8 +--
fs/hfs/inode.c | 2 +-
fs/hfsplus/inode.c | 2 +-
fs/iomap/direct-io.c | 4 +-
fs/jfs/inode.c | 2 +-
fs/nfs/direct.c | 2 +-
fs/nilfs2/inode.c | 2 +-
fs/ntfs3/inode.c | 2 +-
fs/ocfs2/aops.c | 2 +-
fs/orangefs/inode.c | 2 +-
fs/read_write.c | 10 ++--
fs/reiserfs/inode.c | 2 +-
fs/seq_file.c | 2 +-
fs/smb/client/smbdirect.c | 9 ---
fs/splice.c | 2 +-
fs/udf/inode.c | 2 +-
include/linux/bio.h | 18 +++++-
include/linux/fs.h | 16 +++++-
include/linux/mm_types.h | 2 +-
include/linux/uio.h | 10 ++--
io_uring/rw.c | 10 ++--
lib/iov_iter.c | 14 ++++-
lib/scatterlist.c | 12 +++-
mm/filemap.c | 2 +-
mm/page_io.c | 4 +-
net/9p/trans_common.c | 8 +--
net/9p/trans_common.h | 2 +-
net/9p/trans_virtio.c | 92 ++++++++++---------------------
50 files changed, 221 insertions(+), 241 deletions(-)
next reply other threads:[~2023-06-30 15:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 15:25 David Howells [this message]
2023-06-30 15:25 ` [RFC PATCH 01/11] iov_iter: Fix comment refs to iov_iter_get_pages/pages_alloc() David Howells
2023-07-06 15:21 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 02/11] vfs: Set IOCB_WRITE in iocbs that we're going to write from David Howells
2023-07-06 15:22 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 03/11] vfs: Use init_kiocb() to initialise new IOCBs David Howells
2023-06-30 15:39 ` Jens Axboe
2023-06-30 16:00 ` David Howells
2023-06-30 16:05 ` Jens Axboe
2023-07-06 15:29 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 04/11] iov_iter: Use IOCB_WRITE rather than iterator direction David Howells
2023-06-30 15:25 ` [RFC PATCH 05/11] iov_iter: Use IOMAP_WRITE " David Howells
2023-07-06 15:30 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 06/11] iov_iter: Use op_is_write() " David Howells
2023-07-06 15:30 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 07/11] cifs: Drop the check using iov_iter_rw() David Howells
2023-06-30 15:25 ` [RFC PATCH 08/11] iov_iter: Drop iov_iter_rw() and fold in last user David Howells
2023-07-06 15:31 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 09/11] iov_iter: Use I/O dir flags with iov_iter_extract_pages() David Howells
2023-06-30 15:25 ` [RFC PATCH 10/11] 9p: Pin pages rather than ref'ing if appropriate David Howells
2023-06-30 15:25 ` [RFC PATCH 11/11] scsi: Use extract_iter_to_sg() David Howells
-- strict thread matches above, loose matches on Subject: below --
2023-06-30 15:16 [RFC PATCH 00/11] iov_iter: Use I/O direction from kiocb, iomap & request rather than iov_iter David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230630152524.661208-1-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=david@redhat.com \
--cc=hch@infradead.org \
--cc=hdanton@sina.com \
--cc=jack@suse.cz \
--cc=jgg@nvidia.com \
--cc=jlayton@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=logang@deltatee.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox