sys/vfs/fuse: Add initial FUSE support
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 31 Mar 2019 16:30:07 +0000 (01:30 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 31 Mar 2019 17:04:18 +0000 (02:04 +0900)
commit5812c3cc7f8e910251a2cf4e78242f0b11a5fb4d
treef03840b46eb1d4598e7d09adfd890aad737ddaea
parent2dfa19fa300df7648d9bf56b69c2cfd345882046
sys/vfs/fuse: Add initial FUSE support

The basic code design comes from FreeBSD, but the code is written
from scratch. It was just easier to write from scratch than trying to
port sys/fs/fuse/* in FreeBSD for various reasons. Note that this is
to implement FUSE API/ABI, but not to be compatible with FreeBSD
implementation which contains FreeBSD specific sysctls, etc.

The initial version doesn't support FUSE_WRITE by disabling
VOP_WRITE() by returning EOPNOTSUPP. It currently works with simple
write(2) calls like dd(1) via direct I/O, but not when syncer thread
or mmap(2) gets involved under non trivial conditions. It looks to
be doable with custom VOP_GETPAGES() and VOP_PUTPAGES(), but if not
then it requires some changes to sys/kern/* and sys/vm/* to properly
support writes.

Besides above, this initial version supports basic FUSE operations
invoked from file related system calls via FUSE VOP's, but not things
like FUSE_IOCTL, FUSE_POLL, FUSE_FALLOCATE, etc. Although dmesg says
FUSE 7.28, don't expect it to support everything 7.28 (or anywhere
close to 7.28) says it has.

FUSE will be dropped from DragonFly releases until it gets stabilized
to certain extent including above, at least for write support.
24 files changed:
etc/mtree/BSD.include.dist
include/Makefile
sbin/Makefile
sbin/mount_fuse/Makefile [new file with mode: 0644]
sbin/mount_fuse/mount_fusefs.8 [new file with mode: 0644]
sbin/mount_fuse/mount_fusefs.c [new file with mode: 0644]
sys/conf/files
sys/conf/options
sys/kern/vfs_vnops.c
sys/sys/vfscache.h
sys/vfs/Makefile
sys/vfs/fuse/Makefile [new file with mode: 0644]
sys/vfs/fuse/fuse.h [new file with mode: 0644]
sys/vfs/fuse/fuse_abi.h [new file with mode: 0644]
sys/vfs/fuse/fuse_debug.h [new file with mode: 0644]
sys/vfs/fuse/fuse_device.c [new file with mode: 0644]
sys/vfs/fuse/fuse_file.c [new file with mode: 0644]
sys/vfs/fuse/fuse_io.c [new file with mode: 0644]
sys/vfs/fuse/fuse_ipc.c [new file with mode: 0644]
sys/vfs/fuse/fuse_mount.h [new file with mode: 0644]
sys/vfs/fuse/fuse_node.c [new file with mode: 0644]
sys/vfs/fuse/fuse_util.c [new file with mode: 0644]
sys/vfs/fuse/fuse_vfsops.c [new file with mode: 0644]
sys/vfs/fuse/fuse_vnops.c [new file with mode: 0644]