レナート   TBFKAYIBYNYAAYB   ﻟﻴﻨﺎﺭﺕ

Tue, 01 May 2007

My thoughts on the future of Gnome-VFS

One of the major construction sites in GNOME and all the other free desktop environments is the VFS abstraction. Recently, there has been some discussion about developing a replacement DVFS as replacement for the venerable Gnome-VFS system. Here are my 5 euro cent on this issue (Yepp, I am not fully up-to-date on the whole DVFS discussion, but during my flight from HEL to HAM I wrote this up, without being necesarily too well informed, lacking an Internet connection. Hence, if you find that I am an uniformed idiot, you're of course welcome to flame me!):

First of all, we have to acknowledge that Gnome-VFS never achieved any major adoption besides some core (not even all) GNOME applications. The reasons are many, among them: the API wasn't all fun, using Gnome-VFS added another dependency to applications, KDE uses a different abstraction (KIO), and many others. Adoption was suboptimal, and due to that user experience was suboptimal, too (to say the least).

One of the basic problems of Gnome-VFS is that it is a (somewhat) redundant abstraction layer over yet another abstraction layer. Gnome-VFS makes available an API that offers more or less the same functionality as the (most of the time) underlying POSIX API. The POSIX API is well accepted, relatively easy-to-use, portable and very well accepted. The same is not true for Gnome-VFS. Semantics of the translation between Gnome-VFS and POSIX are not always that clear. Paths understood by Gnome-VFS (URLs) follow a different model than those of the Linux kernel. Applications which understand Gnome-VFS can deal with FTP and HTTP resources, while the majority of the applications which do not link against Gnome-VFS does not understand it. Integration of Gnome-VFS-speaking and POSIX-speaking applications is difficult and most of the time only partially implementable.

So, in short: One one side we have that POSIX API which is a file system abstraction API. And a (kernel-based) virtual file system behind it. And on the other side we have the Gnome-VFS API which is also a file system abstraction API and a virtual file system behind it. Hence, why did we decide to standardize on Gnome-VFS, and not just on POSIX?

The major reason of course is that until recently accessing FTP, HTTP and other protocol shares through the POSIX API was not doable without special kernel patches. However, a while ago the FUSE system has been merged into the Linux kernel and has been made available for other operating systems as well, among them FreeBSD and MacOS X. This allows implementing file system drivers in userspace. Currently there are all kinds of these FUSE based file systems around, FTP and SSHFS are only two of them. My very own fusedav tool implements WebDAV for FUSE.

Another (*the* other?) major problem of the POSIX file system API is its synchronous design. While that is usually not a problem for local file systems and for high-speed network file systems such as NFS it becomes a problem for slow network FSs such as HTTP or FTP. Having the GUI block for various seconds while an application saves its documents is certainly not user friendly. But, can this be fixed? Yes, definitely, it can! Firstly, there already is the POSIX AIO interface -- which however is quite unfriendly to use (one reason is its use of Unix signals for notification of completed IO operations). Secondly, the (Linux) kernel people are working on a better asynchronous IO API (see the syslets/fibrils discussion). Unfortunately it will take a while before that new API will finally be available in upstream kernels. However, there's always the third solution: add an asynchronous API entirely in userspace. This is doable in a clean (and glib-ified) fashion: have a couple of worker threads which (synchronously) execute the various POSIX file system functions and add a nice, asynchronous API that can start and stop these threads, feed them operations to execute, and so on.

So, what's the grand solution I propose for the desktop VFS mess? First, kick Gnome-VFS entirely and don't replace it. Instead write a small D-Bus-accessible daemon that organizes a special directory ~/net/. Populate that directory with subdirectories for all WebDAV, FTP, NFS and SMB shares that can be found on the local network using both Avahi-based browsing and native SMB browsing. Now use the Linux automounting interface on top of that directory and automount the respective share every time someone wants to access it. For shares that are not announced via Avahi/Samba, add some D-Bus API (and a nice UI) for adding arbitrary shares. NFS and CIFS/SMB shares are mounted with the fast, optimized kernel filesystem implementation; WebDAV and FTP on the other hand are accessed via userspace FUSE-based file systems. The latter should also integrate with D-BUS in some way, to query the user nicely for access credentials and suchlike, with gnome-keyring support and everything.

~/net/ itself can -- but probably doesn't need to -- be a FUSE filesystem itself.

A shared library should be made available that will implement a few remaining things, that are not available in the POSIX file system API directly:

Et voilá! Without a lot of new code you get a nice, asynchronous, modern, well integrated file system, that doesn't suck. (or at least, it doesn't suck as much as other solutions).

Also, this way we can escape the "abstraction trap". Let's KDE play the abstraction game, maybe they'll grow up eventually and learn that abstracting abstracted abstraction layers is child's play.

Yeah, sure, this proposed solution also has a few drawbacks, but be it that way. Here's a short incomprehensive list:

I guess I don't have to list all the advantages of this solution, do I?

BTW, pumping massive amounts of data through D-Bus sucks anyway.

And no, I am not going to hack on this. Too busy with other stuff.

The plane is now landing in HAM, that shall conclude our small rant.

Update: No, I didn't get a Caipirinha during my flight. That line I added in before publishing the blog story, which was when I was drinking my Caipirinha. In contrast to other people from the Free Software community I don't own my own private jet yet, with two stewardesses that might fix me a Caipirinha.

posted at: 19:30 | path: /projects | permanent link to this entry | 14 comments


Posted by Peteris Krisjanis at Tue May 1 21:03:23 2007
Hmmmm, what did you meant with mass adaptation? Most of apps I use everyday supports it and it rocks.

Please don't change it to anything again which will require 4-5 years to get it workin. Better fix it.

