Message ID | 20230104211448.4804-4-vishal.moola@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 58C0AC46467 for <linux-mm@archiver.kernel.org>; Wed, 4 Jan 2023 21:15:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DBFB38E0007; Wed, 4 Jan 2023 16:15:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D65058E0001; Wed, 4 Jan 2023 16:15:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B68C18E0007; Wed, 4 Jan 2023 16:15:02 -0500 (EST) 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 A94778E0001 for <linux-mm@kvack.org>; Wed, 4 Jan 2023 16:15:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7A8921A02B1 for <linux-mm@kvack.org>; Wed, 4 Jan 2023 21:15:02 +0000 (UTC) X-FDA: 80318371644.05.E611CD3 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf26.hostedemail.com (Postfix) with ESMTP id CDA87140017 for <linux-mm@kvack.org>; Wed, 4 Jan 2023 21:15:00 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B4tZImsN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672866900; 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=/ONYMO0PIN9dk55uWmFjeEGp9OM+yknAPJhSRMx3xaw=; b=YcXWL4KzdEaog3XtSu+y2hutKP0EcyO8UuICmGS+2X3dAWZO6MjRi3FRhEKFUeCn5RejJG 2EyAYpz6w7TlsLsMfs4pKJRewBXyDRp0CXActQTqgdSTUpkzkZ4CdzNFhRSheYZh8AdpTA aQLbqJJuUebEfNumOJNs21t/5TKX1C8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B4tZImsN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672866900; a=rsa-sha256; cv=none; b=6CM8mdIs+0TkcJzeQKS91bRw4tuf8asR2xd3M4OL9DliymK9Go9c8YW2DTgOrg6uJiOUea VNuzyqk3IAUOsm02W6YCx0vf7BuaVDcyJnuNQSOarUjhuLg4M9ILRa+qyjePpFRQrtjSj/ YvArbnOFyD++blOMFBq6FTASIV/TENo= Received: by mail-pl1-f177.google.com with SMTP id p24so14703956plw.11 for <linux-mm@kvack.org>; Wed, 04 Jan 2023 13:15:00 -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=/ONYMO0PIN9dk55uWmFjeEGp9OM+yknAPJhSRMx3xaw=; b=B4tZImsNKLYbwaEqQjZ6y+RmfYlF9uPZ5GCZplXcCJF3iTUDgroyLgSP3mqYOoL8tg YUfyLoz3u5XgGnDE8mGVieFI7uGrvjpm7MV2567un6rA6WUGTCXfddQ3eRYqgtAPAsej ouYl8YS3aBd3N56Obqpj4h8BMtdtujYYIOVDFk+W7HfSFDJTTHDe65xJxpTl3VgqIUmo pI4SkMbuMEFagQxYzTZziQxn82J39o2Z7ocFmImgkgV9x4eSLUJZQMl3FydDHvRMUEpG u+rOOzvhF8F30SkjJIA4rPh2WDlpUGXokQmXmXOoIKmRVkH4a151vkBklfMzbbK9lmfe ilCw== 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=/ONYMO0PIN9dk55uWmFjeEGp9OM+yknAPJhSRMx3xaw=; b=66QPPRAXUhQeVQUAl9SiOx2qvjxlvbOwtXn7x1uZ6FyvOh6Gvg0z9aeDOOWUeoN3lg lxc1r1cKKphtbzjP6IOOo5GI1kuVh3qOC34IO3+49TGzCN9VC84HHGLpmS3wStjle+13 w5X8shpb9dKUthCY2lJgrkKa2jSAYvynku1Wb07XmtY5qUNfaDdTFRyBvxdEKnnePF6T r3OnR6yrMffAmqJD0Ez3AvuQPKzxMuSQhRaY0ZDRYeBny/5lHD8vrdj1FXVLpFKlAeJU dH6wv2yEjQxm9dH7bzEb1FXxmDl882yYebuS0yqsUR9U4IV9aN+bFW3vtKAh5Y4N6DKu Rdqw== X-Gm-Message-State: AFqh2kofAFBLwY9xtOwtYaPX83MsIeJVQhvuKtuRY+hB9EonZmlJkuKv ilDWNPcpSQ/VpJIuc4DFJ4oseydDvODBmw== X-Google-Smtp-Source: AMrXdXvZLValNoGwSyObnfnQYoAH4bPSeKaHZWatAKcSnlYAPIvL07xJdtB6+9NqIK7AN3tdnyykVg== X-Received: by 2002:a17:90b:2485:b0:226:b9ed:1788 with SMTP id nt5-20020a17090b248500b00226b9ed1788mr2782434pjb.31.1672866899803; Wed, 04 Jan 2023 13:14:59 -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.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:14:59 -0800 (PST) From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com> 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)" <vishal.moola@gmail.com>, Matthew Wilcow <willy@infradead.org> Subject: [PATCH v5 03/23] filemap: Convert __filemap_fdatawait_range() to use filemap_get_folios_tag() Date: Wed, 4 Jan 2023 13:14:28 -0800 Message-Id: <20230104211448.4804-4-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 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDA87140017 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: stcziux4ywnt7jtaxci7pjfz97wrrm1h X-HE-Tag: 1672866900-3471 X-HE-Meta: U2FsdGVkX18qU8jIpzAsSyV9W6mt2JhSRQ/PiFtVP4T/MG2xAtlH8WpzeDOJe3Ito1YMi1/wBjucGWYe39Nr0l85rgDG6ab7natkUKDE2yhDustO1AdCfPERkvvo5DvFzwcJEqG/nOfSLpr0nq3ilPKOAnK5XwIfh0JTsluBNY8kNoI1a/VacmxF05M/nq2UOF06AQC1YNkzFGgnWOHG6CkTcQ4JL+mdd/BaarLo+4L2eIM3gsyHAaU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.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Convert to filemap_get_folios_tag()
|
expand
|
diff --git a/mm/filemap.c b/mm/filemap.c index 291bb3e0957a..85adbcf2d9a7 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -503,25 +503,27 @@ static void __filemap_fdatawait_range(struct address_space *mapping, { pgoff_t index = start_byte >> PAGE_SHIFT; pgoff_t end = end_byte >> PAGE_SHIFT; - struct pagevec pvec; - int nr_pages; + struct folio_batch fbatch; + unsigned nr_folios; + + folio_batch_init(&fbatch); - pagevec_init(&pvec); while (index <= end) { unsigned i; - nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, - end, PAGECACHE_TAG_WRITEBACK); - if (!nr_pages) + nr_folios = filemap_get_folios_tag(mapping, &index, end, + PAGECACHE_TAG_WRITEBACK, &fbatch); + + if (!nr_folios) break; - for (i = 0; i < nr_pages; i++) { - struct page *page = pvec.pages[i]; + for (i = 0; i < nr_folios; i++) { + struct folio *folio = fbatch.folios[i]; - wait_on_page_writeback(page); - ClearPageError(page); + folio_wait_writeback(folio); + folio_clear_error(folio); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); } }