* [PATCH 02/15] btrfs: Use pagevec_lookup_range_tag() [not found] <20170927160334.29513-1-jack@suse.cz> @ 2017-09-27 16:03 ` Jan Kara 0 siblings, 0 replies; 3+ messages in thread From: Jan Kara @ 2017-09-27 16:03 UTC (permalink / raw) To: Andrew Morton Cc: linux-mm, linux-fsdevel, Jan Kara, linux-btrfs, David Sterba We want only pages from given range in btree_write_cache_pages() and extent_write_cache_pages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: linux-btrfs@vger.kernel.org CC: David Sterba <dsterba@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: Jan Kara <jack@suse.cz> --- fs/btrfs/extent_io.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 0f077c5db58e..9b7936ea3a88 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3819,8 +3819,8 @@ int btree_write_cache_pages(struct address_space *mapping, if (wbc->sync_mode == WB_SYNC_ALL) tag_pages_for_writeback(mapping, index, end); while (!done && !nr_to_write_done && (index <= end) && - (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, - min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) { + (nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, + tag, PAGEVEC_SIZE))) { unsigned i; scanned = 1; @@ -3830,11 +3830,6 @@ int btree_write_cache_pages(struct address_space *mapping, if (!PagePrivate(page)) continue; - if (!wbc->range_cyclic && page->index > end) { - done = 1; - break; - } - spin_lock(&mapping->private_lock); if (!PagePrivate(page)) { spin_unlock(&mapping->private_lock); @@ -3966,8 +3961,8 @@ static int extent_write_cache_pages(struct address_space *mapping, tag_pages_for_writeback(mapping, index, end); done_index = index; while (!done && !nr_to_write_done && (index <= end) && - (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, - min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) { + (nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, + tag, PAGEVEC_SIZE))) { unsigned i; scanned = 1; @@ -3992,12 +3987,6 @@ static int extent_write_cache_pages(struct address_space *mapping, continue; } - if (!wbc->range_cyclic && page->index > end) { - done = 1; - unlock_page(page); - continue; - } - if (wbc->sync_mode != WB_SYNC_NONE) { if (PageWriteback(page)) flush_fn(data); -- 2.12.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <20170914131819.26266-1-jack@suse.cz>]
* [PATCH 02/15] btrfs: Use pagevec_lookup_range_tag() [not found] <20170914131819.26266-1-jack@suse.cz> @ 2017-09-14 13:18 ` Jan Kara 2017-09-14 17:57 ` David Sterba 0 siblings, 1 reply; 3+ messages in thread From: Jan Kara @ 2017-09-14 13:18 UTC (permalink / raw) To: linux-mm Cc: linux-fsdevel, linux-f2fs-devel, Jaegeuk Kim, ceph-devel, Yan, Zheng, Ilya Dryomov, Jan Kara, linux-btrfs, David Sterba We want only pages from given range in btree_write_cache_pages() and extent_write_cache_pages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: linux-btrfs@vger.kernel.org CC: David Sterba <dsterba@suse.com> Signed-off-by: Jan Kara <jack@suse.cz> --- fs/btrfs/extent_io.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 0f077c5db58e..9b7936ea3a88 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3819,8 +3819,8 @@ int btree_write_cache_pages(struct address_space *mapping, if (wbc->sync_mode == WB_SYNC_ALL) tag_pages_for_writeback(mapping, index, end); while (!done && !nr_to_write_done && (index <= end) && - (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, - min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) { + (nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, + tag, PAGEVEC_SIZE))) { unsigned i; scanned = 1; @@ -3830,11 +3830,6 @@ int btree_write_cache_pages(struct address_space *mapping, if (!PagePrivate(page)) continue; - if (!wbc->range_cyclic && page->index > end) { - done = 1; - break; - } - spin_lock(&mapping->private_lock); if (!PagePrivate(page)) { spin_unlock(&mapping->private_lock); @@ -3966,8 +3961,8 @@ static int extent_write_cache_pages(struct address_space *mapping, tag_pages_for_writeback(mapping, index, end); done_index = index; while (!done && !nr_to_write_done && (index <= end) && - (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, tag, - min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) { + (nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, + tag, PAGEVEC_SIZE))) { unsigned i; scanned = 1; @@ -3992,12 +3987,6 @@ static int extent_write_cache_pages(struct address_space *mapping, continue; } - if (!wbc->range_cyclic && page->index > end) { - done = 1; - unlock_page(page); - continue; - } - if (wbc->sync_mode != WB_SYNC_NONE) { if (PageWriteback(page)) flush_fn(data); -- 2.12.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 02/15] btrfs: Use pagevec_lookup_range_tag() 2017-09-14 13:18 ` Jan Kara @ 2017-09-14 17:57 ` David Sterba 0 siblings, 0 replies; 3+ messages in thread From: David Sterba @ 2017-09-14 17:57 UTC (permalink / raw) To: Jan Kara Cc: linux-mm, linux-fsdevel, linux-f2fs-devel, Jaegeuk Kim, ceph-devel, Yan, Zheng, Ilya Dryomov, linux-btrfs, David Sterba On Thu, Sep 14, 2017 at 03:18:06PM +0200, Jan Kara wrote: > We want only pages from given range in btree_write_cache_pages() and > extent_write_cache_pages(). Use pagevec_lookup_range_tag() instead of > pagevec_lookup_tag() and remove unnecessary code. > > CC: linux-btrfs@vger.kernel.org > CC: David Sterba <dsterba@suse.com> > Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: David Sterba <dsterba@suse.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-27 16:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170927160334.29513-1-jack@suse.cz>
2017-09-27 16:03 ` [PATCH 02/15] btrfs: Use pagevec_lookup_range_tag() Jan Kara
[not found] <20170914131819.26266-1-jack@suse.cz>
2017-09-14 13:18 ` Jan Kara
2017-09-14 17:57 ` David Sterba
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).