From patchwork Mon Sep 12 18:22:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 12973927 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 079D2C6FA8D for ; Mon, 12 Sep 2022 18:26:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F10C8D0007; Mon, 12 Sep 2022 14:26:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B4D96B0093; Mon, 12 Sep 2022 14:26:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E473A6B0095; Mon, 12 Sep 2022 14:25:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D318C6B008C for ; Mon, 12 Sep 2022 14:25:59 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AEC3814094F for ; Mon, 12 Sep 2022 18:25:59 +0000 (UTC) X-FDA: 79904262438.22.EC6E573 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf29.hostedemail.com (Postfix) with ESMTP id 765541200CD for ; Mon, 12 Sep 2022 18:25:59 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso8990825pjd.4 for ; Mon, 12 Sep 2022 11:25:59 -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=lkGrgC7rGv3gNtROZri1LZJW+W1eletv7YqP1zeCUhw=; b=fCy8TLtpc+2sHdfZpYJzZ3/33zUyiKgotMXve7zJnxVipv/nh1oXHb8bS2ysugI/9v DPPmXTfFd2REo9KrIQqrSQArNmn2PIXW2Xf5/1Ut4j4N93Wdp+lwmDib+aOUEWzjjW2z ZE7UUCvkcyVxvhRcudTBKvbY7PZCczmbSlXfRTufHjK1lQKZiPD4cVbUJ3kgQLIdrvTd DEsLz2Pp7SVPdQ+qvHM0m7ftgUr0guyVgV77dhlT4Kf3Rdhp8jR2Z6CWYrkquI7PqWFw z1Xy/MN+eXfTN+XVOyRTS9mw9r9QLcv9wmvp2cqbpHgbAYtX/bPNPHQhK3HBKbjjHYbK mZ4A== 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=lkGrgC7rGv3gNtROZri1LZJW+W1eletv7YqP1zeCUhw=; b=E+/jZo4H+n36GnKk3UGKePLKsN85/Zh460N/PFx6AWvYh7eDON5PdTJU1aq1j7yhuR ELdDlf7KK9cfPjXnZDyPyNHdabdQlJrAZt4FQhvTtYhILC3x8pUHMF5TFq05hp5wnIGN tS2XBsRD6cFPDcQ5JhVgq/HRfWYDXDApomuZMnxIoW3/Dnj9wSCjzOJ+6X3jXa6UwYIw J5RBbNZf4hEKJ5/QGjJqZbIkNATaaYR7dt0lsIrgIyR7Bd7uJKnRB1G27HmSzAxYDQNv 3U4Vpociif0rmdIsRU57LUSHUQULooh0VknpeW1NCh4EeXkQx8sxmHWID6mY2ujkxrwi a+1w== X-Gm-Message-State: ACgBeo1+LiqfwyATSL73eXdbAFpqpYsn+urLu0qzwVVHCVuEt+mQc+HN +gmSvR6QpZtFAd/kdX8fWlL7/+8UxnnsjA== X-Google-Smtp-Source: AA6agR7ugObnvvF7oyQiEw4Z3c3fWFD4/N8jwEvlip2DlQU6J5KyEtNgXLRq2aVr22deGLsWpY1Yvg== X-Received: by 2002:a17:90b:1d8c:b0:202:abf5:4b21 with SMTP id pf12-20020a17090b1d8c00b00202abf54b21mr13212396pjb.162.1663007158527; Mon, 12 Sep 2022 11:25:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 11:25:58 -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)" , Ryusuke Konishi Subject: [PATCH v2 22/23] nilfs2: Convert nilfs_clear_dirty_pages() to use filemap_get_folios_tag() Date: Mon, 12 Sep 2022 11:22:23 -0700 Message-Id: <20220912182224.514561-23-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663007159; a=rsa-sha256; cv=none; b=aXJwg7bkmlo0JpvNOH+2EutO844oOqy87Y/hx/618OoAU+UICXyFNqqMJ+cBsOYnexcpo1 XnBLm8KDOFKXks1qM8Kn+AGhxTY5Ty3zLpRsAYu9PfUU41DeOFRgEdQTvKsOgvv1rLr4U/ CC0LHwYDQpDKhntchy4B9b0hmBD0pFA= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fCy8TLtp; spf=pass (imf29.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.46 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=1663007159; 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=lkGrgC7rGv3gNtROZri1LZJW+W1eletv7YqP1zeCUhw=; b=Zj6du39yvs/4FVW6cJBnWbuXtbaoqU3KENpzPR2jWWCCWvPTada4gYczKYn7hv9DYdmlA3 xrXhDZvJwEhzjPKxo60ZdVJN4GuG/cf8ynQbykSk6s+SQuZuOzWGv4tZ+K956E2s+khCNd 1+qi2AzNB4rqcZ6I7l1yGgUR6TKYun0= X-Stat-Signature: q3f5th45h93x4oo7si69hpfese9d8ecj X-Rspamd-Queue-Id: 765541200CD Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fCy8TLtp; spf=pass (imf29.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1663007159-330853 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 folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/page.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 5c96084e829f..b66f4e988016 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c @@ -358,22 +358,22 @@ void nilfs_copy_back_pages(struct address_space *dmap, */ void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent) { - struct pagevec pvec; + struct folio_batch fbatch; unsigned int i; pgoff_t index = 0; - pagevec_init(&pvec); + folio_batch_init(&fbatch); - while (pagevec_lookup_tag(&pvec, mapping, &index, - PAGECACHE_TAG_DIRTY)) { - for (i = 0; i < pagevec_count(&pvec); i++) { - struct page *page = pvec.pages[i]; + while (filemap_get_folios_tag(mapping, &index, (pgoff_t)-1, + PAGECACHE_TAG_DIRTY, &fbatch)) { + for (i = 0; i < folio_batch_count(&fbatch); i++) { + struct folio *folio = fbatch.folios[i]; - lock_page(page); - nilfs_clear_dirty_page(page, silent); - unlock_page(page); + folio_lock(folio); + nilfs_clear_dirty_page(&folio->page, silent); + folio_unlock(folio); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } }