[v4,20/23] nilfs2: Convert nilfs_btree_lookup_dirty_buffers() to use filemap_get_folios_tag()
Message ID | 20221102161031.5820-21-vishal.moola@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp6092wru; Wed, 2 Nov 2022 09:16:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7qLOQRIPTvoN3t3AvFACd49FqLdhhQk+8Kktj3kSxmuTbQHjMTBq9SA4lPcRHYNKH/F2iO X-Received: by 2002:a17:906:cc4d:b0:7ad:b598:9a53 with SMTP id mm13-20020a170906cc4d00b007adb5989a53mr22298381ejb.480.1667405801056; Wed, 02 Nov 2022 09:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667405801; cv=none; d=google.com; s=arc-20160816; b=iAxLMkOMpzpk2JJYdw7cyAd3wXrxzo52UWMI6cIAJI9dekJvnNyDdP2LKapLBxJ2UZ B22AVhcVLGxcoDabkHaHQGuls7i7DX9TaettjTq4qsEQ+WD2PEev8g3P1ToTHAFboGQK QICJQFcSgRngRMZt9B55PkiXnXL89cUDkJQhnSlutuT+Hq4RFfA0S6kiIIROcjw9bPtN peomKaajvKBmeSGDNRLgW8xMvpFkRzswRJzMlBCC0r5/2qnMHA+BoCfHdnuBvgs/lMhd 7zG1MGrYileR/YdNMkqfh3YqRAdtUSwXeQqEJhmdEkKej58e1N3DB7GIFU9mrHIDIxop Vf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BlC7rcv7uN/Ok17R0azuMVwGkvRCqLRr8I16XJ1l0Zg=; b=RbmsWBFNSqK5/BPDsMCeMdQ9dMjwT6hOllimu0ayPahB5b+wwHfuxmrVMCakGXbfLu n5n9BoehCgbEa6og+pH6JulbN8VbxHdIWQdlot0Ua92daB5D9bXVkNFrrh+XkqJ+l2gO 7WiODCF4rRwp6dAJ3R8I9g07SdAyBsrvgqLq9W7xWJQ36r9eUeMKfXRQ0Bd3OrtSEzE4 7siJeaHUGeoDL0mHvLmQFunzQmBHNB4FCQ2m8j2vnZ/6tpuXTM3SBgUPBd5YIfynimsA bIdCufsk45YA4qvEUStI1kmuwKA1csHHSdJF3GmZJtzQaoIRf+RMCxEdU/VJ8legurZD UuSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Nq5OC7/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a056402090d00b00463817b0ba1si13110924edz.163.2022.11.02.09.16.16; Wed, 02 Nov 2022 09:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Nq5OC7/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231701AbiKBQNr (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 12:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbiKBQMH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 12:12:07 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BB1E2CE3B; Wed, 2 Nov 2022 09:11:37 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id v28so16646002pfi.12; Wed, 02 Nov 2022 09:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BlC7rcv7uN/Ok17R0azuMVwGkvRCqLRr8I16XJ1l0Zg=; b=Nq5OC7/qho070kMTIR5kedhLSGx2YL5E36Blk/zAHlfy6q42bFls2+pa4RnB8ovU/3 23vNW1b/D7YHHKye0/4R/8zfNZQd1v8t3O7W30JyYK8TO3BPzuGAvu8+idJLehY48eH0 nTA2LRYP2Tci8THpRdHRqOdUYAvC3WYgum+zsQ45VXVUlAh+7LDKxfOfFDNSJdU1TCHI 654ZghJ33xktcPdPAHAEZ2WzWNJD2pfRdlYSjV2sZ+0y6oREU3jCVDH6UyjTHuPXqQAv 7tNhrDH+d3WfX8ldYnIx9oUWEl/bGnai6OMrkkhyLBvzLpImZOGi3fus7xAeqEFsIJc3 iWsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BlC7rcv7uN/Ok17R0azuMVwGkvRCqLRr8I16XJ1l0Zg=; b=Fvuck+1W+cJTXC+sWfGTou//2NskyBwOZQg6ovylETjIEpiuuh3jAGwcY99xCLQCP+ p11sOrlC48E7gKeehx/HzdU6pezWfdPVN173i1NoAO3Gd4oyU9kY0nfZjrpvgKgB3s3Z m2Xy2v5V3mzQr5cDiD7rn6dylvHbDlSLQNkEVCkFJs6DwCFPTxjXbZRCSbiXCFzCXGxo Zi+taG3sWkQBVn1EvWUtOweIzjAH6rohFV9LeU96/5/AS7T8TXM521ZOLZz58kH9CTmh yFyulNsLyiVp32h1BVsNXAueHaiDIRK9eXgO+wKhn5lMYeg7u84fqH2LTXYY6QNl2YQx DCAw== X-Gm-Message-State: ACrzQf0oLsB690EsION+9y1SUL5g9ZgUfDCRXBujqKOCyY1rmSnHxt4l lpZz+ypCufEZOpD6kvIDX1OfXrdprDh7kw== X-Received: by 2002:a63:85c8:0:b0:46e:c387:c85f with SMTP id u191-20020a6385c8000000b0046ec387c85fmr22258571pgd.105.1667405497249; Wed, 02 Nov 2022 09:11:37 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::8080]) by smtp.googlemail.com with ESMTPSA id ms4-20020a17090b234400b00210c84b8ae5sm1632101pjb.35.2022.11.02.09.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 09:11:36 -0700 (PDT) From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com> To: linux-fsdevel@vger.kernel.org Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nilfs@vger.kernel.org, linux-mm@kvack.org, "Vishal Moola (Oracle)" <vishal.moola@gmail.com>, Ryusuke Konishi <konishi.ryusuke@gmail.com> Subject: [PATCH v4 20/23] nilfs2: Convert nilfs_btree_lookup_dirty_buffers() to use filemap_get_folios_tag() Date: Wed, 2 Nov 2022 09:10:28 -0700 Message-Id: <20221102161031.5820-21-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102161031.5820-1-vishal.moola@gmail.com> References: <20221102161031.5820-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748401705406429179?= X-GMAIL-MSGID: =?utf-8?q?1748401705406429179?= |
Series |
Convert to filemap_get_folios_tag()
|
|
Commit Message
Vishal Moola
Nov. 2, 2022, 4:10 p.m. UTC
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). This change removes 1 call to compound_head(). Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com> Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> --- fs/nilfs2/btree.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index b9d15c3df3cc..da6a19eede9a 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c @@ -2141,7 +2141,7 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree, struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode; struct address_space *btcache = btnc_inode->i_mapping; struct list_head lists[NILFS_BTREE_LEVEL_MAX]; - struct pagevec pvec; + struct folio_batch fbatch; struct buffer_head *bh, *head; pgoff_t index = 0; int level, i; @@ -2151,19 +2151,19 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree, level++) INIT_LIST_HEAD(&lists[level]); - pagevec_init(&pvec); + folio_batch_init(&fbatch); - while (pagevec_lookup_tag(&pvec, btcache, &index, - PAGECACHE_TAG_DIRTY)) { - for (i = 0; i < pagevec_count(&pvec); i++) { - bh = head = page_buffers(pvec.pages[i]); + while (filemap_get_folios_tag(btcache, &index, (pgoff_t)-1, + PAGECACHE_TAG_DIRTY, &fbatch)) { + for (i = 0; i < folio_batch_count(&fbatch); i++) { + bh = head = folio_buffers(fbatch.folios[i]); do { if (buffer_dirty(bh)) nilfs_btree_add_dirty_buffer(btree, lists, bh); } while ((bh = bh->b_this_page) != head); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); }