From patchwork Mon Oct 17 20:24:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13009462 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 44162ECAAA7 for ; Mon, 17 Oct 2022 20:25:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC1EE6B0093; Mon, 17 Oct 2022 16:25:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D25716B0095; Mon, 17 Oct 2022 16:25:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A16EF6B0096; Mon, 17 Oct 2022 16:25:10 -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 931CD6B0093 for ; Mon, 17 Oct 2022 16:25:10 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 684ED1208DA for ; Mon, 17 Oct 2022 20:25:10 +0000 (UTC) X-FDA: 80031570780.17.7157637 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf18.hostedemail.com (Postfix) with ESMTP id EC1E91C0032 for ; Mon, 17 Oct 2022 20:25:09 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id e129so11441478pgc.9 for ; Mon, 17 Oct 2022 13:25:09 -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=EOnFNLr6WPd7tItI5uxkca8Truk0f560xSuLirSKI30=; b=Ebrl+fflonMxXmYbjzZ0W5FnuUgF1ENZ6beNYeaCYzgPsSFFFY2nuwfTKiz2FudAe/ 7ZKdf6z/O/+HYjYCpK8ChxO2CQY7gBGoDhDIU1UeMcG99x96VPKcLvY7daaxIL6HByus /5yfixBKbG6rVzNv4/ZTcQkFvGUMjjvk2/T8YJVcM+iPU6/Q8umaLAUYJtaxOxiT1yX5 slob1M+6u8lOpnGyvViPT+9/xv790R5/qWr3BkN0/2P0geRVbBZeT1bsX1UOhX0vCD6O vBYMGTV1jDQT8d5fBXvzef0tlyd90rL/RgBQhVdelCPIZRq4EycvfekOVwfGoK8elKWC hXqg== 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=EOnFNLr6WPd7tItI5uxkca8Truk0f560xSuLirSKI30=; b=ys+uY0YkLgsYEwUXdvJHxlzeo2N7P38i/wf8c3PzMludTpw6eGEo8MjanpIzQUbHk0 6nRP9tfx82mtJK949HVtv35VMX9D7YtRnm49ChzwbmynKmGmCqslNGcXMfIlzFA2ljkq ah/gQ9q+zP2gbL7WhqQ4ELFW6Vc0/O8BBXvIJIuU/JtcWEpbzHBy3rMKWsF/JSawuPhY 1Xlq0DXcqNIuvTIUbyrpgH10LizGXrz5hzeJZmJkvniGnze4HWMFDlsC8zXfS6y2wL8T 5GQJik0wOf7X3maP8WnqkzI4VdxMZZEUReR8RqXcohs1xhrR/c7FUcYxMuilFDY7w8o0 qD4w== X-Gm-Message-State: ACrzQf1/F3Ckncemum/+0TD0yUBimg76M22rcOScuQEMYfH8KNh9EZk6 GsZB1IFYHdfjscCXYS9OdX4= X-Google-Smtp-Source: AMsMyM4iyKgrXnehJ3N5g/lij9/dekJchm4sLReFYRq/SJGRVZDxiW6SK1PII0agzfMo68SeWUzaMA== X-Received: by 2002:a63:5b5c:0:b0:440:8531:d3f6 with SMTP id l28-20020a635b5c000000b004408531d3f6mr12503042pgm.114.1666038308965; Mon, 17 Oct 2022 13:25:08 -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.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 13:25:08 -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 v3 15/23] f2fs: Convert last_fsync_dnode() to use filemap_get_folios_tag() Date: Mon, 17 Oct 2022 13:24:43 -0700 Message-Id: <20221017202451.4951-16-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666038310; 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=EOnFNLr6WPd7tItI5uxkca8Truk0f560xSuLirSKI30=; b=ewsEowhq7oEbnRRum+5hn9bTlb+P0jFeXxYn8WdqHi4vSy5hrnwTPPOiTFybOTlMkGf8qx cv83t2Uma3vOcMWcYnpAwYtVbtw5Z+/riXWetaJSakxPo6FJ8FUdo8B0NNaspY+v2Iy6JC 2oesue1E0OReJuw/Vg2vxioLXD9dH8U= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ebrl+ffl; spf=pass (imf18.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.215.181 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=1666038310; a=rsa-sha256; cv=none; b=dfMWAxiWt4M1L4zHsJ+oQ1PjiFdljKHbanO12Wx9gFX4V88BTDVgg297Vck5PHE8+XV7DE 483Fmt+iYoV+JgD+KD1/WHfSkNe93P+viH6oeScwvymjas/Jmq8E2V+Mg028clz/P6VdEv mNkfN5h3tdJv/0vsG5UZDvLmPb1KMWA= Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ebrl+ffl; spf=pass (imf18.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.215.181 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: EC1E91C0032 X-Stat-Signature: wpyti74pk8tea83d4npt74z33j4s5hes X-Rspam-User: X-HE-Tag: 1666038309-783564 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: Convert to use a folio_batch instead of pagevec. This is in preparation for the removal of find_get_pages_range_tag(). 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 38f32b4d61dc..3e1764960a96 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1515,23 +1515,24 @@ static void flush_inline_data(struct f2fs_sb_info *sbi, nid_t ino) static struct page *last_fsync_dnode(struct f2fs_sb_info *sbi, nid_t ino) { pgoff_t index; - struct pagevec pvec; + struct folio_batch fbatch; struct page *last_page = NULL; - int nr_pages; + int nr_folios; - 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; if (unlikely(f2fs_cp_error(sbi))) { f2fs_put_page(last_page, 0); - pagevec_release(&pvec); + folio_batch_release(&fbatch); return ERR_PTR(-EIO); } @@ -1562,7 +1563,7 @@ static struct page *last_fsync_dnode(struct f2fs_sb_info *sbi, nid_t ino) last_page = page; unlock_page(page); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } return last_page;