summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-09-22 15:49:47 +0200
committerDavid Howells <dhowells@redhat.com>2023-12-28 10:45:18 +0100
commitcae932d3aee55035a54415dcea8e7ecf2ec469b5 (patch)
tree9d0889f665bd9eb53da4cfa4387cfb6aff60973c /include
parentnetfs: Provide tools to create a buffer in an xarray (diff)
downloadlinux-cae932d3aee55035a54415dcea8e7ecf2ec469b5.tar.xz
linux-cae932d3aee55035a54415dcea8e7ecf2ec469b5.zip
netfs: Add func to calculate pagecount/size-limited span of an iterator
Add a function to work out how much of an ITER_BVEC or ITER_XARRAY iterator we can use in a pagecount-limited and size-limited span. This will be used, for example, to limit the number of segments in a subrequest to the maximum number of elements that an RDMA transfer can handle. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: 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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index c05365e3f428..d673d0785b9d 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -321,6 +321,8 @@ void netfs_put_subrequest(struct netfs_io_subrequest *subreq,
ssize_t netfs_extract_user_iter(struct iov_iter *orig, size_t orig_len,
struct iov_iter *new,
iov_iter_extraction_t extraction_flags);
+size_t netfs_limit_iter(const struct iov_iter *iter, size_t start_offset,
+ size_t max_size, size_t max_segs);
int netfs_start_io_read(struct inode *inode);
void netfs_end_io_read(struct inode *inode);