]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fuse: hook into iomap for invalidating and checking partial uptodateness
authorJoanne Koong <joannelkoong@gmail.com>
Tue, 15 Jul 2025 20:21:21 +0000 (13:21 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 17 Jul 2025 07:55:19 +0000 (09:55 +0200)
Hook into iomap_invalidate_folio() so that if the entire folio is being
invalidated during truncation, the dirty state is cleared and the folio
doesn't get written back. As well the folio's corresponding ifs struct
will get freed.

Hook into iomap_is_partially_uptodate() since iomap tracks uptodateness
granularly when it does buffered writes.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/20250715202122.2282532-5-joannelkoong@gmail.com
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/fuse/file.c

index a4ef19ad71995ab186d713b5222fe6a713de4fd9..3ffb7c4eae04f0da973dc1b7d770b31fa4951e4f 100644 (file)
@@ -3110,6 +3110,8 @@ static const struct address_space_operations fuse_file_aops  = {
        .launder_folio  = fuse_launder_folio,
        .dirty_folio    = iomap_dirty_folio,
        .release_folio  = iomap_release_folio,
+       .invalidate_folio = iomap_invalidate_folio,
+       .is_partially_uptodate = iomap_is_partially_uptodate,
        .migrate_folio  = filemap_migrate_folio,
        .bmap           = fuse_bmap,
        .direct_IO      = fuse_direct_IO,