From patchwork Wed Oct 2 04:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819308 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 2B0CFCF3194 for ; Wed, 2 Oct 2024 04:01:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 178CE44017B; Wed, 2 Oct 2024 00:01:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10327440175; Wed, 2 Oct 2024 00:01:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBEEF44017B; Wed, 2 Oct 2024 00:01:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AFCCC440175 for ; Wed, 2 Oct 2024 00:01:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1D7F51C4D80 for ; Wed, 2 Oct 2024 04:01:26 +0000 (UTC) X-FDA: 82627312572.16.C046331 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id 64EDE1A0011 for ; Wed, 2 Oct 2024 04:01:24 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=mciO33gZ; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841590; a=rsa-sha256; cv=none; b=weqhUZWV1FIqk6X0gicjwzsj3QfZNWCswVYcYaKCr5/O+KyJLUfVc+zYoK8TLWSktfzaWr 3XcVGv9HTD4uSjOar3C/kKOD3q+kRl9vxayPekRItGbZXMA2vkZMS2OEg5uiYTJPo3Ocuo 1wVfsEbAaPEUjlfv84xiQ7Tj2v5bpwo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=mciO33gZ; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841590; 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=IS+o70XI9H6xAbtwLOTIZ3eCVSzAnaR0y6//eiVhID0=; b=FMN6R03FDp/JT+9BMCVSbIbHVJx5xemI1WX4vhhKvbFF8zH3vJqPdqIhqvdT32h/PmeosD wDKGYWM5qhyV7JxsOMvj7HShLlVeYvOn4O3QMIItAoiRX5veFRxZM62CSkQGM9HcR2Uq3X k864x2LTpp8wEiyxq9sLa5AwT6sksfU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=IS+o70XI9H6xAbtwLOTIZ3eCVSzAnaR0y6//eiVhID0=; b=mciO33gZCfuz25EaGN6Yu3qDbL /m9SVAj5Ircnf11Vk607Z4G9g5Js9S8IjTN2R7t8FZgM/oR+jMao/T7iU2DyEvno2TcH60m6VyJzU 0bkX9v75/BiT15C/N3HU8JmwDW9u9VoZj8cwfbPCFr/zEReWz7/8sIweOFzi6K+XuT4cnNlhNvpdd 3dMtYf9wyJNc5D/YmZwM9h0ZduNNRPpB8V5rbKVH0pSAxO8iLf8sYNpZklbGLALAYNZqBnk/NmBEe zkqpZHVfwhfFgtc2+dr0xsg3/YHdczfTERn/MuHIkZHFNftHqgxFN53cpGhUt1rbJ018C6hgqBrHi Znk/b9xw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8T-2ivo; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/6] fs: Move clearing of mappedtodisk to buffer.c Date: Wed, 2 Oct 2024 05:01:03 +0100 Message-ID: <20241002040111.1023018-2-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 64EDE1A0011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 5i36zmmgkwaedrcrsyhiaq3955b988bu X-HE-Tag: 1727841684-393928 X-HE-Meta: U2FsdGVkX1+SbPWbg4Pv7XUhk+2cez8+zeKQDoI9iEe5CoFgZLkdpNRisxjKO+40Zx+QRFciO/S+GOoe38ylG+891PfHgf4VED0qdU/Rb0yn1mSlCS6T/Edey8FrCH5cE3A55ghobZlZoRrojycoI3DZziFSaYEO7dixVnIFNomYkd6MHC+VclP56neMU4fS4whTNv7QFrBYMqawwtH1mJRCY1OXBsr6pZADUFXeRwX8Oc4sl3lB/sKBV5sAu2nqU9nLzc0wL2J42JBRaILZGRfx9c8G1/aDt5Wm9H8iOQZuEyibk7yRW+7Ut5fi5LX1Ozbpeu/fLhi1gu/h2A2Eq8r25fu7kstm/hAG44Hspyb1GbyyxIE7B1Ud+HrRmSKxTbXEX3VWa3rkvRaGYzcSW7kbwTKxZCq7nAmAn3lFr87N+sKEh7nPZw8CPFvak+VS6Y4RgVJdoJemGI4MylVRUtnTIhLlZWpYhW7sSPLPGfv8n9FfNaJD/dqx7DhWx6JjDTAFSx7kSAn5dt9WCc9mkpw3LYz3pGdP8RiutCP12yXjjwxf4rb5MyjOXP+sdXd4gDFSFO9e1+4o9JT0MJ+jMRQGl9KDhw3H3IiQtx8MCWWI246y7W2VMoZZxMK5PTgX4yjhfFlJG8gxVbkdrFhV+o764NZqjIbRQKRxDI/OChzR0j/YMv+K7wxOFFrR3CNyRZQYGVsqHAwqt76FcvGJn+lZPd8OsH+iw1vHTQ2lg7uctov4H68SLp2VJZj1cBUmFHceigAcTp1F7uFiMXfHIvF1rk+CZqfKi09o/F20G98cUm7iAMAPcAtyx3Rava0sDmWOcYpIVNzBj4XtipDRHetg6rB9+9rntiAw7IRWESLY4fha2xv47uogMh1jhfMn42KKAFJBVxjRAHaSkuR3Xhb/xZ2bRKSJ2/hrO27pvbmoJPE7Rj1GBp2Wq+4xQxdRRb7FtH0Nc0QlyWL6m9u 83F0QLUf mlByiF5gTfio+WD8Cd8bo5CjPiYQJcv090Cvj0hS+3jtBPaTxx+OTsyyWZ7L4XPtLATQuC+kryUxcUr5umIsRwAxaVqrxbiDMU2g1chL8mE/cLsCcHdnJFZfP+HBIgSHMS2ijyCiJ4qP3FzjRYHt/4K8lwelzUCT7EUAUnXl7mGTK9r7qVQ9FeN2saezr5+nmD5qHWWARJHgh9fZp3Am0fIV2nAjMkB0OMsAAknzUxAPEH00= 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: List-Subscribe: List-Unsubscribe: The mappedtodisk flag is only meaningful for buffer head based filesystems. It should not be cleared for other filesystems. This allows us to reuse the mappedtodisk flag to have other meanings in filesystems that do not use buffer heads. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- fs/buffer.c | 1 + mm/truncate.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 1fc9a50def0b..35f9af799e0a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1649,6 +1649,7 @@ void block_invalidate_folio(struct folio *folio, size_t offset, size_t length) if (length == folio_size(folio)) filemap_release_folio(folio, 0); out: + folio_clear_mappedtodisk(folio); return; } EXPORT_SYMBOL(block_invalidate_folio); diff --git a/mm/truncate.c b/mm/truncate.c index 0668cd340a46..870af79fb446 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -166,7 +166,6 @@ static void truncate_cleanup_folio(struct folio *folio) * Hence dirty accounting check is placed after invalidation. */ folio_cancel_dirty(folio); - folio_clear_mappedtodisk(folio); } int truncate_inode_folio(struct address_space *mapping, struct folio *folio)