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>
This commit is contained in:
@@ -312,10 +312,9 @@ void nilfs_copy_back_pages(struct address_space *dmap,
|
||||
|
||||
pagevec_init(&pvec, 0);
|
||||
repeat:
|
||||
n = pagevec_lookup(&pvec, smap, index, PAGEVEC_SIZE);
|
||||
n = pagevec_lookup(&pvec, smap, &index, PAGEVEC_SIZE);
|
||||
if (!n)
|
||||
return;
|
||||
index = pvec.pages[n - 1]->index + 1;
|
||||
|
||||
for (i = 0; i < pagevec_count(&pvec); i++) {
|
||||
struct page *page = pvec.pages[i], *dpage;
|
||||
|
||||
Reference in New Issue
Block a user