Re: [reiserfs-dev] Re: [PATCH] sparc32: wrong type of nlink_t

From: Ragnar Kjørstad (kernel@ragnark.vestdata.no)
Date: Thu Sep 05 2002 - 21:29:21 EST


On Thu, Sep 05, 2002 at 06:41:22PM -0700, jw schultz wrote:
> > > So a value of 0 would have the same effect.
> > > (0 - 2 == -2 vs 1 - 2 == -1) Yes?
> >
> > Yes, it will. For GNU find.
> >
> > But the reasoning for using nlink==1 is that that's how "all non-unix
> > filesystems" behaved, so applications out there could potentially check
> > for it.
>
> But we aren't talking about filesystems with different ideas
> about directory linking. We are talking about directories
> with an overflowed link-count.

No, but from an application's point of view they're the same. They're
both directories unable to report the number of subdirectories they
have. So, they should be handled the same. Either with nlink==1, or
nlink==0, but I think it will be difficult to migrate to the later if a
lot of existing software implement the first one.

> The value of 1 can't be used for regular files because it
> would mean the file doesn't need checking for other links.
> Coding for NLINK_MAX would mean the apps would have to
> adjust every time NLINK_MAX changed. Yes, it could be done
> through #define in stat.h. It is a corner case right now
> but these apps could know that
>
> 1 == no other links
> >1 == known number of other links
> 0 == unknown number of other links

I agree.

-- 
Ragnar Kjørstad
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 07 2002 - 22:00:28 EST