Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5604969rwn; Mon, 12 Sep 2022 11:32:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ETysSKL2//uQMmikDX9JMbbgXul1R0X/plubL7tRusItM++orXWP2kgB8fLHDJRl1sv2E X-Received: by 2002:a17:907:a4a:b0:77b:c1b2:479a with SMTP id be10-20020a1709070a4a00b0077bc1b2479amr7601934ejc.109.1663007542984; Mon, 12 Sep 2022 11:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663007542; cv=none; d=google.com; s=arc-20160816; b=Zw2Es2GC91pXZMcjRgeFdG5mvos7QboWlA0r7mX3AxE31DFO30TIq12wrKthoJkAg0 boeXmz1QITeVPKzuuK4M+ucKy3HOAqWTY7GnK0AwTGmz17wC3dHtv0Mjs6Arn61Gg/o6 vAo1JinQyFK2ZiP6Gu39wy2W+wsVNyvaKZqdYZoTZAKq3/SlvwCfZNxWXGcysSZYv417 B/FqyrNCxmtzUVbpWv18CtTaveCy4Bsg5n4w/P0I1YfrZlUu4/WrWdRTjsdaXSbxI7Or kAmWdHD5lD1dLU9UA4FH9D/ttpd7J2SxNCA7IY7JqBmQFPPkvlZA4aI3AEZG6j8Mhh2p dIjQ== 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=lkGrgC7rGv3gNtROZri1LZJW+W1eletv7YqP1zeCUhw=; b=z7kLsamjLxstlEhI4tzboxOtx1/fKlAMxvJIykk/VQk7Bn+NAre2t6GbAI8nYCKkGx jJVne8YCnAdQ3s/ng/2eQ9wSyentLE1rXVPtGj+0RqO3O75mV95g8zuPcnPLOAb06/hU f2tuaYBqWOwoZyWUnmnHOzeSs4+xYEyx+2q7gYwYT1D5Pxcym3w1SDuBaD4D+eBQ2o7Q zOPiQ9isXIPLBy6+MW4FDaqzXGCH0alp4i1wl5BdO6XhD0gX7dQ3ugw/jnwp83wi7KBL oexG9zgBxA6Cz0BD7JAMaEcAZUHoCZurRk67sbrlCqT0M6MHJJy6X3Nb0+Nbv1ysW+mK XXqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fCy8TLtp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a170906851000b00773dd14c80asi6057107ejx.860.2022.09.12.11.31.55; Mon, 12 Sep 2022 11:32: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=fCy8TLtp; 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 S230518AbiILS3a (ORCPT + 99 others); Mon, 12 Sep 2022 14:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbiILS2c (ORCPT ); Mon, 12 Sep 2022 14:28:32 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B8791AF01; Mon, 12 Sep 2022 11:26:11 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d12so9376264plr.6; Mon, 12 Sep 2022 11:26:10 -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=bDk0euRFurrgogLmyvfiMiVJXJZMGPiV70fUXljn6o/6tFieCjph5fyFY46iGUrhr/ V24uDwBSAbfGUII8y4RC0kEEwV/4A1fBlYsX10WO5LOpAHNlj9P6c+E9FsiZ3vKpqT0D +nYiRrhdQrzrUNV4tPn080DmzGLz2FQlbFzwebbMECU1dpfxlnfvXm4tNk/kW/C/I3V6 6DsVva3O/3K7Y5+RJLeKtq2JjM9YdS+xTlbJcE6nt7f6qDZw2Vb8Rh2Gg54T7QcbKylZ iSnfOHpyb33QgikvOnrYm03IyRVSeqGmq2MHQvHT7LhjCtO8+mTUIjq5SAQPQMrGNvnG uC7A== X-Gm-Message-State: ACgBeo0g0MzG5JLNUvjpdqpsis/Fd3o0gPdPWW92vlm2YQFKpnEVN+ZQ AVrGfI1quP0BIV0fGNmBmUPGNgFzJabOVA== 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 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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 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(); } } -- 2.36.1