diff options
author | Christoph Hellwig <hch@lst.de> | 2018-06-01 18:03:05 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-02 03:37:32 +0200 |
commit | 836978b35fcd402a31323a16ac0b4c8242890a84 (patch) | |
tree | 5699a54a1a2060ad7115e7c4102316260c634fe2 /mm/readahead.c | |
parent | block: add a lower-level bio_add_page interface (diff) | |
download | linux-836978b35fcd402a31323a16ac0b4c8242890a84.tar.xz linux-836978b35fcd402a31323a16ac0b4c8242890a84.zip |
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to '')
-rw-r--r-- | mm/readahead.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index 539bbb6c1fad..16d0cb1e2616 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -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 */ LIST_HEAD(page_pool); int page_idx; - int ret = 0; + int nr_pages = 0; loff_t isize = i_size_read(inode); gfp_t gfp_mask = readahead_gfp_mask(mapping); @@ -187,7 +187,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, list_add(&page->lru, &page_pool); if (page_idx == nr_to_read - lookahead_size) SetPageReadahead(page); - ret++; + nr_pages++; } /* @@ -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 * will then handle the error. */ - if (ret) - read_pages(mapping, filp, &page_pool, ret, gfp_mask); + if (nr_pages) + read_pages(mapping, filp, &page_pool, nr_pages, gfp_mask); BUG_ON(!list_empty(&page_pool)); out: - return ret; + return nr_pages; } /* |