lkml.org 
[lkml]   [1999]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: why is the size of a directory always 1024b ?


On Wed, 23 Jun 1999, Albert D. Cahalan wrote:

> David S. Miller writes:
> > From: MURALI N <murali.n@tatainfotech.com>
>
> >> I want to know if there is any significant reason why the
> >> size of each directory ( ext2fs) is reported as 1024b ( or a
> >> multiple of 1024).
> >
> > Because this is the "block size" of the filesystem, the directory
> > space is allocated in units of this.
>
> One could say the same for regular files, so this doen't really
> explain why directory sizes are poorly reported.

Albert, look at the ext2/ufs/ffs directory layout. You'll see the reason.
Blocks *are* filled. Completely. Fresh directory (after mkdir) looks so:
<inumber><size of 1st record><length of name (1)><name (".")><slack>
<inumber><size of 2nd record><length of name (2)><name ("..")><slack>
<inumber (0, i.e. free><size of the 3rd record><slack>
Each block is filled with records. Some records are marked free. Records
may have a slack in the end. That's it. There is no meaningful sub-block
boundary.


-
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.249 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site