LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

Develop your own filesystem with FUSE (developerWorks)

IBM developerWorks takes a look at FUSE. "Before the advent of user space filesystems, filesystem development was the job of the kernel developer. Creating filesystems required knowledge of kernel programming and the kernel technologies (like vfs). And debugging required C and C++ expertise. But other developers needed to manipulate a filesystem -- to add personalized features (such as adding history or forward-caching) and enhancements."
(Log in to post comments)

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 8:27 UTC (Wed) by LintuxCx (subscriber, #14448) [Link]

C++ expertise? What does C++ have to do with the Linux kernel? Although FUSE would probably allow someone to use C++ to write a filesystem.

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 8:58 UTC (Wed) by philips (guest, #937) [Link]

iirc, FUSE is file system in user space. So why not a C++? Well, I know reasons why not, but I'm not gonna tell ya. ;-)

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 11:45 UTC (Wed) by nix (subscriber, #2304) [Link]

Well, I'm writing one in C++ and it's going quite all right thank you.

I can't see any fundamental reasons why it would be a bad idea (well, don't let exceptions propagate into the FUSE library, of course, but that's bloody obvious and very easy to fix).

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 3, 2006 8:01 UTC (Fri) by LintuxCx (subscriber, #14448) [Link]

Yes, but in the text they say that C++ expertise is needed to write fs drivers for the kernel. Indeed FUSE makes it possible to write fs drivers in any language you want, that's indeed pretty cool. :-)

But I -thank god- don't see what C++ has to do with the kernel.

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 11:02 UTC (Wed) by drag (subscriber, #31333) [Link]

This FUSE stuff is the most bizzare stuff I've seen in a very long time (as far as software-related items go).

I am a bit weirded out actually. This has to be some sort of revelation or something in computer science or whatnot. It's just...

Look at this page:
http://fuse.sourceforge.net/wiki/index.php/FileSystems

Some of them are 'of course' items. SshFS for instance. Or a FTP file system in perl. A few NTFS items that should allow read right stuff. Webdav. That OpenAFS client so that you don't have to use kernel modules is nice. Exposing KDE's Kioslave stuff to non-kde applications.

That stuff I can understand, I expected that. Fuse is nice, Fuse is usefull, etc etc.

OWFS -- exposes your little onboard databuses like for tempurature sensors and such. A bit weird, but not alien.. kinda like some items in /proc or /sys

Bluetooth File System, GmailFS.. some stuff for digital cameras. Novel stuff.

Now somebody please tell me how exactly a Bittorrent File Systems is suppose to work?? Or WikipediaFS?

A.. bittorrent.. file.. system..

Doesn't make sense. But obviously it has to in some way.

This stuff is very cool. VERY cool.

Relational database file systems. Logging file systems.

It would be wonderfull way to impliment Beagle or search related Virtual Folders. It would blow Vista's Virtual Folder features out of the water.

Also that KnoppixHTTP file system gives me a good idea, I think.
But I appear to have been beaten by the world.. after a few google searches.

I would realy like to see a Zero-Install type setup using Fuse. (they have this zero-install file system based on a kernel module, but I can't see that surviving long with FUSE around)

How hard would it be to setup something like a entire Debian Distro or Ubuntu Distro online?? Instead of installing software via apt-get you just have entire Linux distros online? Or be able to export a Linux image from a central server on a LAN? I would like to even be able to do that at home.

Sort of like a State-less Linux setup?

Like you simply cache the file system as you use it. Have a local /home and /temp directory and do the file system as a read-only image with a knoppix-style overlay. It would be great. Talk about making software installs easy. Instead of having to go apt-get update or yum install or anything like that you just open up your application menu and select one from your Gnome or Debian menu. If you want to use some third party repository you wouldn't install and update your OS against it.. you could do something like just mount it to /usr/reponame and use a script or something to setup the enviromental variables.

I am realy going to have to look at that KnoppixHTTP stuff...

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 15:53 UTC (Wed) by macc (subscriber, #510) [Link]

there are even wierder ways to use fuse:

http://wiki.tcl.tk/13853

tcl has a vfs that is used ( not only but )
for "single file" executables.
this runs into problems when you try to give
other programms ( linker/loader, other utilities )
access to files in this (internal) vfs.
the tclfuse stuff makes this vfs visible to
the linux fs side.

G!

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 18:43 UTC (Wed) by caitlinbestler (guest, #32532) [Link]

This approach suffers from thinking inside the box.

The ability to write user-mode file system daemons
has always existed. You can also write user-mode
file system clients when you do not need access
integrated into the regular file system.

If your user-mode file system daemon supports a
protocol that there is already a kernel client
for then all you have to do is to tell the kernel
to connect to your file server.

All of which works without a kernel module.

Why not just teach the kernel a few simple (less
than NFS or CIFS) file service protocols, and
double-check that the loopback device is efficient
for this type of transfer. Using an RDMA interface
can help if a socket interface proves to be a
bottleneck.

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 1, 2006 23:17 UTC (Wed) by captrb (subscriber, #2291) [Link]


I think you are inside the same box. If the "simple file system
protocols" were written into the kernel, then they would also likely be
implement as modules. In other words, I think that the FUSE module
*is* the protocol that you describe.

As for the using the loopback interface, why bother serializing the
interaction between the kernel and the FS daemon when there could
be direct memory interaction? It seems awfully silly to use a network
interface for something that is likely not a network application. After
all, a FUSE-mounted filesystem could be exported over existing remote
network filesystems. One of many benefits to this arrangement is that
you would not be forced to deal with endian issues in the filesystem.

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 2, 2006 3:39 UTC (Thu) by xoddam (subscriber, #2322) [Link]

> Why not just teach the kernel a few simple (less than NFS or CIFS)
> file service protocols

If you're talking about pipe/network protocols, nothing is simpler or
more elegant than 9P. Which is available for Linux as v9fs (still in -mm
AFAICR).

The value of FUSE is that it can provide (a) full POSIX semantics, which
9P can't, and (b) all the interfaces provided by the Linux vfs, which 9P
doesn't.

(The ability to share pages between the server and the in-kernel
client enables zero-copy implementations too, but I'm not sure any
actually exist, or that FUSE could ever be a first choice for high
performance! Linux is a 'monolithic' kernel for a reason.)

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 2, 2006 14:40 UTC (Thu) by nix (subscriber, #2304) [Link]

It's not quite full-POSIX yet. You can't control locking and a few other things from FUSE daemons. But all this will come :)

Develop your own filesystem with FUSE (developerWorks)

Posted Mar 2, 2006 22:22 UTC (Thu) by khim (subscriber, #9252) [Link]

Small correction: both v9fs and FUSE were added to mainline at the same time. Choice is yours... but most users choose FUSE :)

Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds