From patchwork Mon Sep 12 18:22:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 12973917 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 82C2CC6FA83 for ; Mon, 12 Sep 2022 18:25:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBE966B0087; Mon, 12 Sep 2022 14:25:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E47C06B0088; Mon, 12 Sep 2022 14:25:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C99D98D0001; Mon, 12 Sep 2022 14:25:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B9AFF6B0087 for ; Mon, 12 Sep 2022 14:25:42 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9605EAAF64 for ; Mon, 12 Sep 2022 18:25:42 +0000 (UTC) X-FDA: 79904261724.30.6A6A587 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf21.hostedemail.com (Postfix) with ESMTP id 5381D1C00A8 for ; Mon, 12 Sep 2022 18:25:42 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id u22so9360064plq.12 for ; Mon, 12 Sep 2022 11:25:42 -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=VVDEDDCx2d1u9kTxOO3+HYn0Qu0jVDr1kjF69+koZKM=; b=mWsacKaljX8MUV8CQf+x9uPNXb4nwg1rqOzW988jKdDxldx2xBwpPizg4HUE3CpOyS CZXKfwZl7d7TRsEdibF4COy3CHTtCs9fDbuwKy/fifVJ1Wgwc7dTVk3A2qlzYF1+YqrM 8u30URko72IeT67j4F37ylnRUZD/Skd/5ByQpr+0jX44vN/bWC2IRka7MCfENYbM9JYD 72jwWqsS26F/r5BLgNzt2vuVnEfeh6py/P+5GlgXdd1rz/SFRFcCTDhHk5S6n46zAnHH K7NUMpASIWQTy8dJGAcYZr2Qd5aoXAfuyQB26U7wlP0wc30bz0T/it+tBSb7KpRupXtm b44g== 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=VVDEDDCx2d1u9kTxOO3+HYn0Qu0jVDr1kjF69+koZKM=; b=ReA/pQ5xpeZ38Dr1OqcknQa/h+c43QBRwjoejnjF8gDpCqwJsrsph9kgN9pR4jOpli dmpeEw865WLhQubcrwQOslXjfRPd3Odw1cUa/PHOE3ClEGMmqzrUakmI6r0Xpm5nDs+d QSvbAzpG6y1kuPSiG0J6vYMGYt8+EGuNGYXH7SsYKabLPjGkBK+xnW79MaWOEdXScmS6 Sxx+/lOTvDDwXVXQ5YFSi/IuX/B2m4pvCy514T5/gYaSyUXEYNsYG/A5+g63IUNICki2 zZnzYUNBeAJfT1huWLBXras2O8tqtR0m7nFQhoxG493N08dUR8T4J7B/ERa/SkEeUtR/ U62g== X-Gm-Message-State: ACgBeo2ncZaxASasWOVo5QrkxM5enB49ngvVDj3aYDzoVIXQFs9YrZvI zzzqmBVSuERCq0mM67BlFng= X-Google-Smtp-Source: AA6agR7Qn6iVYbgKVLaA7RNhUe092kC4wO4XsubL7Ck/d+hPPUL2KMeZ8CoC2zBbBJEanU/9uLdUng== X-Received: by 2002:a17:902:f549:b0:177:f7ca:c870 with SMTP id h9-20020a170902f54900b00177f7cac870mr20847770plf.4.1663007141405; Mon, 12 Sep 2022 11:25:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 11:25:41 -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 v2 12/23] f2fs: Convert f2fs_flush_inline_data() to use filemap_get_folios_tag() Date: Mon, 12 Sep 2022 11:22:13 -0700 Message-Id: <20220912182224.514561-13-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; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mWsacKal; spf=pass (imf21.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=1663007142; a=rsa-sha256; cv=none; b=HxhvyE7j0B8nJ4+2clLch/JcEsXfyOv7go61h87bsNCIv+SAn88xdtB2c31vixfk6whpti wSs5UydQ9F1j4Gg0z/lfu/6k3hdGI+pQ74cMljYBYaTc4S9E9wSZCJjP5XbNE9073a0wxP K+KmcT75UxojwohVlAFL8kvOTnpTsOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663007142; 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=VVDEDDCx2d1u9kTxOO3+HYn0Qu0jVDr1kjF69+koZKM=; b=8dd+Gd6dJ3nIC0LBzSymEu5YKG+qtjmWwTani4TDfHm4B5dMKDsJ9syqIwo3xT1E5umZpV ZOm0UBx6vy5N+IviuNVpmXLToGMmAYjfUWqSuc/mDY52VBcWriRZQFlClenWctpALKBlHK 3rt2VpIPHTkDiTXfbMWv83ghe98xAVQ= Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mWsacKal; spf=pass (imf21.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 X-Rspamd-Queue-Id: 5381D1C00A8 X-Stat-Signature: k57ewsgffo861wfnjnx53ifpb9qqp4zg X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1663007142-651798 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. This is in preparation for the removal of find_get_pages_tag(). Does NOT support large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a3c5eedfcf64..c2b54c58392a 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1885,17 +1885,18 @@ static bool flush_dirty_inode(struct page *page) void f2fs_flush_inline_data(struct f2fs_sb_info *sbi) { pgoff_t index = 0; - struct pagevec pvec; - int nr_pages; + struct folio_batch fbatch; + int nr_folios; - pagevec_init(&pvec); + folio_batch_init(&fbatch); - 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 (!IS_DNODE(page)) continue; @@ -1922,7 +1923,7 @@ void f2fs_flush_inline_data(struct f2fs_sb_info *sbi) } unlock_page(page); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } }