Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1238534rwe; Thu, 1 Sep 2022 15:05:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4V1/89zt3m3mTRvUKjIBtL6+CPz6AlFv9Hob32fHChcCAjZGDKxXd7QxHSj8ALa4Qn4yzf X-Received: by 2002:a17:90a:9401:b0:1fa:af9c:20db with SMTP id r1-20020a17090a940100b001faaf9c20dbmr1346479pjo.190.1662069946601; Thu, 01 Sep 2022 15:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662069946; cv=none; d=google.com; s=arc-20160816; b=AMpk+FylOdsIhw1N9BFP6QhBmrRcAma9Hca/vojWsh+gi5ADINX4MNPVJtpIMnOWRS Dwz82olA8o7a4532LAspjbjqgfHwKcK4tHj1wumMpA7jgt0xVPot55ZwUakDogaas8hA AxW6IdSwBvWzn25AGYS+/Owm0FS3/S8kVsv0XlYJrCcqvFZSCT+ATibD5halBQ0JsPv1 ECZuiJozoYdHzq7Dx4wFM5rzBv0VebUKC86q+dgL7I6hcUzEoi8N1xgLGViJhMBk+Y1L HRp+VOcamfIfnH3ak11QXLhq7OlzMahPW45fpIyifCFsNt+0vxl8dEshHkBPfonNiNXG BDmA== 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=I3QciEP4mJX7JM2ray9Wq2x1rxYKyHsz8NamV9Ya2AE=; b=T+FsBYK1FYRttlah/uRrCxnM9zNQ6CYIWz6TZ6dG3BpKGShq6pIBwWuoJ1HNMehac6 7mDMxP6CJMOfwrEfhQlpFE5Ymzrt/Z4qLvTKMEJAkUpQN3M0eFGDb9eFbqMGWJxuvBN1 gGsP/w74zTUDiwoi1ivwLgK2R8WiTCuB7WhpccRncf8xsB+c1hbrGWwoyVv+33IG6Gog dqPFtY0MaKEmbQzE7d7J1XHRprYTbueeHlHoO6TG677NlOnmoHPw1XW9UnrPEUHSvKMC 3x4UXaSjnoO7U/A3IvGjpCkPcCI+2cQCbn7GKuXi5ofaUoSS2x0GuYuyq9kjCbmUs9ZD nDrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eq9I17+l; 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 b16-20020a056a000a9000b0053a9fee3b22si249826pfl.178.2022.09.01.15.05.32; Thu, 01 Sep 2022 15:05:46 -0700 (PDT) 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=eq9I17+l; 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 S234922AbiIAWEm (ORCPT + 99 others); Thu, 1 Sep 2022 18:04:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234634AbiIAWED (ORCPT ); Thu, 1 Sep 2022 18:04:03 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18C196FD6; Thu, 1 Sep 2022 15:02:51 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id y141so108196pfb.7; Thu, 01 Sep 2022 15:02:51 -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; bh=I3QciEP4mJX7JM2ray9Wq2x1rxYKyHsz8NamV9Ya2AE=; b=eq9I17+la1WvNV+5BSt65HZdmlI3kpaQwmc9FNX7sdwBtXf+g2lNUB5WUhRS8OFoVD rINVeqVAcVVisK1Opo9R2pevuXpfEbwA99OJ208ZKIIyjpD5HHd0N60mi8ebF98L49+q asukoj9VbepYW7IflAdN9BGVca3CKrE/EQ8+71vSNeXgMnFRtGy7jjgwK8jCYtV0IYZU 7BgD3GLe64vx+dyHCUQr+ilgXPRhjWK6drtfIHh2aksw6CcQGrC7yYbxPrBBJadHfHjd i7zp6HQd4BYuJ26dV9hFhE0t7Np6mtipz0Z2VydoTQb00rq1gRPs86DGfBHqJ9Mr6HuN cWyA== 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; bh=I3QciEP4mJX7JM2ray9Wq2x1rxYKyHsz8NamV9Ya2AE=; b=TJdJC5+T1xW9/WqqQejNXEuRQsrLBxqoY+ky3QbXVWHcmEOpnAxaGi0tyiXG4AdJ2K wPmMo4G2QyGzfDE275/k6XVuX9pWsJvYrOOcRAbXwBJiHs5RHt34h+QPprOumk7z1gLS QDhuRvTS/hrE7yzWUQ83MVQlWu0YHU01PQ2SgGbrzVXKarxLzNcZWP8SNtddF8+gpGt/ eMsDMWfPPhmqBv03OxTR89P0diMDzFW6DiwuRJqJlYo8oWRPdvCblzaagCgJHtBUgyPA FjTz8qoKG6RNSK71VbtB8uaDKPXQQD1Ecc/h+ouUfk9jMP6FhYka80Ufwulb7MHeL39w nvRA== X-Gm-Message-State: ACgBeo1FQNk42iBI7Pj453YHwIMLBfjThSnNxT3eSuK45k9slyRCqTXB J4piLwohA7m9bfgNNmD+EIj6VoJsNt+5DQ== X-Received: by 2002:a05:6a00:816:b0:52f:43f9:b644 with SMTP id m22-20020a056a00081600b0052f43f9b644mr33511592pfk.57.1662069770469; Thu, 01 Sep 2022 15:02:50 -0700 (PDT) Received: from vmfolio.. (c-73-189-111-8.hsd1.ca.comcast.net. [73.189.111.8]) by smtp.googlemail.com with ESMTPSA id fv4-20020a17090b0e8400b001fb350026f1sm128894pjb.4.2022.09.01.15.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 15:02:50 -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)" Subject: [PATCH 11/23] f2fs: Convert f2fs_fsync_node_pages() to use filemap_get_folios_tag() Date: Thu, 1 Sep 2022 15:01:26 -0700 Message-Id: <20220901220138.182896-12-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220901220138.182896-1-vishal.moola@gmail.com> References: <20220901220138.182896-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,T_SCC_BODY_TEXT_LINE 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. This is in preparation for the removal of find_get_pages_range_tag(). Does NOT support large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e06a0c478b39..a3c5eedfcf64 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1726,12 +1726,12 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, unsigned int *seq_id) { pgoff_t index; - struct pagevec pvec; + struct folio_batch fbatch; int ret = 0; struct page *last_page = NULL; bool marked = false; nid_t ino = inode->i_ino; - int nr_pages; + int nr_folios; int nwritten = 0; if (atomic) { @@ -1740,20 +1740,21 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, return PTR_ERR_OR_ZERO(last_page); } retry: - pagevec_init(&pvec); + folio_batch_init(&fbatch); index = 0; - while ((nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, - PAGECACHE_TAG_DIRTY))) { + while ((nr_folios = filemap_get_folios_tag(NODE_MAPPING(sbi), &index, + (pgoff_t)-1, PAGECACHE_TAG_DIRTY, + &fbatch))) { int i; - for (i = 0; i < nr_pages; i++) { - struct page *page = pvec.pages[i]; + for (i = 0; i < nr_folios; i++) { + struct page *page = &fbatch.folios[i]->page; bool submitted = false; if (unlikely(f2fs_cp_error(sbi))) { f2fs_put_page(last_page, 0); - pagevec_release(&pvec); + folio_batch_release(&fbatch); ret = -EIO; goto out; } @@ -1819,7 +1820,7 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, break; } } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); if (ret || marked) -- 2.36.1