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>
This commit is contained in:
Родитель
f7b6804687
Коммит
397162ffa2
|
@ -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);
|
end = (block + len - 1) >> (PAGE_SHIFT - bd_inode->i_blkbits);
|
||||||
pagevec_init(&pvec, 0);
|
pagevec_init(&pvec, 0);
|
||||||
while (pagevec_lookup_range(&pvec, bd_mapping, &index, end,
|
while (pagevec_lookup_range(&pvec, bd_mapping, &index, end)) {
|
||||||
PAGEVEC_SIZE)) {
|
|
||||||
count = pagevec_count(&pvec);
|
count = pagevec_count(&pvec);
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
struct page *page = pvec.pages[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;
|
unsigned nr_pages, i;
|
||||||
|
|
||||||
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, &index,
|
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping, &index,
|
||||||
end - 1, PAGEVEC_SIZE);
|
end - 1);
|
||||||
if (nr_pages == 0)
|
if (nr_pages == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -468,7 +468,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
|
||||||
unsigned long nr_pages;
|
unsigned long nr_pages;
|
||||||
|
|
||||||
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
|
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
|
||||||
&index, end, PAGEVEC_SIZE);
|
&index, end);
|
||||||
if (nr_pages == 0)
|
if (nr_pages == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1720,8 +1720,7 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd,
|
||||||
|
|
||||||
pagevec_init(&pvec, 0);
|
pagevec_init(&pvec, 0);
|
||||||
while (index <= end) {
|
while (index <= end) {
|
||||||
nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end,
|
nr_pages = pagevec_lookup_range(&pvec, mapping, &index, end);
|
||||||
PAGEVEC_SIZE);
|
|
||||||
if (nr_pages == 0)
|
if (nr_pages == 0)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < nr_pages; i++) {
|
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);
|
pagevec_init(&pvec, 0);
|
||||||
while (start <= end) {
|
while (start <= end) {
|
||||||
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
|
nr_pages = pagevec_lookup_range(&pvec, inode->i_mapping,
|
||||||
&start, end, PAGEVEC_SIZE);
|
&start, end);
|
||||||
if (nr_pages == 0)
|
if (nr_pages == 0)
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < nr_pages; i++) {
|
for (i = 0; i < nr_pages; i++) {
|
||||||
|
|
|
@ -1178,7 +1178,7 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
|
||||||
pagevec_init(&pvec, 0);
|
pagevec_init(&pvec, 0);
|
||||||
next = 0;
|
next = 0;
|
||||||
do {
|
do {
|
||||||
if (!pagevec_lookup(&pvec, mapping, &next, PAGEVEC_SIZE))
|
if (!pagevec_lookup(&pvec, mapping, &next))
|
||||||
break;
|
break;
|
||||||
for (i = 0; i < pagevec_count(&pvec); i++) {
|
for (i = 0; i < pagevec_count(&pvec); i++) {
|
||||||
struct page *page = pvec.pages[i];
|
struct page *page = pvec.pages[i];
|
||||||
|
|
|
@ -413,8 +413,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
|
||||||
/*
|
/*
|
||||||
* When no more pages are found, we are done.
|
* When no more pages are found, we are done.
|
||||||
*/
|
*/
|
||||||
if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1,
|
if (!pagevec_lookup_range(&pvec, mapping, &next, end - 1))
|
||||||
PAGEVEC_SIZE))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for (i = 0; i < pagevec_count(&pvec); ++i) {
|
for (i = 0; i < pagevec_count(&pvec); ++i) {
|
||||||
|
|
|
@ -312,7 +312,7 @@ void nilfs_copy_back_pages(struct address_space *dmap,
|
||||||
|
|
||||||
pagevec_init(&pvec, 0);
|
pagevec_init(&pvec, 0);
|
||||||
repeat:
|
repeat:
|
||||||
n = pagevec_lookup(&pvec, smap, &index, PAGEVEC_SIZE);
|
n = pagevec_lookup(&pvec, smap, &index);
|
||||||
if (!n)
|
if (!n)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,12 @@ unsigned pagevec_lookup_entries(struct pagevec *pvec,
|
||||||
void pagevec_remove_exceptionals(struct pagevec *pvec);
|
void pagevec_remove_exceptionals(struct pagevec *pvec);
|
||||||
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
||||||
struct address_space *mapping,
|
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,
|
static inline unsigned pagevec_lookup(struct pagevec *pvec,
|
||||||
struct address_space *mapping,
|
struct address_space *mapping,
|
||||||
pgoff_t *start, unsigned nr_pages)
|
pgoff_t *start)
|
||||||
{
|
{
|
||||||
return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1,
|
return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1);
|
||||||
nr_pages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned pagevec_lookup_tag(struct pagevec *pvec,
|
unsigned pagevec_lookup_tag(struct pagevec *pvec,
|
||||||
|
|
|
@ -967,10 +967,9 @@ void pagevec_remove_exceptionals(struct pagevec *pvec)
|
||||||
* reached.
|
* reached.
|
||||||
*/
|
*/
|
||||||
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
||||||
struct address_space *mapping, pgoff_t *start, pgoff_t end,
|
struct address_space *mapping, pgoff_t *start, pgoff_t end)
|
||||||
unsigned nr_pages)
|
|
||||||
{
|
{
|
||||||
pvec->nr = find_get_pages_range(mapping, start, end, nr_pages,
|
pvec->nr = find_get_pages_range(mapping, start, end, PAGEVEC_SIZE,
|
||||||
pvec->pages);
|
pvec->pages);
|
||||||
return pagevec_count(pvec);
|
return pagevec_count(pvec);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче