Commit 836978b3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

mm: give the 'ret' variable a better name __do_page_cache_readahead

It counts the number of pages acted on, so name it nr_pages to make that
obvious.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 0aa69fd3
...@@ -156,7 +156,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, ...@@ -156,7 +156,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
unsigned long end_index; /* The last page we want to read */ unsigned long end_index; /* The last page we want to read */
LIST_HEAD(page_pool); LIST_HEAD(page_pool);
int page_idx; int page_idx;
int ret = 0; int nr_pages = 0;
loff_t isize = i_size_read(inode); loff_t isize = i_size_read(inode);
gfp_t gfp_mask = readahead_gfp_mask(mapping); gfp_t gfp_mask = readahead_gfp_mask(mapping);
...@@ -187,7 +187,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, ...@@ -187,7 +187,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
list_add(&page->lru, &page_pool); list_add(&page->lru, &page_pool);
if (page_idx == nr_to_read - lookahead_size) if (page_idx == nr_to_read - lookahead_size)
SetPageReadahead(page); SetPageReadahead(page);
ret++; nr_pages++;
} }
/* /*
...@@ -195,11 +195,11 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, ...@@ -195,11 +195,11 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
* uptodate then the caller will launch readpage again, and * uptodate then the caller will launch readpage again, and
* will then handle the error. * will then handle the error.
*/ */
if (ret) if (nr_pages)
read_pages(mapping, filp, &page_pool, ret, gfp_mask); read_pages(mapping, filp, &page_pool, nr_pages, gfp_mask);
BUG_ON(!list_empty(&page_pool)); BUG_ON(!list_empty(&page_pool));
out: out:
return ret; return nr_pages;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment