Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13799426rwl; Wed, 4 Jan 2023 13:17:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfxVSoUQnYW/LFQghbkR+c7G0FqI6SPx+91M3b/gdnneoAFFt2AboDH7q8XYQxEZPqRWQY X-Received: by 2002:a17:903:200b:b0:192:467e:7379 with SMTP id s11-20020a170903200b00b00192467e7379mr43508526pla.49.1672867070263; Wed, 04 Jan 2023 13:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672867070; cv=none; d=google.com; s=arc-20160816; b=oasEZwFGQbxIQuGqAxy4XnQ3mFTeKp+xJ4ELf5727kr0Wjmwc1tD539vl1dkAAeyGF u9WRxLOYx0YPpBcF8CbqKa3tNaBgP5uicHjXd/JHizPCKhcS6iDWuitkeeknQ3QBUFcl hhGEtSarezTh2CR1ALWYZBz0TJhXs7BhMW8v8ncBuqgDSX1xHPrN+tXvWkKGfN2MFusX iVqknu9QKF/7waNZy0uLEJOlK7QnGFaIFsVyKcFJE3vGjb02T8wiPjEcMWielPioSq6h wBtcAcuzBOK0xPjaAb+BlgGbsZnCrtpav0YLmoOFiQRDqwW3/0hvUJE2RsSkmA/mFz28 rLhA== 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=wLGgwLr/csaNeBIMYfbH9zx9j3AdiWGm09ROWOa5iAY=; b=R1wC1JKPQWBtUNbta2XTsUnttyXC3m9SOUzZ42lEr/C/iFQ2yWrYW6joNhek4P2tvL vEF2bQMF58M9CMHEBJbuvgH3fc61/49sqfOh/piMz68N72ax7sCN4IgFZFMx63dqS45Q nM96n3CSeYRdIKlWSg6cCYMIHGmdQMX5GrxwfbO1FhcGJlB3HxAAfgH9zB5fO04CjSla LEbZIOTFitlHGuubu2C19Pukf1tl3O2wYZqlnRfeSDYUz5FD02oGz2QvJou7JsifpAeL Xl1dcV8PE4y4SHbn8SzhoxPr7aCWHB6Ep8GCcPK1GCNBAvzKNCOtG09dPD8THFv/rRZF THzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JiIf52J1; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a1709029b8e00b001929550b3e4si19545759plp.466.2023.01.04.13.17.34; Wed, 04 Jan 2023 13:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=JiIf52J1; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S240626AbjADVQH (ORCPT + 99 others); Wed, 4 Jan 2023 16:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240357AbjADVPY (ORCPT ); Wed, 4 Jan 2023 16:15:24 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FABF1CFF4; Wed, 4 Jan 2023 13:15:24 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id n4so37232333plp.1; Wed, 04 Jan 2023 13:15:24 -0800 (PST) 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=wLGgwLr/csaNeBIMYfbH9zx9j3AdiWGm09ROWOa5iAY=; b=JiIf52J13fF3RZdd/gu8czce51QuNDKyRmp/RhQBZpiZeU3XEs1WalfwDAIkQP3i1h 7oaEZjWzR8v45uiToP37QSjLBQ6hFoKkzsu//TvxJBpZZTHSu/Ti+0DB14c/uViJpKft LemnBJAU1yNQKcrmO0+Bqi75NqwYHFoh6HrWlcKcA9N4lX0TdQaGXSiQJygzjTysgH/H Ppdlz/iLT+f5FltAthrg93ciA4z+S+CmoY6IExMFrN5abl65NskD8ykG3req494jeVOI SIJLZug6nx7VJLjV0ukQMkHOfmOMT4MrYPY4bGDi0laktjz8hyQhgyGhNDvAUwE+FMju 93bg== 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=wLGgwLr/csaNeBIMYfbH9zx9j3AdiWGm09ROWOa5iAY=; b=1cjUiRXnhvMAJDbZAri51xhDDNN2vSXcEpvRIZ17gpmgb7D4qxLTZLG1ixxERZi/ei wZlWXJnYrJKZYBSz9p/Zi/KEQPoaw0lHeHLUcIzMPtYkGrHWrUTHe0gL5KIxRmQBzZur GqcTUJecroyCdLGSSI/agW10VOxVtCVAsMElQmfvV8JQZVylKUK5Oje1ZDwX9W6SOtE+ GCLOg78a+d9VaEUYWS5WS4ZSu05MDxTVt7XdsA2ck+DEIprnjSTbI9j5Wv4xB79A2hdO 7dg931wMsIrrUVk5P/y4auZFPCmyhr7CDX8cQIYyhdmDI7oVqZYz/mvjWPgPBnfyzj2m SLmw== X-Gm-Message-State: AFqh2kqk5UQIqtB0v/hbu84d/6lKRLYSEBvepmUsigbBGdBmcYzX8aMh b58aBaTjNawm8CYvmKWMODGILh3hfeiWkg== X-Received: by 2002:a17:90b:794:b0:219:64ca:49a0 with SMTP id l20-20020a17090b079400b0021964ca49a0mr53526904pjz.22.1672866923492; Wed, 04 Jan 2023 13:15:23 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::a55d]) by smtp.googlemail.com with ESMTPSA id i8-20020a17090a138800b00226369149cesm6408pja.21.2023.01.04.13.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:15:23 -0800 (PST) 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 v5 19/23] nilfs2: Convert nilfs_lookup_dirty_node_buffers() to use filemap_get_folios_tag() Date: Wed, 4 Jan 2023 13:14:44 -0800 Message-Id: <20230104211448.4804-20-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104211448.4804-1-vishal.moola@gmail.com> References: <20230104211448.4804-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: X-Mailing-List: linux-ext4@vger.kernel.org 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 8866af742a49..da56a9221277 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(); } } -- 2.38.1