netfs: Add func to calculate pagecount/size-limited span of an iterator
authorDavid Howells <dhowells@redhat.com>
Fri, 22 Sep 2023 13:49:47 +0000 (14:49 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 28 Dec 2023 09:45:18 +0000 (09:45 +0000)
commitcae932d3aee55035a54415dcea8e7ecf2ec469b5
tree9d0889f665bd9eb53da4cfa4387cfb6aff60973c
parent7d828a06634799aba0fa392913c7fe2953eb64a6
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
fs/netfs/iterator.c
include/linux/netfs.h