diff options
author | David Howells <dhowells@redhat.com> | 2023-09-26 17:42:26 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-12-24 15:08:52 +0000 |
commit | 92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2 (patch) | |
tree | 56f0fd811b3fce31f05ce885454b3327787c3b44 /include | |
parent | 46ed60dcd4f2c94d27735743ce55cd8d6b93cc1d (diff) | |
download | linux-stable-92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2.tar.gz linux-stable-92b6cc5d1e7cbe569f00e9c1249ac8214fd5e2d2.tar.bz2 linux-stable-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 'include')
-rw-r--r-- | include/linux/netfs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netfs.h b/include/linux/netfs.h index fc6d9756a029..3da962e977f5 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -150,6 +150,7 @@ struct netfs_cache_resources { struct netfs_io_subrequest { struct netfs_io_request *rreq; /* Supervising I/O request */ struct list_head rreq_link; /* Link in rreq->subrequests */ + struct iov_iter io_iter; /* Iterator for this subrequest */ loff_t start; /* Where to start the I/O */ size_t len; /* Size of the I/O */ size_t transferred; /* Amount of data transferred */ @@ -186,6 +187,8 @@ struct netfs_io_request { struct netfs_cache_resources cache_resources; struct list_head proc_link; /* Link in netfs_iorequests */ struct list_head subrequests; /* Contributory I/O operations */ + struct iov_iter iter; /* Unencrypted-side iterator */ + struct iov_iter io_iter; /* I/O (Encrypted-side) iterator */ void *netfs_priv; /* Private data for the netfs */ unsigned int debug_id; atomic_t nr_outstanding; /* Number of ops in progress */ |