lkml.org 
[lkml]   [1999]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: why is the size of a directory always 1024b ?
Date
From
In message <Pine.LNX.4.05.9906260851050.2923-100000@mhw.ULib.IUPUI.Edu>, "Mark 
H. Wood" writes:
+-----
| On Wed, 23 Jun 1999, Riley Williams wrote:
| [snippage]
| > I can understand the viewpoint that says the "size" of a directory is
| > simply a count of the number of valid entries therein, but I don't
| > agree with it.
|
| What I think the original poster objects to is that this makes directory
| files different from nondirectory files, without giving a good reason.
+--->8

Oh, futz. There's a very good reason, which has already been stated: the
same reason that "ls -l" of a database-type file (whether from Berkeley DB or
Oracle) doesn't return the number of bytes occupied by active records.

Reorganizing a database-like file (and directories are in effect simple
databases) on the fly is fraught with race conditions and performance
issues. So when you delete a "record" you leave the space there, allocated
but unused. If a later new record will fit in the space, you reuse it. This
is true of directories; it's true of gdbm; it's true of Berkeley DB; it's
true of Oracle and Informix. And not just on Linux.

Can we lay this silly thread to rest now?

--
brandon s. allbery [os/2][linux][solaris][japh] allbery@kf8nh.apk.net
system administrator [WAY too many hats] allbery@ece.cmu.edu
carnegie mellon / electrical and computer engineering KF8NH
We are Linux. Resistance is an indication that you missed the point.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.067 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site