From patchwork Thu Sep 14 13:18:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9953037 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 E1FBD60230 for ; Thu, 14 Sep 2017 13:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB21C28CD3 for ; Thu, 14 Sep 2017 13:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B00E628D27; Thu, 14 Sep 2017 13:18:50 +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 4BAA628CD3 for ; Thu, 14 Sep 2017 13:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751484AbdINNSn (ORCPT ); Thu, 14 Sep 2017 09:18:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:34100 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751419AbdINNSl (ORCPT ); Thu, 14 Sep 2017 09:18:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 208EAAD4B; Thu, 14 Sep 2017 13:18:38 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D0EAE1E3487; Thu, 14 Sep 2017 15:18:36 +0200 (CEST) From: Jan Kara To: Cc: , linux-f2fs-devel@lists.sourceforge.net, Jaegeuk Kim , ceph-devel@vger.kernel.org, "Yan, Zheng" , Ilya Dryomov , Jan Kara , Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH 09/15] nilfs2: Use pagevec_lookup_range_tag() Date: Thu, 14 Sep 2017 15:18:13 +0200 Message-Id: <20170914131819.26266-10-jack@suse.cz> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170914131819.26266-1-jack@suse.cz> References: <20170914131819.26266-1-jack@suse.cz> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We want only pages from given range in nilfs_lookup_dirty_data_buffers(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Ryusuke Konishi CC: linux-nilfs@vger.kernel.org Signed-off-by: Jan Kara --- fs/nilfs2/segment.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 70ded52dc1dd..68e5769cef3b 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -711,18 +711,14 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, pagevec_init(&pvec, 0); repeat: if (unlikely(index > last) || - !pagevec_lookup_tag(&pvec, mapping, &index, PAGECACHE_TAG_DIRTY, - min_t(pgoff_t, last - index, - PAGEVEC_SIZE - 1) + 1)) + !pagevec_lookup_range_tag(&pvec, mapping, &index, last, + PAGECACHE_TAG_DIRTY, PAGEVEC_SIZE)) return ndirties; for (i = 0; i < pagevec_count(&pvec); i++) { struct buffer_head *bh, *head; struct page *page = pvec.pages[i]; - if (unlikely(page->index > last)) - break; - lock_page(page); if (!page_has_buffers(page)) create_empty_buffers(page, i_blocksize(inode), 0);