Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Nov 2005 21:12:05 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Doug White <dwhite@FreeBSD.org>, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Doug White <dwhite@gumbysoft.com>, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern vfs_subr.c src/sys/fs/devfs devfs_vnops.c
Message-ID:  <20051110202946.Q2041@epsplex.bde.org>
In-Reply-To: <3776.1131609828@critter.freebsd.dk>
References:  <3776.1131609828@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Nov 2005, Poul-Henning Kamp wrote:

> In message <20051110184723.X71304@delplex.bde.org>, Bruce Evans writes:
>> On Thu, 10 Nov 2005, Poul-Henning Kamp wrote:
>>
>>> I don't think I've seen any other proposals than to put it in
>>> dirent where it rightfully belongs.
>>>
>>> The reason it is not in dirent is that UFS/FFS uses dirent as the
>>> layout in directories as a microoptimization.
>>
>> I think the reason is exactly the opposite.
>
> Care to elaborate ?

I think ffs is older than the current `struct dirent', and the latter
was copied from ffs's `struct direct', not vice versa.  This is true
according to history in man pages and sources, but the history is very
incomplete (see dir(5) (there is still no proper dirent(any), only a
link to dir(5)), getdirentries(2), fs(5), ffs(7), <sys/dirent.h>,
<sys/dir.h> and <ufs/ffs/dir.h>).

Even if ffs is newer, it wouldn't be an optimization or otherwise useful
to copy a userland directory format for the disk directory format.

It's a micro-optimization for ffs to copy raw directory entries to
userland.  This is possible because the userland format is the same
as the raw format.

The userland format can't be changed easiy since just changing it would
break compatibility.  Compatibility is apparently especially important
for dirents since we still have <sys/dir.h> which was deprecated 15
years ago :-).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051110202946.Q2041>