From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: [patch 021/128] mm: rename readahead loop variable to 'i' Date: Mon, 01 Jun 2020 21:46:32 -0700 Message-ID: <20200602044632.8YXBT-fpk%akpm@linux-foundation.org> References: <20200601214457.919c35648e96a2b46b573fe1@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:37286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbgFBEqf (ORCPT ); Tue, 2 Jun 2020 00:46:35 -0400 In-Reply-To: <20200601214457.919c35648e96a2b46b573fe1@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: akpm@linux-foundation.org, darrick.wong@oracle.com, dchinner@redhat.com, ebiggers@google.com, gaoxiang25@huawei.com, hch@lst.de, jaegeuk@kernel.org, jhubbard@nvidia.com, johannes.thumshirn@wdc.com, joseph.qi@linux.alibaba.com, junxiao.bi@oracle.com, linux-mm@kvack.org, mhocko@suse.com, mm-commits@vger.kernel.org, mszeredi@redhat.com, torvalds@linux-foundation.org, william.kucharski@oracle.com, willy@infradead.org, xiyou.wangcong@gmail.com, yuchao0@huawei.com, ziy@nvidia.com From: "Matthew Wilcox (Oracle)" Subject: mm: rename readahead loop variable to 'i' Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Link: http://lkml.kernel.org/r/20200414150233.24495-9-willy@infradead.org Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Johannes Thumshirn Cc: Chao Yu Cc: Christoph Hellwig Cc: Cong Wang Cc: Darrick J. Wong Cc: Eric Biggers Cc: Gao Xiang Cc: Jaegeuk Kim Cc: Joseph Qi Cc: Junxiao Bi Cc: Michal Hocko Cc: Zi Yan Cc: Miklos Szeredi Signed-off-by: Andrew Morton --- mm/readahead.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/mm/readahead.c~mm-rename-readahead-loop-variable-to-i +++ a/mm/readahead.c @@ -163,13 +163,13 @@ void __do_page_cache_readahead(struct ad 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 = { .mapping = mapping, .file = filp, }; + unsigned long i; if (isize == 0) return; @@ -179,8 +179,8 @@ void __do_page_cache_readahead(struct ad /* * 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; @@ -201,7 +201,7 @@ void __do_page_cache_readahead(struct ad 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++; } _