linux/fs/fuse
Amir Goldstein fda0b98ef0 fuse: implement passthrough for mmap
An mmap request for a file open in passthrough mode, maps the memory
directly to the backing file.

An mmap of a file in direct io mode, usually uses cached mmap and puts
the inode in caching io mode, which denies new passthrough opens of that
inode, because caching io mode is conflicting with passthrough io mode.

For the same reason, trying to mmap a direct io file, while there is
a passthrough file open on the same inode will fail with -ENODEV.

An mmap of a file in direct io mode, also needs to wait for parallel
dio writes in-progress to complete.

If a passthrough file is opened, while an mmap of another direct io
file is waiting for parallel dio writes to complete, the wait is aborted
and mmap fails with -ENODEV.

A FUSE server that uses passthrough and direct io opens on the same inode
that may also be mmaped, is advised to provide a backing fd also for the
files that are open in direct io mode (i.e. use the flags combination
FOPEN_DIRECT_IO | FOPEN_PASSTHROUGH), so that mmap will always use the
backing file, even if read/write do not passthrough.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2024-03-05 13:40:42 +01:00
..
acl.c fs.idmapped.v6.3 2023-02-20 11:53:11 -08:00
control.c fuse: convert to new timestamp accessors 2023-10-18 14:08:21 +02:00
cuse.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
dax.c fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() 2023-12-04 10:16:53 +01:00
dev.c fuse: implement ioctls to manage backing files 2024-03-05 13:40:36 +01:00
dir.c fuse: prepare for opening file in passthrough mode 2024-03-05 13:40:42 +01:00
file.c fuse: implement passthrough for mmap 2024-03-05 13:40:42 +01:00
fuse_i.h fuse: implement passthrough for mmap 2024-03-05 13:40:42 +01:00
inode.c fuse: implement ioctls to manage backing files 2024-03-05 13:40:36 +01:00
ioctl.c fuse: ioctl: translate ENOSYS in outarg 2023-06-21 11:17:36 +02:00
iomode.c fuse: implement open in passthrough mode 2024-03-05 13:40:42 +01:00
Kconfig fuse: introduce FUSE_PASSTHROUGH capability 2024-02-23 17:36:32 +01:00
Makefile fuse: introduce FUSE_PASSTHROUGH capability 2024-02-23 17:36:32 +01:00
passthrough.c fuse: implement passthrough for mmap 2024-03-05 13:40:42 +01:00
readdir.c fuse: convert to new timestamp accessors 2023-10-18 14:08:21 +02:00
virtio_fs.c virtiofs: emit uevents on filesystem events 2024-02-23 09:40:26 +01:00
xattr.c fuse: move fuse_xattr_handlers to .rodata 2023-10-09 16:24:18 +02:00