diff options
author | Jan Kara <jack@suse.cz> | 2017-11-15 20:34:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-15 21:21:04 -0500 |
commit | d2bc5b3c67a9cce28616fd90e1651b9c9246fae8 (patch) | |
tree | 8f65f4083058c8d2313f2ea3eea00064d5625232 | |
parent | 8faab64229a5d5f5ab624cbe5d5286d5b74c76cd (diff) |
gfs2: use pagevec_lookup_range_tag()
We want only pages from given range in gfs2_write_cache_jdata(). Use
pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove
unnecessary code.
Link: http://lkml.kernel.org/r/20171009151359.31984-9-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/gfs2/aops.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 68ed06962537..d0848d9623fb 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -280,22 +280,6 @@ static int gfs2_write_jdata_pagevec(struct address_space *mapping, | |||
280 | for(i = 0; i < nr_pages; i++) { | 280 | for(i = 0; i < nr_pages; i++) { |
281 | struct page *page = pvec->pages[i]; | 281 | struct page *page = pvec->pages[i]; |
282 | 282 | ||
283 | /* | ||
284 | * At this point, the page may be truncated or | ||
285 | * invalidated (changing page->mapping to NULL), or | ||
286 | * even swizzled back from swapper_space to tmpfs file | ||
287 | * mapping. However, page->index will not change | ||
288 | * because we have a reference on the page. | ||
289 | */ | ||
290 | if (page->index > end) { | ||
291 | /* | ||
292 | * can't be range_cyclic (1st pass) because | ||
293 | * end == -1 in that case. | ||
294 | */ | ||
295 | ret = 1; | ||
296 | break; | ||
297 | } | ||
298 | |||
299 | *done_index = page->index; | 283 | *done_index = page->index; |
300 | 284 | ||
301 | lock_page(page); | 285 | lock_page(page); |
@@ -413,8 +397,8 @@ retry: | |||
413 | tag_pages_for_writeback(mapping, index, end); | 397 | tag_pages_for_writeback(mapping, index, end); |
414 | done_index = index; | 398 | done_index = index; |
415 | while (!done && (index <= end)) { | 399 | while (!done && (index <= end)) { |
416 | nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, | 400 | nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, |
417 | min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1); | 401 | tag, PAGEVEC_SIZE); |
418 | if (nr_pages == 0) | 402 | if (nr_pages == 0) |
419 | break; | 403 | break; |
420 | 404 | ||