[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200219210103.32400-8-willy@infradead.org>
Date: Wed, 19 Feb 2020 13:00:46 -0800
From: Matthew Wilcox <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
cluster-devel@...hat.com, ocfs2-devel@....oracle.com,
linux-xfs@...r.kernel.org, John Hubbard <jhubbard@...dia.com>,
Dave Chinner <dchinner@...hat.com>
Subject: [PATCH v7 07/24] mm: rename readahead loop variable to 'i'
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Change the type of page_idx to unsigned long, and rename it -- it's
just a loop counter, not a page index.
Suggested-by: John Hubbard <jhubbard@...dia.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Reviewed-by: Dave Chinner <dchinner@...hat.com>
---
mm/readahead.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/readahead.c b/mm/readahead.c
index 096cf9020648..8a25fc7e2bf2 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -163,7 +163,6 @@ void __do_page_cache_readahead(struct address_space *mapping,
struct page *page;
unsigned long end_index; /* The last page we want to read */
LIST_HEAD(page_pool);
- int page_idx;
loff_t isize = i_size_read(inode);
gfp_t gfp_mask = readahead_gfp_mask(mapping);
struct readahead_control rac = {
@@ -171,6 +170,7 @@ void __do_page_cache_readahead(struct address_space *mapping,
.file = filp,
._nr_pages = 0,
};
+ unsigned long i;
if (isize == 0)
return;
@@ -180,8 +180,8 @@ void __do_page_cache_readahead(struct address_space *mapping,
/*
* Preallocate as many pages as we will need.
*/
- for (page_idx = 0; page_idx < nr_to_read; page_idx++) {
- pgoff_t page_offset = index + page_idx;
+ for (i = 0; i < nr_to_read; i++) {
+ pgoff_t page_offset = index + i;
if (page_offset > end_index)
break;
@@ -202,7 +202,7 @@ void __do_page_cache_readahead(struct address_space *mapping,
break;
page->index = page_offset;
list_add(&page->lru, &page_pool);
- if (page_idx == nr_to_read - lookahead_size)
+ if (i == nr_to_read - lookahead_size)
SetPageReadahead(page);
rac._nr_pages++;
}
--
2.25.0
Powered by blists - more mailing lists