mm: remove nr_pages argument from pagevec_lookup{,_range}()
authorJan Kara <jack@suse.cz>
Wed, 6 Sep 2017 23:21:43 +0000 (16:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 00:27:27 +0000 (17:27 -0700)
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>
fs/buffer.c
fs/ext4/file.c
fs/ext4/inode.c
fs/fscache/page.c
fs/hugetlbfs/inode.c
fs/nilfs2/page.c
include/linux/pagevec.h
mm/swap.c

index 8770b58ca56979441c21e0fe3652fecb24ee2c83..50da0e102ca0c479aaed688ea65c01c33a919fdf 100644 (file)
@@ -1633,8 +1633,7 @@ void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len)
 
        end = (block + len - 1) >> (PAGE_SHIFT - bd_inode->i_blkbits);
        pagevec_init(&pvec, 0);
-       while (pagevec_lookup_range(&pvec, bd_mapping, &index, end,
-                                   PAGEVEC_SIZE)) {
+       while (pagevec_lookup_range(&pvec, bd_mapping, &index, end)) {
                count = pagevec_count(&pvec);
                for (i = 0; i < count; i++) {
                        struct page *page = pvec.pages[i];
@@ -3552,7 +3551,7 @@ page_cache_seek_hole_data(struct inode *inode, loff_t offset, loff_t length,
                unsigned nr_pages, i;
 
                nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, &index,
-                                               end - 1, PAGEVEC_SIZE);
+                                               end - 1);
                if (nr_pages == 0)
                        break;
 
index 7263448097212fba7e0cfbbe2adacbb01d2b1dac..484c1326dd6a4fe5cd96041c62b4b663630b8e43 100644 (file)
@@ -468,7 +468,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                unsigned long nr_pages;
 
                nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
-                                       &index, end, PAGEVEC_SIZE);
+                                       &index, end);
                if (nr_pages == 0)
                        break;
 
index 6103ce0430dfc07f5f5a434ce159c3ed8b6e80d5..ce68a34836668c8cbb58d498a930942b03848d28 100644 (file)
@@ -1720,8 +1720,7 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd,
 
        pagevec_init(&pvec, 0);
        while (index <= end) {
-               nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end,
-                                               PAGEVEC_SIZE);
+               nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end);
                if (nr_pages == 0)
                        break;
                for (i = 0; i < nr_pages; i++) {
@@ -2348,7 +2347,7 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
        pagevec_init(&pvec, 0);
        while (start <= end) {
                nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
-                                               &start, end, PAGEVEC_SIZE);
+                                               &start, end);
                if (nr_pages == 0)
                        break;
                for (i = 0; i < nr_pages; i++) {
index 83018861dcd28e4c48e8100c009076305b8f4169..0ad3fd3ad0b477c3e0ee2b74d4af78977e405f7b 100644 (file)
@@ -1178,7 +1178,7 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
        pagevec_init(&pvec, 0);
        next = 0;
        do {
-               if (!pagevec_lookup(&pvec, mapping, &next, PAGEVEC_SIZE))
+               if (!pagevec_lookup(&pvec, mapping, &next))
                        break;
                for (i = 0; i < pagevec_count(&pvec); i++) {
                        struct page *page = pvec.pages[i];
index 8931236f3ef46cf8f94a6f518225afaa39ed0add..7c02b3f738e15b9942198350290f68b1796074b4 100644 (file)
@@ -413,8 +413,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
                /*
                 * When no more pages are found, we are done.
                 */
-               if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1,
-                                         PAGEVEC_SIZE))
+               if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1))
                        break;
 
                for (i = 0; i < pagevec_count(&pvec); ++i) {
index 382a36c72d728f996864456491851318d78d40cc..8616c46d33da3849673044b46a643af30b958b07 100644 (file)
@@ -312,7 +312,7 @@ 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);
        if (!n)
                return;
 
index 7df056910437d1e4feb595fc2744532770b02b0f..4dcd5506f1ed02768a2b5d1654767e8f1293d4f9 100644 (file)
@@ -29,13 +29,12 @@ unsigned pagevec_lookup_entries(struct pagevec *pvec,
 void pagevec_remove_exceptionals(struct pagevec *pvec);
 unsigned pagevec_lookup_range(struct pagevec *pvec,
                              struct address_space *mapping,
-                             pgoff_t *start, pgoff_t end, unsigned nr_pages);
+                             pgoff_t *start, pgoff_t end);
 static inline unsigned pagevec_lookup(struct pagevec *pvec,
                                      struct address_space *mapping,
-                                     pgoff_t *start, unsigned nr_pages)
+                                     pgoff_t *start)
 {
-       return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1,
-                                   nr_pages);
+       return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1);
 }
 
 unsigned pagevec_lookup_tag(struct pagevec *pvec,
index e06e9aa2478ea13dac02a1d5206a8bc54fb4f4ee..62d96b8e5eb3b01a51f48bcde87aabf591c72d96 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -967,10 +967,9 @@ void pagevec_remove_exceptionals(struct pagevec *pvec)
  * reached.
  */
 unsigned pagevec_lookup_range(struct pagevec *pvec,
-               struct address_space *mapping, pgoff_t *start, pgoff_t end,
-               unsigned nr_pages)
+               struct address_space *mapping, pgoff_t *start, pgoff_t end)
 {
-       pvec->nr = find_get_pages_range(mapping, start, end, nr_pages,
+       pvec->nr = find_get_pages_range(mapping, start, end, PAGEVEC_SIZE,
                                        pvec->pages);
        return pagevec_count(pvec);
 }