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 ?
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.

We do have linear directories that grow from beginning to end.
An empty directory is something like 16 bytes for "." and "..".
The kernel might as well report the fact, just as it reports a
regular file by actual content.

If inaccurate reporting really is OK, then it might as well be
derived from the block count. That gives an extra 4 bytes in the
inode for directories.

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