summaryrefslogtreecommitdiffstats
path: root/fs/ext4/file.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-09-06 16:21:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-06 17:27:26 -0700
commitd72dc8a25afc71ce90ee92bdd77550e9beb85d4d (patch)
treeda47df20fe7bd2672f8368a2545f82e17703820b /fs/ext4/file.c
parent26b433d0da062d6e19d75350c0171d3cf8ff560d (diff)
downloadlinux-d72dc8a25afc71ce90ee92bdd77550e9beb85d4d.tar.bz2
mm: make pagevec_lookup() update index
Make pagevec_lookup() (and underlying find_get_pages()) update index to the next page where iteration should continue. Most callers want this and also pagevec_lookup_tag() already does this. Link: http://lkml.kernel.org/r/20170726114704.7626-3-jack@suse.cz Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r--fs/ext4/file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index f28ac999dfba..1c73b21fdc13 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -468,7 +468,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
unsigned long nr_pages;
num = min_t(pgoff_t, end - index, PAGEVEC_SIZE - 1) + 1;
- nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index,
+ nr_pages = pagevec_lookup(&pvec, inode->i_mapping, &index,
(pgoff_t)num);
if (nr_pages == 0)
break;
@@ -536,8 +536,6 @@ next:
/* The no. of pages is less than our desired, we are done. */
if (nr_pages < num)
break;
-
- index = pvec.pages[i - 1]->index + 1;
pagevec_release(&pvec);
} while (index <= end);