Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: remove nr_pages argument from pagevec_lookup{,_range}()

All users of pagevec_lookup() and pagevec_lookup_range() now pass
PAGEVEC_SIZE as a desired number of pages.

Just drop the argument.

Link: http://lkml.kernel.org/r/20170726114704.7626-11-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>

authored by

Jan Kara and committed by
Linus Torvalds
397162ff f7b68046

+13 -18
+2 -3
fs/buffer.c
··· 1633 1633 1634 1634 end = (block + len - 1) >> (PAGE_SHIFT - bd_inode->i_blkbits); 1635 1635 pagevec_init(&pvec, 0); 1636 - while (pagevec_lookup_range(&pvec, bd_mapping, &index, end, 1637 - PAGEVEC_SIZE)) { 1636 + while (pagevec_lookup_range(&pvec, bd_mapping, &index, end)) { 1638 1637 count = pagevec_count(&pvec); 1639 1638 for (i = 0; i < count; i++) { 1640 1639 struct page *page = pvec.pages[i]; ··· 3551 3552 unsigned nr_pages, i; 3552 3553 3553 3554 nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, &index, 3554 - end - 1, PAGEVEC_SIZE); 3555 + end - 1); 3555 3556 if (nr_pages == 0) 3556 3557 break; 3557 3558
+1 -1
fs/ext4/file.c
··· 468 468 unsigned long nr_pages; 469 469 470 470 nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, 471 - &index, end, PAGEVEC_SIZE); 471 + &index, end); 472 472 if (nr_pages == 0) 473 473 break; 474 474
+2 -3
fs/ext4/inode.c
··· 1720 1720 1721 1721 pagevec_init(&pvec, 0); 1722 1722 while (index <= end) { 1723 - nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end, 1724 - PAGEVEC_SIZE); 1723 + nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end); 1725 1724 if (nr_pages == 0) 1726 1725 break; 1727 1726 for (i = 0; i < nr_pages; i++) { ··· 2347 2348 pagevec_init(&pvec, 0); 2348 2349 while (start <= end) { 2349 2350 nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, 2350 - &start, end, PAGEVEC_SIZE); 2351 + &start, end); 2351 2352 if (nr_pages == 0) 2352 2353 break; 2353 2354 for (i = 0; i < nr_pages; i++) {
+1 -1
fs/fscache/page.c
··· 1178 1178 pagevec_init(&pvec, 0); 1179 1179 next = 0; 1180 1180 do { 1181 - if (!pagevec_lookup(&pvec, mapping, &next, PAGEVEC_SIZE)) 1181 + if (!pagevec_lookup(&pvec, mapping, &next)) 1182 1182 break; 1183 1183 for (i = 0; i < pagevec_count(&pvec); i++) { 1184 1184 struct page *page = pvec.pages[i];
+1 -2
fs/hugetlbfs/inode.c
··· 413 413 /* 414 414 * When no more pages are found, we are done. 415 415 */ 416 - if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1, 417 - PAGEVEC_SIZE)) 416 + if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1)) 418 417 break; 419 418 420 419 for (i = 0; i < pagevec_count(&pvec); ++i) {
+1 -1
fs/nilfs2/page.c
··· 312 312 313 313 pagevec_init(&pvec, 0); 314 314 repeat: 315 - n = pagevec_lookup(&pvec, smap, &index, PAGEVEC_SIZE); 315 + n = pagevec_lookup(&pvec, smap, &index); 316 316 if (!n) 317 317 return; 318 318
+3 -4
include/linux/pagevec.h
··· 29 29 void pagevec_remove_exceptionals(struct pagevec *pvec); 30 30 unsigned pagevec_lookup_range(struct pagevec *pvec, 31 31 struct address_space *mapping, 32 - pgoff_t *start, pgoff_t end, unsigned nr_pages); 32 + pgoff_t *start, pgoff_t end); 33 33 static inline unsigned pagevec_lookup(struct pagevec *pvec, 34 34 struct address_space *mapping, 35 - pgoff_t *start, unsigned nr_pages) 35 + pgoff_t *start) 36 36 { 37 - return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1, 38 - nr_pages); 37 + return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1); 39 38 } 40 39 41 40 unsigned pagevec_lookup_tag(struct pagevec *pvec,
+2 -3
mm/swap.c
··· 967 967 * reached. 968 968 */ 969 969 unsigned pagevec_lookup_range(struct pagevec *pvec, 970 - struct address_space *mapping, pgoff_t *start, pgoff_t end, 971 - unsigned nr_pages) 970 + struct address_space *mapping, pgoff_t *start, pgoff_t end) 972 971 { 973 - pvec->nr = find_get_pages_range(mapping, start, end, nr_pages, 972 + pvec->nr = find_get_pages_range(mapping, start, end, PAGEVEC_SIZE, 974 973 pvec->pages); 975 974 return pagevec_count(pvec); 976 975 }