diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2022-06-09 16:28:36 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2022-08-09 04:37:22 +0200 |
commit | 1ef255e257173f4bc44317ef2076e7e0de688fdf (patch) | |
tree | 700be64ef5aa70a34f6d8158936214e9694e4245 /fs/fuse/file.c | |
parent | iov_iter: saner helper for page array allocation (diff) | |
download | linux-1ef255e257173f4bc44317ef2076e7e0de688fdf.tar.xz linux-1ef255e257173f4bc44317ef2076e7e0de688fdf.zip |
iov_iter: advancing variants of iov_iter_get_pages{,_alloc}()
Most of the users immediately follow successful iov_iter_get_pages()
with advancing by the amount it had returned.
Provide inline wrappers doing that, convert trivial open-coded
uses of those.
BTW, iov_iter_get_pages() never returns more than it had been asked
to; such checks in cifs ought to be removed someday...
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r-- | fs/fuse/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index c982e3afe3b4..69e19fc0afc1 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1401,14 +1401,13 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii, while (nbytes < *nbytesp && ap->num_pages < max_pages) { unsigned npages; size_t start; - ret = iov_iter_get_pages(ii, &ap->pages[ap->num_pages], + ret = iov_iter_get_pages2(ii, &ap->pages[ap->num_pages], *nbytesp - nbytes, max_pages - ap->num_pages, &start); if (ret < 0) break; - iov_iter_advance(ii, ret); nbytes += ret; ret += start; |