Jamie Lokier wrote:
>  - The contents of the real file (if there is one) and its virtual
>    derivative aren't synchronised.  E.g. if you look inside a tar file
>    or the decompressed version of a .gz file, then changing either the
>    virtual or real files should affect the other.

Agreed. Userspace avfs does this. Kernel avfs is read-only at the
moment.

>  - This is only a few small steps to making cd-into-archive work. :-)
> 
>    Many of the remaining checks for S_ISDIR in the generic VFS code
>    should go -- they're not consistent with other parts of the VFS
>    which checks f_ops anyway.

I don't think that making a directory from a file is necessarily a
good idea: 

 - Some programs will probably break by this (i.e. will not let you cd
   into a non-directory

 - You cannot distinguish virtual and non-virtual files in this way
   (e.g. how do you represent the gunzipped version of xyz.gz?)

The approach taken by most virtual file implementations is to make a
separate name for the virtual file/directory:

tarfile.tgz - is a file
tarfile.tgz@ - is a directory (place your favorite magic char instead of @)

In the directory listing only the first appears, but most tools do not
depend on the directory to be existent (notable exception was the old
userspace getcwd implementation which is gone since kernel version 2.2
and glibc-2.0).

Miklos

Reply via email to