]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: Move clearing of mappedtodisk to buffer.c
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 2 Oct 2024 04:01:03 +0000 (05:01 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 4 Oct 2024 07:24:24 +0000 (09:24 +0200)
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) <willy@infradead.org>
Link: https://lore.kernel.org/r/20241002040111.1023018-2-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/buffer.c
mm/truncate.c

index 1fc9a50def0b51ccc916d55003ebb02d2df567c1..35f9af799e0a09f2e0ede47075f4155e34b3e715 100644 (file)
@@ -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);
index 0668cd340a46304f62525597374e5928a51d3f0f..870af79fb4464bba169929f66408a04a5a55df7e 100644 (file)
@@ -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)