Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. FUSE perhaps the Future of Us and Everyone else Robert Love Claude Elwood Shannon Senior Engineer Linux Desktop Group rml at novell dot com
  2. 2. FUSE <ul><li>User-space filesystems </li></ul><ul><li>Accessible as real kernel mounts </li></ul><ul><li>Access via POSIX I/O </li></ul><ul><li>A regular kernel filesystem module that runs in user-space </li></ul><ul><ul><li>Very microkernel-esque! </li></ul></ul>
  3. 3. Why FUSE over the Kernel? <ul><li>Easier to develop, debug, and deploy </li></ul><ul><li>FUSE modules can run as a non-privileged user </li></ul><ul><li>FUSE modules can do anything a normal process can </li></ul><ul><ul><li>Communicate with other processes </li></ul></ul><ul><ul><li>Spawn threads </li></ul></ul><ul><ul><li>Utilize libraries </li></ul></ul><ul><li>Many filesystems make more sense in user-space </li></ul><ul><ul><li>Network, for example </li></ul></ul><ul><ul><li>The Gmail filesystem, a real FUSE module, as another </li></ul></ul>
  4. 4. State of the FUSE <ul><li>Linux </li></ul><ul><ul><li>Merged into 2.6 kernel </li></ul></ul><ul><ul><li>Patch available for 2.4 kernel </li></ul></ul><ul><li>FreeBSD </li></ul><ul><ul><li>Patch available </li></ul></ul><ul><li>OpenSolaris </li></ul><ul><ul><li>Discussions on porting </li></ul></ul><ul><li>FUSE modules work on all platforms </li></ul><ul><li>FUSE is stable, feature-complete, maintained </li></ul>
  5. 5. Why FUSE over GNOME-VFS? <ul><li>Real kernel mounts </li></ul><ul><li>POSIX I/O </li></ul><ul><li>ISVs like it better </li></ul><ul><ul><li>No high-level requirement </li></ul></ul><ul><ul><li>Works with CLI </li></ul></ul><ul><li>Better performance </li></ul><ul><li>Memory Mappings </li></ul><ul><li>Leverage new kernel features </li></ul>
  6. 6. Kernel Mounts and POSIX I/O <ul><li>With Unix: </li></ul><ul><ul><li>Unix files are accessible via file paths </li></ul></ul><ul><ul><li>The first-class object in Unix is the file descriptor </li></ul></ul><ul><li>GNOME-VFS replaces these concepts: </li></ul><ul><ul><li>Files are referenced via URI </li></ul></ul><ul><ul><li>The first-class object is a GNOMEVFSHandle </li></ul></ul><ul><li>Applications must speak GNOME-VFS </li></ul><ul><li>Impossible to use an fd-based interface </li></ul><ul><li>Even within GNOME, results are uneven </li></ul><ul><li>ISV story: What about CLI? KDE? Gtk-only apps? </li></ul>
  7. 7. Mmmm, maps <ul><li>Can mmap() files on a FUSE filesystem </li></ul><ul><li>Can never do memory mappings without the kernel </li></ul><ul><li>Just Works </li></ul><ul><ul><li>(Except shared-writable mappings, which can introduce a deadlock, but a solution is possible) </li></ul></ul>
  8. 8. Goldy Flocks <ul><li>Can do kernel-assisted file locking via flock() </li></ul><ul><ul><li>Advisory and Mandatory </li></ul></ul><ul><li>Faster than any user-space solution </li></ul><ul><li>Not merged as of 2.6.17 but can easily add </li></ul>
  9. 9. Leverage New Kernel Features <ul><li>As kernel features and new system calls are added, they will just work with a FUSE-based filesystem </li></ul><ul><li>No need to wrap or abstract </li></ul><ul><li>Example: inotify, xattrs, & ACLs automatically work </li></ul>
  10. 10. API <ul><li>API is very simple </li></ul><ul><li>Fill out a v-table and call fuse_main() </li></ul><ul><li>Simple: open, read, write, getattr, readdir, unlink </li></ul><ul><li>Advanced: getxattr, setxattr, chown, chmod, truncate </li></ul><ul><li>The “rules” and “behavior” for implementing each interface is essentially “follow POSIX” </li></ul><ul><li>All are optional </li></ul><ul><ul><li>Although you really want getattr() </li></ul></ul>
  11. 11. Hello World! static const char *hello_str = “Hello GUADEC!”; static const char *hello_path = “/hello”; static int hello_open(const char *path, struct fuse_file_info *fi) { if (strcmp (path, hello_path) != 0) return -ENOENT; if ((fi->flags & 3) != O_RDONLY) return -EACCES; return 0; } static int hello_read (const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { size_t len; if (strcmp (path, hello_path) != 0) return -ENOENT; len = strlen (hello_str); if (offset < len) { if (offset + size > len) size = len - offset; memcpy (buf, hello_str + offset, size); } else size = 0; return size; }
  12. 12. beaglefs <ul><li>Exports a Beagle Query as a filesystem </li></ul><ul><li>Filesystem is composed of symlinks to query hits </li></ul><ul><li>Extended Attributes contain hit metadata </li></ul><ul><li>Wrote it in a few hours to learn FUSE </li></ul><ul><ul><li>Simple, easy, powerful </li></ul></ul><ul><ul><ul><li>also, I am damn good </li></ul></ul></ul><ul><ul><ul><ul><li>and libbeagle is really nice </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>not to mention FUSE, which is great </li></ul></ul></ul></ul></ul><ul><li>See Joey's (see photo, right) talk for more on Beagle and beaglefs </li></ul>
  13. 13. FUSE and GNOME <ul><li>GNOME can benefit immensely from FUSE </li></ul><ul><li>Use FUSE as GNOME's filesystem abstraction </li></ul><ul><li>Replace GNOME-VFS fs modules with FUSE? </li></ul><ul><ul><li>Unofficially? We can encourage new modules to use FUSE </li></ul></ul><ul><ul><li>Officially? We can adopt FUSE and leverage its greatness </li></ul></ul><ul><li>GNOME-VFS, of course, is not going anywhere </li></ul><ul><ul><li>Much larger, broader API (which also needs work!) </li></ul></ul><ul><ul><li>There already exists a gnome-vfs-to-fuse wrapper </li></ul></ul>
  14. 14. Potent Portable Potables <ul><li>“But FUSE is Linux-specific and GNOME is not” </li></ul><ul><li>Really two levels of portability </li></ul><ul><ul><li>Can we require FUSE if $OS does not provide FUSE? </li></ul></ul><ul><ul><ul><li>FreeBSD and Linux both supported. OpenSolaris someday? </li></ul></ul></ul><ul><ul><li>What does “require FUSE” even mean? </li></ul></ul><ul><ul><ul><li>We don't need a special API to access FUSE </li></ul></ul></ul><ul><ul><ul><li>We can wrap the few calls for manipulating FUSE (mount, unmount) </li></ul></ul></ul><ul><ul><ul><ul><li>Leave the implementation of the abstraction to the OS </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Never actually depend on “FUSE” proper </li></ul></ul></ul></ul>
  15. 15. The Itty Gritty on Contributing <ul><li>Homepage: </li></ul><ul><li>I am not the maintainer </li></ul><ul><li>Maintainer: Miklos Szeredi </li></ul><ul><li>Mailing list: [email_address] </li></ul><ul><li>Kernel list: [email_address] </li></ul><ul><li>TODO FUSE module: File locks (I have start of patch) and shared writable mappings </li></ul><ul><li>TODO filesystem modules: NetworkManagerFS? </li></ul><ul><li>TODO GNOME: The discussion starts here. FUSE as our future? </li></ul>
  16. 16. FUSE perhaps the Future of Us and Everyone else Robert Love Claude Elwood Shannon Senior Engineer Linux Desktop Group rml at novell dot com
  17. 17. <ul><li>Unpublished Work of Novell, Inc. All Rights Reserved. </li></ul><ul><li>This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability. </li></ul><ul><li>General Disclaimer </li></ul><ul><li>This document is not to be construed as a promise by any participating company to develop, deliver, or market a product. Novell, Inc., makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc., reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners. </li></ul>