Re: seekable pipes

Bryan Henderson <[email protected]> Tue, 7 Jun 2005 13:31:21 -0700
Newsgroups gmane.linux.file-systems,gmane.linux.userfs
Message-ID <OF7DD98862.453DE13D-ON88257019.006BE09E-88257019.0070AEF2@us.ibm.com>
I like it.  I like it a lot.

But I'd expect it to do all of the open file operations, not just seek. (A 
seek-only implementation is certainly acceptable, but the structure should 
be for the whole concept).

So it's a light userspace filesystem -- leaving the directories, creating 
and deleting filesystem objects, opening files, and namespace issues to 
another filesystem.  And no buffer cache or page cache involvement.

The idea of doing seeks by using lseek() on both sides seems unnatural to 
me.  A file doesn't magically change its position.  I'd just use ioctls on 
the master side.

This won't work for many of the things you'd like it to because many 
application programs are too smart for their own good.  The proper way to 
determine whether a file is seekable is to try a seek and see what 
happens.  But many of them stat the file and check its type.  We might 
want something really ugly like an ioctl that sets the stat type.

BTW, what you're calling AVFS is I believe what is now known as FUSE and 
has been discussed a lot recently.  Fortunately, most of the difficult 
problems discussed in re FUSE wouldn't apply to these user space files. 
One of them might, if you could set the filesystem object type to regular 
file:  There are programs that look at arbitrary files on the system and 
expect certain things of the file access that could not be guaranteed if a 
user space program were on the other side.  For example, the program might 
expect the access to complete in a reasonable amount of time.


I think many people aren't familiar with Bash process substitution, so 
allow me:

The shell command

  cat <(ls)

creates a process that runs 'ls',  It creates a fifo and opens the write 
side as ls' Standard Output.  It passes e.g. "/proc/self/fd/63" as the 
argument to 'cat', where file descriptor 63 is the fifo that the shell 
created.  Ergo, 'cat' opens and reads the fifo and consequently writes a 
file listing to Standard Output.

This example does not, of course, demonstrate any utility.  But

  diff <(cd old; ls) <(cd new; ls)

does.

--
Bryan Henderson                     IBM Almaden Research Center
San Jose CA                         Filesystems 
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html