From patchwork Wed Sep 27 16:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9974333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DD8860365 for ; Wed, 27 Sep 2017 16:04:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E6CC26E47 for ; Wed, 27 Sep 2017 16:04:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 733A229109; Wed, 27 Sep 2017 16:04:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1DCC29107 for ; Wed, 27 Sep 2017 16:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436AbdI0QD6 (ORCPT ); Wed, 27 Sep 2017 12:03:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:59025 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753032AbdI0QD4 (ORCPT ); Wed, 27 Sep 2017 12:03:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0657FACF9; Wed, 27 Sep 2017 16:03:55 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 715B01E35C2; Wed, 27 Sep 2017 18:03:54 +0200 (CEST) From: Jan Kara To: Andrew Morton Cc: , , Jan Kara , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 05/15] f2fs: Use pagevec_lookup_range_tag() Date: Wed, 27 Sep 2017 18:03:24 +0200 Message-Id: <20170927160334.29513-6-jack@suse.cz> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170927160334.29513-1-jack@suse.cz> References: <20170927160334.29513-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 CC: linux-f2fs-devel@lists.sourceforge.net Reviewed-by: Chao Yu Signed-off-by: Jan Kara --- 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);