Skip to content

Commit d1dfb5f

Browse files
asahilinaMiklos Szeredi
authored andcommitted
virtiofs: dax: remove ->writepages() callback
When using FUSE DAX with virtiofs, cache coherency is managed by the host. Disk persistence is handled via fsync() and friends, which are passed directly via the FUSE layer to the host. Therefore, there's no need to do dax_writeback_mapping_range(). All that ends up doing is a cache flush operation, which is not caught by KVM and doesn't do much, since the host and guest are already cache-coherent. Since dax_writeback_mapping_range() checks that the inode block size is equal to PAGE_SIZE, this fixes a spurious WARN when virtiofs is used with a mismatched guest PAGE_SIZE and virtiofs backing FS block size (this happens, for example, when it's a tmpfs and the host and guest have a different PAGE_SIZE). FUSE DAX does not require any particular FS block size, since it always performs DAX mappings in aligned 2MiB blocks. See discussion in [1]. [1] https://lore.kernel.org/lkml/20241101-dax-page-size-v1-1-eedbd0c6b08f@asahilina.net/T/#u [SzM: remove the empty callback] Suggested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Asahi Lina <lina@asahilina.net> Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 69eb56f commit d1dfb5f

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

fs/fuse/dax.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -774,16 +774,6 @@ ssize_t fuse_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
774774
return ret;
775775
}
776776

777-
static int fuse_dax_writepages(struct address_space *mapping,
778-
struct writeback_control *wbc)
779-
{
780-
781-
struct inode *inode = mapping->host;
782-
struct fuse_conn *fc = get_fuse_conn(inode);
783-
784-
return dax_writeback_mapping_range(mapping, fc->dax->dev, wbc);
785-
}
786-
787777
static vm_fault_t __fuse_dax_fault(struct vm_fault *vmf, unsigned int order,
788778
bool write)
789779
{
@@ -1323,7 +1313,6 @@ bool fuse_dax_inode_alloc(struct super_block *sb, struct fuse_inode *fi)
13231313
}
13241314

13251315
static const struct address_space_operations fuse_dax_file_aops = {
1326-
.writepages = fuse_dax_writepages,
13271316
.direct_IO = noop_direct_IO,
13281317
.dirty_folio = noop_dirty_folio,
13291318
};

0 commit comments

Comments
 (0)