Message ID | 20221102161031.5820-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 1BEEFC4167B for <linux-mm@archiver.kernel.org>; Wed, 2 Nov 2022 16:11:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FF4F8E0006; Wed, 2 Nov 2022 12:11:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8EC418E0001; Wed, 2 Nov 2022 12:11:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62C0B8E0006; Wed, 2 Nov 2022 12:11:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 526A98E0001 for <linux-mm@kvack.org>; Wed, 2 Nov 2022 12:11:13 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 29641161210 for <linux-mm@kvack.org>; Wed, 2 Nov 2022 16:11:13 +0000 (UTC) X-FDA: 80088991626.12.F322B11 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf02.hostedemail.com (Postfix) with ESMTP id B51038000B for <linux-mm@kvack.org>; Wed, 2 Nov 2022 16:11:12 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id m6so16862249pfb.0 for <linux-mm@kvack.org>; Wed, 02 Nov 2022 09:11:12 -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 :message-id:reply-to; bh=D7ILOV7uCBW9G56cPuCyE+xwJ/LPVQUTk1i899caTl0=; b=WlFYPEeV3wf0VfK6pqbhv5Egc4h8KVjel140fCaMDBK3FcDDdSMrAwC2RRkCV1yrTw g5UfIoUTA56HrpjtwUHlbxxIl2+2XVj36Necvjw2qtsGVhSk3MpYNUz5lqUeXoe9rcG+ rSIhTCQW2xVo9vVWdW8xlqvFvN174oq7e9hBFs8SL0eQTkE9h9BtGOiyq5hrX0X03ARZ +PjKQOimzK0w0ph8uxMDYryUYErs4i2YihTAv+8viAcID4R9rEgIXHWoL0tVB1NY/fCF Zz7LVoKY7ZVpgl83UNZSArBIZLGwCRqsreKwNZaIOWeZgiKqm4whhefGhGSMZzVBzGt+ R1hw== 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=D7ILOV7uCBW9G56cPuCyE+xwJ/LPVQUTk1i899caTl0=; b=5okoWBC63asZlMATTdkyEbvp+IT54jvReSkan9BFdCMLVogpU2dYtnWM5tGCNuV7dJ wF4h5iESvCSgLoECGcIgl8ijYQOS6a3NNJJOx2PsYoTmgRYwBpR1Z57dQtjBEZLJfq5F 3iRTxpVFDhueqI+zuM7TCZK/5ry242/gPu3ZGrTX/sHQAqKHCBunoi7CKDj+8FOCNQ0/ Zv5kRj59E9Jg5QIaGmwiQApqYHkKmcCzRzf53dsvXkaYvVR13qRdz/epno5O9Ca9m+Kb gCcbxiuhnJEUeVKcdY9fPDxE3PPsyIMj4/5hAwyCrNoba+Ugn3RUb6zsav8cfIkB/gF4 0c5w== X-Gm-Message-State: ACrzQf0EcJRV3UsDeNG3RVeMQi93eJLPVr6U105N9Z7CaJhPirmE23g3 DIB/DgKb/5ayVYuTmIHbs2c= X-Google-Smtp-Source: AMsMyM5yBalx5fts0VaFDBkG5q5k8ESrx5LXqDS/i9qmdUWGQhi6efEZneqsEsoguUnslwFAGGHvTA== X-Received: by 2002:a05:6a00:1a10:b0:56d:5266:56aa with SMTP id g16-20020a056a001a1000b0056d526656aamr19077451pfv.61.1667405471611; Wed, 02 Nov 2022 09:11:11 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::8080]) by smtp.googlemail.com with ESMTPSA id ms4-20020a17090b234400b00210c84b8ae5sm1632101pjb.35.2022.11.02.09.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 09:11:11 -0700 (PDT) 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 v4 03/23] filemap: Convert __filemap_fdatawait_range() to use filemap_get_folios_tag() Date: Wed, 2 Nov 2022 09:10:11 -0700 Message-Id: <20221102161031.5820-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102161031.5820-1-vishal.moola@gmail.com> References: <20221102161031.5820-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667405472; a=rsa-sha256; cv=none; b=s+Fr0PZKTW8CFTUaE6epZOgBG3La/bT+FLZsLT4YyOD1phf43mNDaMLTbm/bwBfCLYprvX SXi1znLE8QwZpmYQRHpes9mOU3KlJbc6LrAPgfc3TCeTRsYANZB96mYAWdaYaAh7weS90V INX30oC3WYkWd75WMUWmL1Kmra+sePI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WlFYPEeV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.210.181 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=1667405472; 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=D7ILOV7uCBW9G56cPuCyE+xwJ/LPVQUTk1i899caTl0=; b=a8snqfGZwzWpkPzBhrLamKI3yAUf+dipDQ9VaUxWcZMus8P1SlGbe7zeAmMBmpb/mt64go Tx74Zf8tNW5wpv2ObjoyhPuly9c/LWwR6BB6Jcvl7pDo6MtWE0P3gyZF5nd/G7DwWCdLbP iIGnjK5yAXJBGrzOKFZJ27N1qk0gxRI= X-Stat-Signature: kz3ok8x8jeme8mh5batsr3p67xdtejbe X-Rspamd-Queue-Id: B51038000B Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WlFYPEeV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1667405472-327347 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: <linux-mm.kvack.org> |
Series |
Convert to filemap_get_folios_tag()
|
expand
|
diff --git a/mm/filemap.c b/mm/filemap.c index 9be22672ce1a..cc4be51eae5b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -503,28 +503,30 @@ 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; if (end_byte < start_byte) return; - pagevec_init(&pvec); + folio_batch_init(&fbatch); + 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(); } }