Re: FS Unions

Kai Henningsen (kaih@khms.westfalen.de)
14 Jun 1999 22:33:00 +0200


viro@math.psu.edu (Alexander Viro) wrote on 14.06.99 in <Pine.GSO.4.10.9906140932160.22023-100000@weyl.math.psu.edu>:

> * when you are looking up a directory entry for 'foo':
> * it is looked up in the overlapping filesystem first. If
> it is found - fine, we got it.
> * otherwise, look for whiteout entry with that name (also
> in overlapping fs). If found - return -ENOENT (file
> doesn't exist).
> * otherwise (neither normal nor whiteout entries are there)
> look into the underlying layer.
> * Not found there - return -ENOENT.
> * Found and is *not* a directory - got it.
> * Found and is a directory - create an empty directory
> with the same name in overlapping fs.
> * to create a directory entry:
> * look for whiteout entry with that name (in overlapping
> fs). If not found - just go ahead and act as for normal
> filesystem. If we are creating a directory mark it
> non-transparent (see below).
> * if found and we are creating *not* a directory - remove
> whiteout and act as for normal fs.
> * if found and we are creating a directory - remove
> whiteout, create a directory *and* mark it as
> non-transparent. That is, in that directory and all its
> subdirectories we are acting as for the usual mount - no
> lookups into the underlying level.
> * to remove a directory entry:
> * if there is an entry with that name in overlapping fs
> and nothing under it - simply remove.
> * if there are entries both in overlapping and underlying
> layers - replace the overlapping one with whiteout.
> * if there is no entry in overlapping layer - create a
> whiteout.
> All modifications go into the overlapping fs. All you need from it is a
> way to represent whiteouts (normally done as entries with reserved
> inumber value).

Sounds like you get into real trouble with renames, especially directory
renames.

MfG Kai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/