diff options
author | David Howells <dhowells@redhat.com> | 2023-09-26 18:42:26 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-12-24 16:08:52 +0100 |
commit | 92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2 (patch) | |
tree | 56f0fd811b3fce31f05ce885454b3327787c3b44 /fs/afs | |
parent | netfs: Implement unbuffered/DIO vs buffered I/O locking (diff) | |
download | linux-92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2.tar.xz linux-92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2.zip |
netfs: Add iov_iters to (sub)requests to describe various buffers
Add three iov_iter structs:
(1) Add an iov_iter (->iter) to the I/O request to describe the
unencrypted-side buffer.
(2) Add an iov_iter (->io_iter) to the I/O request to describe the
encrypted-side I/O buffer. This may be a different size to the buffer
in (1).
(3) Add an iov_iter (->io_iter) to the I/O subrequest to describe the part
of the I/O buffer for that subrequest.
This will allow future patches to point to a bounce buffer instead for
purposes of handling oversize writes, decryption (where we want to save the
encrypted data to the cache) and decompression.
These iov_iters persist for the lifetime of the (sub)request, and so can be
accessed multiple times without worrying about them being deallocated upon
return to the caller.
The network filesystem must appropriately advance the iterator before
terminating the request.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/file.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/afs/file.c b/fs/afs/file.c index d152ba451f0e..3403bb792deb 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -323,11 +323,7 @@ static void afs_issue_read(struct netfs_io_subrequest *subreq) fsreq->len = subreq->len - subreq->transferred; fsreq->key = key_get(subreq->rreq->netfs_priv); fsreq->vnode = vnode; - fsreq->iter = &fsreq->def_iter; - - iov_iter_xarray(&fsreq->def_iter, ITER_DEST, - &fsreq->vnode->netfs.inode.i_mapping->i_pages, - fsreq->pos, fsreq->len); + fsreq->iter = &subreq->io_iter; afs_fetch_data(fsreq->vnode, fsreq); afs_put_read(fsreq); |