From patchwork Wed Jan 4 21:14:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13088960 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 C16C5C53210 for ; Wed, 4 Jan 2023 21:15:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7994E8E000E; Wed, 4 Jan 2023 16:15:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 749638E0001; Wed, 4 Jan 2023 16:15:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54E278E000E; Wed, 4 Jan 2023 16:15:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4676A8E0001 for ; Wed, 4 Jan 2023 16:15:14 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 28C13A01E8 for ; Wed, 4 Jan 2023 21:15:14 +0000 (UTC) X-FDA: 80318372148.09.83DFBC4 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf07.hostedemail.com (Postfix) with ESMTP id 797CF40019 for ; Wed, 4 Jan 2023 21:15:12 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HbtlZrra; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672866912; 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=yH5uknizJ+VZ3ByJbVZj3rNFJAjGpaD6mNiQZQbwTDM=; b=1BbfqXpzr7AhsjpcwZuPTYk4Qcv2IKvuAzC3xyjpymkDR+C0afoyXg0ettc36Jv0Bm4T0r 4tPUIX49USmyjb96BtPp/fs6XOdE6HGziOwQ3i/irQGXZUkKLILV8gfwfhfuZxNcMJhkzB uj+j5hkjYhbZ/aYwP1Mat+n84Ip5O3Y= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HbtlZrra; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.179 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=1672866912; a=rsa-sha256; cv=none; b=Tk+pq1P9E+U0ANKsWlWVNyVbLNWDcYGCKt+IaKg1V+VNiLzJy/rK4t+r5f7Ua/RULPcgL9 t/SpeAS7TelHx/alRMAk5Lpp5sp5ryDmrzwh35jrzVnol2iCcHDQY7GtC+8eYwNJob29JX 9e9Z6lU9xjB5lrHFofn0z2y5BM4vER0= Received: by mail-pl1-f179.google.com with SMTP id b2so37199584pld.7 for ; Wed, 04 Jan 2023 13:15:12 -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=yH5uknizJ+VZ3ByJbVZj3rNFJAjGpaD6mNiQZQbwTDM=; b=HbtlZrradnwPMjbOnk5CSSrEWLtsrycMj6Tm30jqV76XWo9P/G6G9QfGZXA3hEuuO0 yNLMx+3+R2fxnnyrSrsdtAH0YAmNGiTL388KwyzROfoONWg1jTa9Ux254/uWey0xofFS ZcN1YVGa74THrAOxSXWb1EhxG2YA/LskeaMec+FBsOyEUefqmBI414yyRv7F6qtfnFnG AKTzOXJ+X4W+hyL+EGENc2vkpZu+8+kQREVxb3SQSXSnUiBROYLOIlwHYGmrLdygYais EBeKayC0rdoQzyAgQz2uWHzmW86g0Hrl3uDZm7ONl8JUgVLCxAkjfMiNh3ua3ACkBAqv sniA== 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=yH5uknizJ+VZ3ByJbVZj3rNFJAjGpaD6mNiQZQbwTDM=; b=eCJpHSx7wWUxhML2w6OG3lWMQxWwIK9u5OlxDACgWtHnISlqOoJ3Rx7vMdDzP5W1UP NKDD4Wd4qNN4FwBovfh8IiyW3ye1IKNRWIBLD9Fy079udhouTwtxhHKbRhT20ZadEQNa sYTlsTdKGB/PtBW+BZfLpewNlXZSFTWudOxh6/I0fR6f//7nSUmsFWtxp8Wf/KVFQPr7 TdooBd8jIeqqS54I7z8AUdk799ek96K7jwzmvjkkCpfjdPN6dD7BtdXmZdp8XdiqHTGB UAbbSm6CAbx4h83yaMb+B77Y7sZ2+Me1r50aanlstBSJTuNvGgMe6v/k679u4xfPC4f0 60IA== X-Gm-Message-State: AFqh2kqVEZ7L83rxZmL7hJN4+hVtuxUxSAoBre+sH6S3LNfWU9qwqkz5 RPgBciSJRgX1tjQDeNc62yY= X-Google-Smtp-Source: AMrXdXtVQz3vUnk6SvLBb/uxtWWFs3KjCzby6fY2kylk/nf26hkuu2Sk6nOiS0bo0LRTvW+QMbKhXA== X-Received: by 2002:a17:90b:520e:b0:226:ba10:14e9 with SMTP id sg14-20020a17090b520e00b00226ba1014e9mr2765079pjb.12.1672866911945; Wed, 04 Jan 2023 13:15:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:15:11 -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)" , Chao Yu Subject: [PATCH v5 11/23] f2fs: Convert f2fs_fsync_node_pages() to use filemap_get_folios_tag() Date: Wed, 4 Jan 2023 13:14:36 -0800 Message-Id: <20230104211448.4804-12-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 X-Stat-Signature: dsa6iq78mze8f3z7sus5s8z4dywdccgs X-Rspam-User: X-Rspamd-Queue-Id: 797CF40019 X-Rspamd-Server: rspam06 X-HE-Tag: 1672866912-525749 X-HE-Meta: U2FsdGVkX1/TPSfsXo9lHecWK0wzUgaDkWlCGUhTU1p7txvAtxCsUmBzOIewVQqitzOrFnSJdggTgRhKzpObEJ0NY1GrjizCge0sDcvLRthcd68983Gp2wlSRvXQE3mTA/eirDY9V+DfBgCXsQYMiARPNgqoBjN2YlzpU34OyI/BP/81ilvvro426OhIYr8reI7I3RMkxDKQU86ykHwRQ2D9FWnDMBmxrgIbpkoFfFAHexqf4AqhRWoqTiGDr1Y5NmeqOdz/3KwSrN1sLcZEA3wUnJuhJmSPWN60i1YhN+0fOrtgGmqFi/MPurI/HrXXfoTeV7NnwvOUgjeVv+7CJRo5UYpxOOpDPVv4/kfFa6j7kxBvtRKc2kzA/yEH5Y33QuUWwfMd44VFzKLYHVDG0sC19GvricaRVnhKgLLpd3JCwTiVMlJSIGPSH4q3h2NQumBKVX+6EFLHUoiLqMk9+CF27bJWo0vnAlFypuw/iieIPJLnWLMHuOew4RfN+vGp4eS3ZxVE/Fge6sNfNjskp//WXcfLup9kyRIM2c6+2T5cxvuuAoiHmpU8BxxTjKMtQu1qMGTeRmdR15pu7lXprPTe8qzP5n+m0oxJUJE3gsSrwtzZ9V2Xmp9oavfdYkEbVCuU6ZInFwZPkDDCcf4QoR2ZPk1IGV40Ky8rJ6OlZHJp2at+50sbfzY7FuLGjPwrFFq0AOiBydANRszW+2m98ypsDpDCbXR5Tb30Mfr+2Vvm6GUwe6peImc9omlvL/Ah6KcB5HUht8Ziq2EAq3ekdMLFJ0Q9u/g2yziK1bemgKQIlzXFQzlp86e63eymmCkUwtSaid0HTyFV5/YgEQ6CmwQPZRIp1srR4z9qHXEpyYMvKTW03koFR8Qnx5q6RQuZC7BCdIB6DPwUms/iw7hp9VviX1gowIHcvRD0yesFWTOK0P9NjIq430deBviTpYfyauN8xX6hHliuoStdVAY VSJLPGcd TQ4ZTdzL3Vov2nhjM5VrVK3ED469ouVipqp4ic0EdYPUL89sX1R92oECwTqDBTydq9FWGAYBxWPThHFH/4Rxvjk7EFNr5ZZI3n6f0RGMEKixJRVRmkeOB7xUOLY5KngcF2OHWU9Ix2wvU/rv9vXH+B+5vBrnek3F7F5fsdy1KOXTgW/yxrYyCJKmcTjW1a39mUgOmInwLGvYpyjPf1iVlX1/eYDgDSKZE8S9+itM8z7Dfjx+BytdGtILN+ejfQMY++HLi2S02dl34lbs7sZ9CxtFMtv+8lGuU4xV5 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 function 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) Acked-by: Chao Yu --- 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 dde4c0458704..3e0362794e27 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1731,12 +1731,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) { @@ -1745,20 +1745,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; } @@ -1824,7 +1825,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)