diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2022-06-09 10:28:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2022-08-08 22:37:22 -0400 |
commit | 1ef255e257173f4bc44317ef2076e7e0de688fdf (patch) | |
tree | 700be64ef5aa70a34f6d8158936214e9694e4245 /fs/direct-io.c | |
parent | 3cf42da327f26eb4461864dd64812345b37f4fd9 (diff) |
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/direct-io.c')
-rw-r--r-- | fs/direct-io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index c7fc01c2d509..f669163d5860 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -169,7 +169,7 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio) const enum req_op dio_op = dio->opf & REQ_OP_MASK; ssize_t ret; - ret = iov_iter_get_pages(sdio->iter, dio->pages, LONG_MAX, DIO_PAGES, + ret = iov_iter_get_pages2(sdio->iter, dio->pages, LONG_MAX, DIO_PAGES, &sdio->from); if (ret < 0 && sdio->blocks_available && dio_op == REQ_OP_WRITE) { @@ -191,7 +191,6 @@ static inline int dio_refill_pages(struct dio *dio, struct dio_submit *sdio) } if (ret >= 0) { - iov_iter_advance(sdio->iter, ret); ret += sdio->from; sdio->head = 0; sdio->tail = (ret + PAGE_SIZE - 1) / PAGE_SIZE; |