From patchwork Wed Nov 2 16:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 14351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp6615wru; Wed, 2 Nov 2022 09:18:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7xSIjnODwcAIlxsv4KIywyuYvW8a3bpUxDh4fW/0M++4V2Rm2p1LoFfeLx0XNrjF0s8H+s X-Received: by 2002:a05:6402:a47:b0:462:a70e:31a6 with SMTP id bt7-20020a0564020a4700b00462a70e31a6mr25232014edb.233.1667405882215; Wed, 02 Nov 2022 09:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667405882; cv=none; d=google.com; s=arc-20160816; b=ZjKZv1GSBMbMnZEmODux3UtHdYK1LPQCEtcYC84lrYjs3uNI6I7p7SUgvUf18WELym mq5hA3Kj9kCyfXgoS5yyEaNzJtuhExx5ZvbL3+GpfRTY6JDF01wUVaHYcu1sMCt0ZUiQ u5q0oNNkZ3L/3N9d8Pb7ZH/bNyy8rkqMjgt2TsupF16J49xB+KGhSD8JrAZFzZPKkTyC 9voI6RLpJT6t2a0h45dBlTErYqudyo50/+xgFTyK0syiEKJEVXPlZccowhYzQqqIC2Er FZFwfrPCsgy2a7GE0trunWc2VX6hBHeGIh49zfgUTUDqzaeH3pWWiT38xoKBcYT6WDs7 8Brw== 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=KDRTYxfyvxtJ8nlExLPdZpgWJ/su4BLXKUXaNb8lkhE=; b=XKJcT/+CVZtlBdeJFM406Vkgz9tyx846mpAJxUhdj273q5THju+N2h4KEAYMTtxRjq WDNFneZVSoOy/YwEohtHcYGBZp8eNTp5NO0GgsFwWzEsI60CA7ZA5vfekIXnpcX16Gk0 QaJTV/JeMzIk/pHwJvkvrJpzrb3M9ILxWv3JaCQIzRHQE9ISFnpWJal2SOmryk4ySP/b W8ckHwjM9z7Nj1SZ3nME4+MF1fpwaoYFrNDvNITBriX0a/JYB9Ocod+vFCjVQDmC1FwO lmI0c/9LcGqy4KE52Eb7QFDWHCyEqoztzbKlIeirugHerxPIRg5o4ykMx6S6NXwfB8W2 2mCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LzbfvJ+o; 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 go44-20020a1709070dac00b00730a4246dd0si19236557ejc.593.2022.11.02.09.17.35; Wed, 02 Nov 2022 09:18:02 -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=LzbfvJ+o; 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 S231919AbiKBQNi (ORCPT + 99 others); Wed, 2 Nov 2022 12:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231587AbiKBQMF (ORCPT ); Wed, 2 Nov 2022 12:12:05 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD222CDFC; Wed, 2 Nov 2022 09:11:36 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so2314597pjl.3; Wed, 02 Nov 2022 09:11:36 -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=KDRTYxfyvxtJ8nlExLPdZpgWJ/su4BLXKUXaNb8lkhE=; b=LzbfvJ+o7+PPEWAo4w8AKJBmrzmPbRkBu3ORC/K7IBEBc4H7+EY6jlr3kPMKdC+kLo AmeRyK5Dh8JnM5M6037m8XCwwaveHP3T1zWfXQL5PNN2l8Ar7mvAlRUfGrHxX9l4CAlx lo3QVGXXrSxrr9dWf3dkPnZsG+uP9YkyrIkUspxdhnyIO5H9xO3I2khrWtyjrsb3beRJ 4OTNnGP/tYO4gLRsXwP7dLPwn1T8Eyszj0QvmzUxq1RtDQ9iIk0vaxsCgNdXJmRDiqCT sM3lyaFW63RiGf2IUhiE4Hi5Q9YJbodgMXUOnMDzbZK/PBDDWhOYiUrWWg5ys/RBXgc/ FTLQ== 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=KDRTYxfyvxtJ8nlExLPdZpgWJ/su4BLXKUXaNb8lkhE=; b=W2+Z41ZtdW8kROKbKYrIwMkBJx+Dyr8rM5jodneFYxJdLa5gEJFg/i8+OBX1XWoQQW howLvnl8d0uCFy2aqQ25mtJ6905RQfll8tdQBU1iEMLlGl5+BymWsVZcAybqGvgFuT90 QgkqyfQh2B7KVU8JhhbDDNHS1iATYXfz+oZlVsdprwZLu1EDNiCBamiHJIcDE7Mgcv5H 9TWDGG0L05/lUH14a+0I5DPH6PLWWVM7klVy+DvmihfzSw1iqjE8SCsAXYuA0T8NigSW 6eRewBKtvWaq4rb1INvwT2OPcR4Jxy7MaebDdVRV6zxlQqTh+kUConKuGW2UrChAXXGm lKWg== X-Gm-Message-State: ACrzQf3V3SRmir4XxPJXpodxiJnwmUYR9otpxVjThACxKjhMWrixqAjC RX52Tu5OPyBgFQNMJDxR2ksP2ntxKfru5w== X-Received: by 2002:a17:902:e5cb:b0:187:2d8c:a4fa with SMTP id u11-20020a170902e5cb00b001872d8ca4famr12910612plf.151.1667405495543; Wed, 02 Nov 2022 09:11:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 09:11:35 -0700 (PDT) From: "Vishal Moola (Oracle)" 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)" , Ryusuke Konishi Subject: [PATCH v4 19/23] nilfs2: Convert nilfs_lookup_dirty_node_buffers() to use filemap_get_folios_tag() Date: Wed, 2 Nov 2022 09:10:27 -0700 Message-Id: <20221102161031.5820-20-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 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748401790497375198?= X-GMAIL-MSGID: =?utf-8?q?1748401790497375198?= 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) Acked-by: Ryusuke Konishi --- fs/nilfs2/segment.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 2183e1698f8e..fe984def1b1c 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -737,20 +737,19 @@ static void nilfs_lookup_dirty_node_buffers(struct inode *inode, { struct nilfs_inode_info *ii = NILFS_I(inode); struct inode *btnc_inode = ii->i_assoc_inode; - struct pagevec pvec; + struct folio_batch fbatch; struct buffer_head *bh, *head; unsigned int i; pgoff_t index = 0; if (!btnc_inode) return; + folio_batch_init(&fbatch); - pagevec_init(&pvec); - - while (pagevec_lookup_tag(&pvec, btnc_inode->i_mapping, &index, - PAGECACHE_TAG_DIRTY)) { - for (i = 0; i < pagevec_count(&pvec); i++) { - bh = head = page_buffers(pvec.pages[i]); + while (filemap_get_folios_tag(btnc_inode->i_mapping, &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) && !buffer_async_write(bh)) { @@ -761,7 +760,7 @@ static void nilfs_lookup_dirty_node_buffers(struct inode *inode, bh = bh->b_this_page; } while (bh != head); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } }