DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cache_lookup() work this week.


From: Chris Pressey <cpressey@xxxxxxxxxxxxxxx>
Date: Thu, 4 Sep 2003 08:57:51 -0700

On Wed, 3 Sep 2003 23:55:01 -0700 (PDT)
Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:

>     It's very easy to find loops.  All the program has to do is
>     record the (rdev,inode#) for each directory element in the path
>     as it recurses.  Only the (rdev,inode#) for the elements
>     representing the current path need to be remembered so the memory
>     use is small. e.g.:
> 
>     a[1,23]/b[1,55]/c[1,78]/d[1,55]
> 
>     In this case d[1,55] is a hardlink to b.  find, rm, whatever would
>     see that the identifying information [1,55] is the same as for b
>     which is still in its path and not recurse through it.
> 
>     It is an easy trick to implement.

Yes.  But the problem is that there are umpteen dozen dozen programs
which take an -R flag or otherwise traverse directory trees, which would
have to be patched.  It would be a big job, no matter how simple the
change is, so I think it would be better to address it somewhere in the
OS itself.

Just because you can do something doesn't mean you necessarily should...
what's the value of hardlinking a directory to one of its parent
directories?  Where would this be useful?

-Chris



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]