Messages in this thread | | | Date | Wed, 23 Jun 1999 22:33:17 -0400 (EDT) | From | "Albert D. Cahalan" <> | Subject | Re: 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/
| |