Should hard links to directories work?

Nick Garnett nickg@ecoscentric.com
Wed May 20 16:35:00 GMT 2009


Rutger Hofman <rutger@cs.vu.nl> writes:

> sandeep wrote:
> > Hi Ross,
> > Younger ;) people often have interesting questions and are
> > responsible for fresh insights.
> >
> >> The Unix world traditionally shuns such things as an abomination.
> >> The eCos docs are quiet on the subject, as is the code in
> >> ramfs and jffs2.
> >> Should they work? Does anybody use them?
> > Before we discuss it further, where/how do you think you will use
> > directory hardlinking, if it were available for normal user?
> 
> FWIW, the Amoeba distributed OS had hard links to directories. It had
> no soft links at all. It introduces loops in the directory 'hierarchy'
> (because of the loops, there is no hierarchy any more), so
> e.g. find(1) had to be armed with loop detection.

Although, as a capability based operating system, hard links, in the
form of saved capabilities, were an essential feature of Amoeba to
confer and control access within the filesystem.

The main capability operating system I used (Chaos on the Cambridge
CAP machine) also implemented a directed graph filesystem. This
required a garbage collector to be run on it regularly to clean up
detached cycles. This is also why directory hard links are generally
not permitted, since detached cycles are hard to remove.

In eCos, support for hard directory links should generally be a
filesystem property. If a particular filesystem can deal with the
consequences the they should be passed through the other layers
without comment. For YAFFS, I suspect that they should not be
permitted.

-- 
Nick Garnett                                       eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com       The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales:                         Reg No: 4422071



More information about the Ecos-devel mailing list