Skip to content

Commit

Permalink
CUSE: implement CUSE - Character device in Userspace
Browse files Browse the repository at this point in the history
CUSE enables implementing character devices in userspace.  With recent
additions of ioctl and poll support, FUSE already has most of what's
necessary to implement character devices.  All CUSE has to do is
bonding all those components - FUSE, chardev and the driver model -
nicely.

When client opens /dev/cuse, kernel starts conversation with
CUSE_INIT.  The client tells CUSE which device it wants to create.  As
the previous patch made fuse_file usable without associated
fuse_inode, CUSE doesn't create super block or inodes.  It attaches
fuse_file to cdev file->private_data during open and set ff->fi to
NULL.  The rest of the operation is almost identical to FUSE direct IO
case.

Each CUSE device has a corresponding directory /sys/class/cuse/DEVNAME
(which is symlink to /sys/devices/virtual/class/DEVNAME if
SYSFS_DEPRECATED is turned off) which hosts "waiting" and "abort"
among other things.  Those two files have the same meaning as the FUSE
control files.

The only notable lacking feature compared to in-kernel implementation
is mmap support.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Tejun Heo authored and Miklos Szeredi committed Jun 9, 2009
1 parent 08cbf54 commit 151060a
Show file tree
Hide file tree
Showing 4 changed files with 652 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ source "fs/autofs/Kconfig"
source "fs/autofs4/Kconfig"
source "fs/fuse/Kconfig"

config CUSE
tristate "Character device in Userpace support"
depends on FUSE_FS
help
This FUSE extension allows character devices to be
implemented in userspace.

If you want to develop or use userspace character device
based on CUSE, answer Y or M.

config GENERIC_ACL
bool
select FS_POSIX_ACL
Expand Down
1 change: 1 addition & 0 deletions fs/fuse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
#

obj-$(CONFIG_FUSE_FS) += fuse.o
obj-$(CONFIG_CUSE) += cuse.o

fuse-objs := dev.o dir.o file.o inode.o control.o
Loading

0 comments on commit 151060a

Please sign in to comment.