tech-kern archive

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

Re: Max. number of subdirectories dump



On Mon, Aug 19, 2013 at 09:01:35AM +0200, Johnny Billquist wrote:
 > >careful, you want struct direct, not struct dirent:
 > 
 > Hmm. Probably a good point. I was wondering if NetBSD had just
 > renamed direct to dirent, but that was just me getting confused
 > then. (And lazy, since I didn't really search around, which I
 > should have, but the rest matched so well. :-) )

It dates back almost to when the vfs interface was added... there was
some confusion and then ultimately POSIX standardized <dirent.h> as
the fs-independent interface. But fs-independent is relative and even
now there's still a good bit of crosscoupling that shouldn't exist.

At some point struct direct is going to get itself renamed struct
ufs_direct. And I suspect when I do this it will smoke out at least
one place using it (or more likely, things associated with it)
improperly. The constants that FFS stores in d_type, for example, just
happen to match the values of those that are found in <dirent.h> for
use in struct dirent's d_type.

Not that long ago there were some problems caused by using some of the
dirent manipulation macros from <dirent.h> on struct direct...

 > I was reading the manpage on dirent for NetBSD 3 previously, and it
 > looked like that as well. Obviously, for this, FFS_MAXNAMLEN must
 > be 255 or less...

struct dirent got changed after -3 to support longer names. And that
change got partially stuffed up and didn't work right; it only got
fixed properly later, I forget exactly when. Every fs now has and
enforces its own MAXNAMLEN. And yes, FFS_MAXNAMLEN is 255.

I think only tmpfs actually supports longer names.

 > >Speed. There's a moderately famous paper "A trace-driven analysis of
 > >the UNIX 4.2 BSD file system" -- you might have heard of it :-)
 > 
 > Actually I haven't. I should look it up. Thanks.

Yeah, that one's worth a read. It's not that easy to find copies of it
though as it's from 1985... I don't think I have one except in
hardcopy.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index