From patchwork Mon Oct 17 20:24:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 3714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1629821wrs; Mon, 17 Oct 2022 13:30:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JWgtdyNscUdnMKjhTVyR9AdRdK0vKFV/A92QkzsupfOVnTurQpe5o3VSlbb4ikODY+dPO X-Received: by 2002:a17:907:970b:b0:78d:8d70:e4e8 with SMTP id jg11-20020a170907970b00b0078d8d70e4e8mr9778325ejc.614.1666038622862; Mon, 17 Oct 2022 13:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666038622; cv=none; d=google.com; s=arc-20160816; b=T2Q3xgp5yW/j7jLYk2IbkPtF7Du+We6ALKwGsGFrI7W5E/XfBWWc2fs0h+eXZuWrDt 4cW5KIOXUQOq1JcPWZe7vbr1lIFQAG5dTj2hVESq1Cw2Xw2weFKKwlZMuoMuXlMk1/Y3 kRbGKJz+P3oHrcapngiBZIgrt1LJXzbFkRQXUj4FILeWJcAMzPGsZp/9stbK+zPgO0fA bs5MbMihVSWSBd5n95KnHiNwJwNgKlLyWU9Y4TQC182zr68K1mkpvN8nBOqKjiAxwUDF Znqj9jd8MVD9dAPV1vMwEJNoC4D/XT3v+Sx3Wdl7AiULNuspGPAsp/4nevglWMY4JBfV ZThQ== 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=OszXCtyBAOhtTfNS2VcED/PJCoIEbwhBnrXkCjtJV6A=; b=whKNGm/8LmwcBPhoUVSOIO09T2U7bzkv+31rhstQdd6J+i3+GuBEMKiULM4Uv0kIuU UjXBU62kwICqWpuio+H0hSHF+boJl9Av6U+DS2Bxatl+TRKWKPd37HJCYN5YPuUUCmpU PoME+Zc0o+6sASIZv+znPHn6cmIP4yI09hoACQg02guflux6aPhLqzIKkKwW7+G6nMVa w7cgP45cuSaZSWB5ivC8SkSPhsjBmWz1Z1J+UXbarDAC+25c4CRThLYdq2h4c87+dxvQ BJFUQ5BhOmc7NqX1HyiJrmHki0XgG5FfuVfUyJPmNiIlMTYzHJvKcr8HxGRTSp10/HLm 8pSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DlogKpHG; 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 cr12-20020a170906d54c00b0078e2bbd67b0si2674985ejc.36.2022.10.17.13.29.58; Mon, 17 Oct 2022 13:30:22 -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=DlogKpHG; 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 S231751AbiJQU2r (ORCPT + 99 others); Mon, 17 Oct 2022 16:28:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbiJQU0y (ORCPT ); Mon, 17 Oct 2022 16:26:54 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED4137E30C; Mon, 17 Oct 2022 13:25:30 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id f23so11819492plr.6; Mon, 17 Oct 2022 13:25:30 -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=OszXCtyBAOhtTfNS2VcED/PJCoIEbwhBnrXkCjtJV6A=; b=DlogKpHGuzxO+jQRFtRTRFNBhcjjfosVdGfz4vShoT5jbOvLmiulTdcKtHEFGwz5vi lfN8CyIsdDsnzLwlPsrwSNu7A69s5Fy0qqRQj2nA9AGm0yWGFBOpq6+hyWMx+nCdiEOf HOWv03XJMaxBzb3v/k5D8Tkgw8Rsjf1L9diV61pFglGBB5j0nFSq0gT1h245hSzueZGw Np3EM/UvXHrfuYbzgwORQStqJotyQYc3vhFcPkD+Oz9PUmc3lvU5n0m6WUynYqD8tTw7 UZB5z88hHxb4eP2oFj6wehPTurmZRyd9zSlH8SoJqpqYDPStY4oaZoe1q3QYLoKSuu0H QHYg== 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=OszXCtyBAOhtTfNS2VcED/PJCoIEbwhBnrXkCjtJV6A=; b=VQYDcRtPoQlwc06AWMRvrJlhxwAErbozmEZalHh/B5hlgN4A1QKvLZBslvmc4e2I6V asZLH2ywkGCXzXHIAqF6Ofbc/hVKlgNt5NWK1Ch0ZzbAyD0mKM8r5qrL82NtOawVMOu1 EhwlYLSHG+dj3kqSDFm1S3SERz4QL+XhlJXpwpCrgiwqnaijFJPc3ZxqiwMsCrJ2Q/ub nNXc/lbmNkPnF57d0CZeWrDkqcWPauYYiBGwKEQKUjn9jVDICawTjb1oaglUEzMILBjg +IiMDv3vJ4XWekNldQc+0r5FW727Fq2J/OJ8bkEakyMQMcj8bMgmj0dZN1Pv+XU9KMQZ JXIw== X-Gm-Message-State: ACrzQf1+YjuStaAR144kOolSf5Ub3rgSSsHGUq/x8nRM/yN7Firtsi/J /SNG/TWwIJFmsm9BREKsGu8Spx7eHFGmLw== X-Received: by 2002:a17:90b:3847:b0:20d:c41f:de7a with SMTP id nl7-20020a17090b384700b0020dc41fde7amr18478400pjb.85.1666038300344; Mon, 17 Oct 2022 13:25:00 -0700 (PDT) Received: from vmfolio.. (c-76-102-73-225.hsd1.ca.comcast.net. [76.102.73.225]) by smtp.googlemail.com with ESMTPSA id pj12-20020a17090b4f4c00b00200b12f2bf5sm145037pjb.1.2022.10.17.13.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 13:25:00 -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)" , David Sterba Subject: [PATCH v3 06/23] btrfs: Convert btree_write_cache_pages() to use filemap_get_folio_tag() Date: Mon, 17 Oct 2022 13:24:34 -0700 Message-Id: <20221017202451.4951-7-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221017202451.4951-1-vishal.moola@gmail.com> References: <20221017202451.4951-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?1746968115313992107?= X-GMAIL-MSGID: =?utf-8?q?1746968115313992107?= Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba --- fs/btrfs/extent_io.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4dcf22e051ff..9ae75db4d55e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2960,14 +2960,14 @@ int btree_write_cache_pages(struct address_space *mapping, int ret = 0; int done = 0; int nr_to_write_done = 0; - struct pagevec pvec; - int nr_pages; + struct folio_batch fbatch; + unsigned int nr_folios; pgoff_t index; pgoff_t end; /* Inclusive */ int scanned = 0; xa_mark_t tag; - pagevec_init(&pvec); + folio_batch_init(&fbatch); if (wbc->range_cyclic) { index = mapping->writeback_index; /* Start from prev offset */ end = -1; @@ -2990,14 +2990,15 @@ int btree_write_cache_pages(struct address_space *mapping, if (wbc->sync_mode == WB_SYNC_ALL) tag_pages_for_writeback(mapping, index, end); while (!done && !nr_to_write_done && (index <= end) && - (nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, - tag))) { + (nr_folios = filemap_get_folios_tag(mapping, &index, end, + tag, &fbatch))) { unsigned i; - for (i = 0; i < nr_pages; i++) { - struct page *page = pvec.pages[i]; + for (i = 0; i < nr_folios; i++) { + struct folio *folio = fbatch.folios[i]; - ret = submit_eb_page(page, wbc, &epd, &eb_context); + ret = submit_eb_page(&folio->page, wbc, &epd, + &eb_context); if (ret == 0) continue; if (ret < 0) { @@ -3012,7 +3013,7 @@ int btree_write_cache_pages(struct address_space *mapping, */ nr_to_write_done = wbc->nr_to_write <= 0; } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } if (!scanned && !done) {