From patchwork Mon Sep 12 18:22:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 12973911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC3AFC6FA82 for ; Mon, 12 Sep 2022 18:25:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD80D6B007E; Mon, 12 Sep 2022 14:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B39616B0080; Mon, 12 Sep 2022 14:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F16A8D0001; Mon, 12 Sep 2022 14:25:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7AA1C6B007E for ; Mon, 12 Sep 2022 14:25:32 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 543A1160DAA for ; Mon, 12 Sep 2022 18:25:32 +0000 (UTC) X-FDA: 79904261304.28.8AC60C7 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf12.hostedemail.com (Postfix) with ESMTP id 1833E400B2 for ; Mon, 12 Sep 2022 18:25:31 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id z9-20020a17090a468900b001ffff693b27so9003645pjf.2 for ; Mon, 12 Sep 2022 11:25:31 -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=XBE5EAyurHlAAqUYTZRlJbn5nu+dgNY9++qJZC9HEP4=; b=ITM5iBctmKc+MCt2XrAt1/9sycCT8ZGtclTNNKSvX7cl27aimROEhwq8Yzjz9XtpFt F2M3x8FASHt0eghDrVD90g/LIDZl93/2UFcDto6MVoedm54lNnyvI6kXC5h0smVTph3X dkL4YrtLbtJIMDobW3mrXpv5RNC6a98F1m8Tv57EiXsmQY+gCrYPHWc6nFr9o7H2vsPz OJ4DI7g9bIkI2oG7scKkzWSsxJSsLP0a6JWX4LP8CLLcvHCi4kyX7omubZIXnYjxJrU+ ndMeoUF7cNaG6gZOtcYhi1+dl/xzHLRjSSAjpOSJNWBqxTK1RhhwLMylxwORW+ARK7Fg HVeg== 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=XBE5EAyurHlAAqUYTZRlJbn5nu+dgNY9++qJZC9HEP4=; b=WMagJvetK8awwVfEkJlYF+6PCW6UiToGzRZBzPuf2znQfnq0uhL18alOOsUJ84JAzk qn4lNeq+AD7o6O2LqiFMQZRcvm35TMUgyLl8vf06tuYksUMqqNEhzPWg9Lp1zOv4TwqZ pT06+uFxJWwBoMm3skZbmLfpVog/KBi/wNgTShFnGP2X+3a6M4v1chGL/DMx1oB2uP7D QMS4HN/fW9IDF7JHm9gNCbXil0f3E15KekFcfo16YTmdVGd721mP/zeIn8fNh6W0L+zy iiJiIwDfZWMiJeqBcvUt1734N1eBZ4sORA5hEV3SYs6MZSWtN8ZLP2Z2d4eRYaXTmShs IRXA== X-Gm-Message-State: ACgBeo2g9DqkrdbbjfgE2JicMQ3zDPCL3Jldwl+On6m7yYS3ZOz3s7p4 rqWFEsQ58qhA51Ufv4OMBTgTPECIHjtqpg== X-Google-Smtp-Source: AA6agR5X97vcfNFGGVg/nuGpWsvVdpfUDmyvHgihCl2mmP8A/id5SOD27XkWcIF/Iv88lkmHeMJK7w== X-Received: by 2002:a17:90a:a097:b0:1fb:5bc:7778 with SMTP id r23-20020a17090aa09700b001fb05bc7778mr25392630pjp.209.1663007131161; Mon, 12 Sep 2022 11:25:31 -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 x127-20020a626385000000b0053b2681b0e0sm5916894pfb.39.2022.09.12.11.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 11:25:30 -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 v2 06/23] btrfs: Convert btree_write_cache_pages() to use filemap_get_folio_tag() Date: Mon, 12 Sep 2022 11:22:07 -0700 Message-Id: <20220912182224.514561-7-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220912182224.514561-1-vishal.moola@gmail.com> References: <20220912182224.514561-1-vishal.moola@gmail.com> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ITM5iBct; spf=pass (imf12.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663007132; a=rsa-sha256; cv=none; b=2S/9awAuOzkAoRkQ4rewP+Q0FaEU+WNz2vilBmr5v3t/IvqoduIyqDKUNCEnkCIFM2UxBE t+8P2fkLJlHpSJDQYutYU1hh6I6wwkRQbQ0IxWSXWX1ulgr2bFFq+BISMGASoZd5vC1j7M q3NhzRhHLtLgnBQU3imuXgYBo/KsuhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663007132; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XBE5EAyurHlAAqUYTZRlJbn5nu+dgNY9++qJZC9HEP4=; b=tJ7Ti6jBNVaZg1AIO+vrazFLgLCN1tYq/u6AhMZQvvFx8cRQx7P8uS3/8PKAZmCxvS1r0Q dKvsz3IBA2iVkr/C4xkYaLbYRtnVu5xEo3ku71E+idhFmXxgUdukt4wYN+abRIRLQXvPPx WNSdvoqXA/M1HMCZJrczmkPXKeNo1jo= Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ITM5iBct; spf=pass (imf12.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam12 X-Stat-Signature: gfd1ss1orbd3weubn8yjmkpa863whxxa X-Rspamd-Queue-Id: 1833E400B2 X-Rspam-User: X-HE-Tag: 1663007131-337813 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 cf4f19e80e2f..d1fa072bfdd0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4844,14 +4844,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; @@ -4874,14 +4874,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) { @@ -4896,7 +4897,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) {