FUSE - implementing filesystems in user space
来源:互联网 发布:康佳智能电视软件 编辑:程序博客网 时间:2024/04/30 02:55
Last week we looked at implementing device drivers in user space. Drivers are not the only kernel functionality which can be moved across the divide, however; it is also possible to implement filesystems with user-space code. Linux has a long tradition of user-space filesystems, actually; NFS was implemented that way for quite some time. Even so, user-space filesystems are not widely used, for a number of obvious reasons (performance, security, ...). But there are situations where a user-space filesystem can be a nice thing to have.
For those situations, there is a project called FUSE. Its associated SourceForge page is not particularly enlightening; one really has to look at the project's code to understand what FUSE has to offer. Since the second FUSE 1.1 release candidate has just been announced, this seems like a good time for such an examination.
FUSE is a three-part system. The first of those parts is a kernel module which hooks into the VFS code and looks like a filesystem module. It also implements a special-purpose device which can be opened by a user-space process. It then spends its time accepting filesystem requests, translating them into its own protocol, and sending them out via the device interface. Responses to requests come back from user space via the FUSE device, and are translated back into the form expected by the kernel.
In user space, FUSE implements a library which manages communications with the kernel module. It accepts filesystem requests from the FUSE device and translates them into a set of function calls which look similar (but not identical) to the kernel's VFS interface. These functions have names like open(), read(), write(), rename(), symlink(), etc.
Finally, there is a user-supplied component which actually implements the filesystem of interest. It fills a fuse_operations structure with pointers to its functions which implement the required operations in whatever way makes sense. This interface is not well documented, but the example filesystem provided with FUSE (which implements a simple sort of loopback filesystem) is reasonably easy to follow.
An old filesystem module (AVFS) uses FUSE to make filesystems out of tar and zip files, but one could imagine any number of other possibilities. It would not be that hard to make filesystems which mirror a web site (in read-only mode, at least), provide access to an object database, or provide a file-per-user view of the password file, for example. FUSE could be an ideal platform for experimenters who want to take the "everything is a file" idea to its limit.
For those situations, there is a project called FUSE. Its associated SourceForge page is not particularly enlightening; one really has to look at the project's code to understand what FUSE has to offer. Since the second FUSE 1.1 release candidate has just been announced, this seems like a good time for such an examination.
FUSE is a three-part system. The first of those parts is a kernel module which hooks into the VFS code and looks like a filesystem module. It also implements a special-purpose device which can be opened by a user-space process. It then spends its time accepting filesystem requests, translating them into its own protocol, and sending them out via the device interface. Responses to requests come back from user space via the FUSE device, and are translated back into the form expected by the kernel.
In user space, FUSE implements a library which manages communications with the kernel module. It accepts filesystem requests from the FUSE device and translates them into a set of function calls which look similar (but not identical) to the kernel's VFS interface. These functions have names like open(), read(), write(), rename(), symlink(), etc.
Finally, there is a user-supplied component which actually implements the filesystem of interest. It fills a fuse_operations structure with pointers to its functions which implement the required operations in whatever way makes sense. This interface is not well documented, but the example filesystem provided with FUSE (which implements a simple sort of loopback filesystem) is reasonably easy to follow.
An old filesystem module (AVFS) uses FUSE to make filesystems out of tar and zip files, but one could imagine any number of other possibilities. It would not be that hard to make filesystems which mirror a web site (in read-only mode, at least), provide access to an object database, or provide a file-per-user view of the password file, for example. FUSE could be an ideal platform for experimenters who want to take the "everything is a file" idea to its limit.
- FUSE - implementing filesystems in user space
- Implementing a CXFRS client in JBoss Fuse
- FUSE(Filesystem in userspace)(用户空间文件系统),user-space框架简单介绍
- Example on implementing DependencyProperty in User control
- mtd program in user space
- Writing a Real Driver -- In User Space
- Implementing your own base class for user controls in Silverlight 2
- fuse : Filesystem in Userspace
- how to disable alignment trap from user space in linux
- DMA in user space (uio dma) //code analysis
- linux i2c access in kernel and user space
- Manipulating I2C Peripheral Directly in Linux User Space
- Implementing Apriori Algorithm in
- atime, ctime and mtime in Unix filesystems
- Kernel Space - User Space Interfaces_Mmap
- user space to kernel space
- Kernel Space - User Space Interfaces
- Kernel Space - User Space Interfaces
- 关于linux下软件安装要注意的地方
- VC中DDB与DIB位图编程全攻略
- 关于WINFORM中输入法的设置
- 明确自己的方向
- DIB(Device-indepentent bitmap)
- FUSE - implementing filesystems in user space
- 感叹一下吧
- Ubuntu FAQ
- 利用sender的Parent获取GridView中的当前行(转自Web.网际浪人)
- 2007年通过做调查你一样能获得比较稳定的收入
- WinCE 程序设计 (3rd 版)--2.3 位图
- 测试驱动开发全功略
- 希尔排序
- 刚找到的新文章,关于Ct并行语言的