next up previous contents
Next: Problems Up: Introduction to file systems Previous: The VFS Layer   Contents

FUSE

At this point in time you should have a tiny idea how file systems are implemented in the kernel, and how more than one file system can exits. But implementing a new file system require a large amount of work, and we still not have the knowledge and/or time to do an implementation from scratch. Fortunately a new project was recently merged into the kernel, the project is called FUSE[15] and makes it possible to implement file systems in user space, and it provides an interface similarly to VFS. But as the file system runs in user space we can used what ever library we would like with out consider how it can be packed into the kernel.

The following illustration is taking directly from the documentation in the Linux source code, and illustrates how the Linux kernel and the FUSE file system daemon are interacting.

Everything except FUSE       | FUSE file system daemon
file system Daemon           |
-----------------------------+--------------------------------
"rm /mnt/fuse/file"          |
                             |>sys_read()
                             | >fuse_dev_read()
                             |  >request_wait()
                             |   [sleep on fc->waitq]
>sys_unlink()                |
 >fuse_unlink()              |
  [get request from          |
   fc->unused_list]          |
  >request_send()            |
   [queue req on fc->pending]|
   [wake up fc->waitq]       |   [woken up]
   >request_wait_answer()    |
    [sleep on req->waitq]    |
                             |  <request_wait()
                             |  [remove req from fc->pending]
                             |  [copy req to read buffer]
                             |  [add req to fc->processing]
                             | <fuse_dev_read()
                             |<sys_read()
                             |
                             |[perform unlink]
                             |
                             |>sys_write()
                             | >fuse_dev_write()
                             |  [look up req in fc->processing]
                             |  [remove from fc->processing]
                             |  [copy write buffer to req]
    [woken up]               |  [wake up req->waitq]
                             | <fuse_dev_write()
                             |<sys_write()
   <request_wait_answer()    |
  <request_send()            |
  [add request to            |
   fc->unused_list]          |
 <fuse_unlink()              |
 <fuse_unlink()              |
<sys_unlink()                |

At this point in time you should have an idea of what the kernel expect from the file system.



2007-11-09