[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170601093245.29238-24-jack@suse.cz>
Date: Thu, 1 Jun 2017 11:32:33 +0200
From: Jan Kara <jack@...e.cz>
To: <linux-mm@...ck.org>
Cc: Hugh Dickins <hughd@...gle.com>,
David Howells <dhowells@...hat.com>,
linux-afs@...ts.infradead.org,
Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>,
linux-nilfs@...r.kernel.org, Bob Peterson <rpeterso@...hat.com>,
cluster-devel@...hat.com, Jaegeuk Kim <jaegeuk@...nel.org>,
linux-f2fs-devel@...ts.sourceforge.net, tytso@....edu,
linux-ext4@...r.kernel.org, Ilya Dryomov <idryomov@...il.com>,
"Yan, Zheng" <zyan@...hat.com>, ceph-devel@...r.kernel.org,
linux-btrfs@...r.kernel.org, David Sterba <dsterba@...e.com>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
linux-xfs@...r.kernel.org,
Nadia Yvette Chambers <nyc@...omorphy.com>,
Jan Kara <jack@...e.cz>
Subject: [PATCH 23/35] mm: Use pagevec_lookup_range_tag() in __filemap_fdatawait_range()
Use pagevec_lookup_range_tag() in __filemap_fdatawait_range() as it is
interested only in pages from given range. Remove unnecessary code
resulting from this.
Signed-off-by: Jan Kara <jack@...e.cz>
---
mm/filemap.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 56af68f6a375..8039b6bb9c27 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -390,18 +390,13 @@ static int __filemap_fdatawait_range(struct address_space *mapping,
pagevec_init(&pvec, 0);
while ((index <= end) &&
- (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
- PAGECACHE_TAG_WRITEBACK,
- min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)) != 0) {
+ (nr_pages = pagevec_lookup_range_tag(&pvec, mapping,
+ &index, end, PAGECACHE_TAG_WRITEBACK, PAGEVEC_SIZE))) {
unsigned i;
for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i];
- /* until radix tree lookup accepts end_index */
- if (page->index > end)
- continue;
-
wait_on_page_writeback(page);
if (TestClearPageError(page))
ret = -EIO;
--
2.12.3
Powered by blists - more mailing lists