From: Jan Kara <jack@suse.cz> To: Andrew Morton <akpm@linux-foundation.org> Cc: Jan Kara <jack@suse.cz>, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim <jaegeuk@kernel.org>, Daniel Jordan <daniel.m.jordan@oracle.com> Subject: [PATCH 05/16] f2fs: Use pagevec_lookup_range_tag() Date: Mon, 9 Oct 2017 17:13:48 +0200 Message-ID: <20171009151359.31984-6-jack@suse.cz> (raw) In-Reply-To: <20171009151359.31984-1-jack@suse.cz> We want only pages from given range in f2fs_write_cache_pages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Jaegeuk Kim <jaegeuk@kernel.org> CC: linux-f2fs-devel@lists.sourceforge.net Reviewed-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz> --- fs/f2fs/data.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 36b535207c88..17d2c2997ddd 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1669,8 +1669,8 @@ static int f2fs_write_cache_pages(struct address_space *mapping, while (!done && (index <= end)) { int i; - 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); if (nr_pages == 0) break; @@ -1678,11 +1678,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping, struct page *page = pvec.pages[i]; bool submitted = false; - if (page->index > end) { - done = 1; - break; - } - done_index = page->index; retry_write: lock_page(page); -- 2.12.3 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next parent reply index Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20171009151359.31984-1-jack@suse.cz> 2017-10-09 15:13 ` Jan Kara [this message] 2017-10-09 15:13 ` [PATCH 06/16] f2fs: Simplify page iteration loops Jan Kara 2017-10-09 15:13 ` [PATCH 07/16] f2fs: Use find_get_pages_tag() for looking up single page Jan Kara
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20171009151359.31984-6-jack@suse.cz \ --to=jack@suse.cz \ --cc=akpm@linux-foundation.org \ --cc=daniel.m.jordan@oracle.com \ --cc=jaegeuk@kernel.org \ --cc=linux-f2fs-devel@lists.sourceforge.net \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-mm@kvack.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-f2fs-devel Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-f2fs-devel/0 linux-f2fs-devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ https://lore.kernel.org/linux-f2fs-devel \ linux-f2fs-devel@lists.sourceforge.net public-inbox-index linux-f2fs-devel Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/net.sourceforge.lists.linux-f2fs-devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git