From owner-freebsd-fs Fri May 3 19:59: 2 2002 Delivered-To: freebsd-fs@freebsd.org Received: from smtp02.mrf.mail.rcn.net (smtp02.mrf.mail.rcn.net [207.172.4.61]) by hub.freebsd.org (Postfix) with ESMTP id A188437B400 for ; Fri, 3 May 2002 19:58:49 -0700 (PDT) Received: from 66-44-0-84.s84.apx1.lnh.md.dialup.rcn.com ([66.44.0.84] helo=localhost.) by smtp02.mrf.mail.rcn.net with smtp (Exim 3.33 #10) id 173pl1-0003Vt-00; Fri, 03 May 2002 22:58:48 -0400 References: <200205032031.QAA24496@repulse.cnchost.com> In-Reply-To: <200205032031.QAA24496@repulse.cnchost.com> Date: Fri, 3 May 2002 22:41:26 EDT From: Eric Jacobs To: fs@freebsd.org, Bakul Shah Subject: Re: Filesystem Organization: X-Mailer: Post Office 0.7.2 build 20010211(by eric@localhost 2001/02/11 21:52:30) Message-ID: X-Mailer: PostOffice 0.7 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Bakul Shah wrote: > Terry Lambert writes: > > > I believe this limit is common to all UNIX systems that use hard links > > to do ".." processing. Technically, it should be possible to do this > > with affecting link count. However, it's really easy > > to open a directory and determine if there ar substirectories by > > examining the link count on it, and to know how many there are by > > examining the link count on it. > > > Plan9 does ".." right. The same can be done in Unix by > storing the rooted path in the kernel for a process'es > current working dir. and by following some path rewrite > rules: > > //.. == > //../ == / > /../ == / Those rules aren't valid on the account of syntax alone. You would have to know which components are symbolic links. And once you take into account symbolic links, you have essentially what namei does anyway. I think what Terry Lambert was saying was that since hard-linking directories isn't allowed anyway, there's no need to refcount them, except for the subdirectory counting tricks. > You would also have to deal with middle directories being > renamed, filesystems being forcibly unmounted and so on. > > Not storing the entire path for cwd may have been the right > decision for '70s but not since then.... The entire path is stored indirectly via the VFS name cache, so getcwd() works _even_ for filesystems which do not implement "..". Implementing ".." at the VFS level would be just as simple. Probably the only reason it isn't is because it has been traditionally handled at the FS level. > > In any case, it's still an incredibly bad idea to have even a tenth of > > that man objects in a single directory, period. > > IMHO it is a bad idea to not have evolved directories to use a B-tree > representation (at least when the number of entries exceed some > threshold. Implement mechanisms and leave policies to the users! If you can handle access considerations yourself, one creative solution might be to use getfh(2) and fhopen(2) and store the file handles however way you want. This bypasses the kernel lookup entirely. -- P To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message