Posted by A KDE Guy at Tue May 1 21:19:20 2007
Well, maybe does have it right, you know. After all, all KDE apps supported this thing a couple of months after it was implemented, while GNOME apps never got around to it.

Also, IO abstraction is not for network access only.

Posted by Alex Jones at Tue May 1 21:21:29 2007
The POSIX API sucks for a /lot/ of things. Consider even a FAT32 file system, which is ubiquitous in the portable storage sector. The POSIX model of file owner, group, permissions does not work with this.

The new GVFS is the way!

Posted by Lennart at Tue May 1 21:24:32 2007
Alex: I cannot follow your arguments on that. Both POSIX and Gnome-VFS export the UID/GID model, as will gfvs. If the underlying file system doesn't have it - so what? There is not difference between Gnome-VFS on VFAT and POSIX on vfat.

Posted by Christian Kellner at Tue May 1 21:35:43 2007
Did you have a look at gvfs lately? It is totally sweet and some of the stuff you mention there are already done in gvfs. If you want to help out we would be very happy ;-)

Posted by Ross at Tue May 1 21:42:12 2007
I've been using Alex's gvfs:

http://mail.gnome.org/archives/gtk-devel-list/2007-February/msg00062.html

It's pretty nice.  Async API, high level operations, notification and so on.

Posted by TS at Tue May 1 22:55:17 2007
So, because gnome-vfs sucks and almost nobody wants to support and use it you concluded that KDE's KIO is "child's play"? All core KDE apps and almost all 3rd party support it (as a test i used krename on bunch of files on ftp server - worked ok). Why? Because it works and API is easy. KDE devs were able to understand that network does NOT work the same as local disk. Your idea of using FUSE and some GNOME API over it does not change anything -if almost nobody wanted to use posix-like API of gnome-vfs why would he suddenly want to use your new 'nice Glib-ish POSIX file system API wrapper' ?. Your idea of replacing gnome-vfs (i wonder why nobody in KDE camp proposes replacing KIO - maybe because it simply works?) is not first one - for example 'nf2' guy invents grand-unified-crossdesktop-vfs-library every couple of months (dvfs, vio, and probably several other names) and tries to gain some interest on kde-devel mailinglist - people already stopped bothering to even respond.

Posted by Jerry at Wed May 2 03:47:58 2007
I agree with you.  fusesmb (debian/ubuntu package in repositories) is a direct application of this, btw, it's available to all desktop environments and applications since it's not a weird abstraction, and the terminal.

Will the new gvfs have this capability?

Posted by AlexL at Wed May 2 09:02:45 2007
gvfs is mostly what you propose, but it stacks a bit differently. The native gvfs file interface is the a dbus api (therfore inherently both sync and async) which is exposed nicely to apps with an abstracted gobject API. That model is more expressive than POSIX and will allow better semantics and some operations that do not exist in posix.

However, there will be an automatic fuse implementation that exposes all mounted gvfs things as fuse mounts so that apps not using gvfs can still access the files using regular posix calls.

Posted by zdz at Wed May 2 20:56:15 2007
"~/net/" is bad because of one simple reason: i18n. "Net" in english is "Sieć" in Polish. Which folder should be special? See also discussion about ~/Music, ~/Pictures and so on on desktop-devel. Maybe xdg-dirs could be used somehow.

Posted by taj at Mon May 7 11:23:20 2007
"Let's KDE play the abstraction game, maybe they'll grow up eventually..."

Lovely little unmotivated insult there. You briefly touched on the two halves of this problem - a) how is it implemented b) how do you use it. Regardless of what you think of KDE's approach to a), the KIO designers nailed b), while Gnome-VFS's approach has not been borne out by developer adoption.

Move the implementation around as much as you like, until you make it painless for app developers to use (and still get all the features of sync vs async IO, desktop integration (progress bars, authentication popups, caching) etc), they will ignore it.

Posted by andrewc at Fri May 11 14:20:13 2007
All I want as a user is for all my %f-using desktop files to begin working on ssh:// URLs opened in Nautilus, and to be presented as options for "open with". That's all.

A gnome-vfs or gvfs which also exposed a single parallel FUSE mountpoint for all gnome-vfs URLs which have even vaguely POSIX-like semantics would do the trick admirably. Anything Exec'ing a %f based command could then be made to work properly on remote URLs via the FUSE mount.

Posted by Aigars Mahinovs at Sun May 13 09:17:12 2007
Whenever you design such system to replace the Gnome-VFS, pretty, pretty please do not make it as horrible for developers as GnomeVFS is and also make it possible for the application to actually control the "magic".
For example, GnomeVFS supports file access over SSH, but if you do not have the key of the remote host in your keyring, all operations fail. At that point you RTFM to oblivion and after a few days someone tells you a nice secret on IRC - you need to include a header and then the user will "automagically" get a dialog window asking to accept or reject the server's key.
That is all fine and dandy, but what if I run that as root on a system with no logged users???

That is one of the very cute GnomeVFS problems that I run into while developing Simple Backup (SBackup). It almost drove me to just drop GnomeVFS and implement for FUSE-mounting of remote folders right inside my app.

Posted by Jordi Nadal Rodriguez at Fri May 25 19:12:38 2007
Hello,

I've thinked (only thinked about it, I'm not a GNOME programmer) about replacing gnome-vfs and all this crap with FUSE  and dbus (to ask the user for needed data) since I first saw FuseSMB.

All filesystems should be accessible by every application.

Of course, I agree with you very much.

Jordi

Leave a Comment:

Your Name:


Your E-mail (optional):


Comment:


As a protection against comment spam, please type the following number into the field on the right:
Secret Number Image

Please note that this is neither a support forum nor a bug tracker! Support questions or bug reports posted here will be ignored and not responded to!


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored your are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010

Valid XHTML 1.0 Strict!   Valid CSS!