Re: Question about hard links...

Alexander Viro (viro@math.psu.edu)
Sat, 14 Aug 1999 09:03:00 -0400 (EDT)


On Thu, 12 Aug 1999, Micahel Zappe wrote:

> I am working on a file system driver for linux, and have run into a
> problem with hard links. I am attempting to put per-directory quota
> support into the filesystem, rather than per-volume, and hard links

It doesn't make sense. Directory doesn't contain files. It refers to them.

> across quota-spaces causes some tricky semantic issues. My favored
> solutions are 1) eliminate hard links from the fs, or 2) cause link() to
Bravo. If you want braindead filesystem - go for that.
> create a symbolic link instead, emulating it's predicted behavior. Does
It *doesn't* emulate the predicted behaviour. Learn what hardlinks
are. Symlinks do not follow the file when it is renamed. Symlinks break
when the file is removed. Sigh... UNIX 101 time again. Files are nameless.
They don't belong to any directory. They may have *no* links (if they are
unlinked but still not closed somebody). Directories are lists of named
references to files. Such a reference is *not* a file - file can be
refered from many places or from none (see above). Symlink is a *file*. As
any file it can be refered from a lot of places. It doesn't point anywhere
- it just contains a string and is marked in a way that makes many
operations treat it in a special way if it is met in process of lookup. It
has no connection with any other object in filesystem (just as regular
files have none). Again, directories don't work as containers - they are
lists of references. Hell, nobody mistakes the library catalog for bookshelf.
Why does it become so hard with filesystems?

-
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/