[Top] [All Lists]

Re: Directory File Size [Slightly OT]

To: Linux XFS Mailing List <linux-xfs@xxxxxxxxxxx>
Subject: Re: Directory File Size [Slightly OT]
From: Federico Sevilla III <jijo@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Oct 2001 07:38:18 +0800 (PHT)
In-reply-to: <200110152230.f9FMUvA31431@jen.americas.sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Mon, 15 Oct 2001 at 17:30, Steve Lord wrote:
> A directory entry contains the name of the file, and the inode number
> - which is 8 bytes on XFS. A small XFS directory lives within the
> inode, and the size you see is the amount of space in the inode being
> used by these entries plus some space management data structures. Once
> the directory does not fit in the inode it grows to one filesystem
> block - or 4Kbytes, it will sit at this size until it no longer fits
> into one block, at which point we turn the directory into a btree of
> blocks - the leaf blocks contain the entries and the node blocks
> contain the index pointers to the entries. The smallest btree is 3
> blocks, so the next size you would see is 12K.
> After this it will go up a block at a time as it grows. If you remove
> stuff from the directory it will shrink again - all the way back into
> the inode.

Wow. Nice comprehensive answer, and one that I believe can be understood
by most would-be (and current) XFS system administrators as well. Seth,
maybe this can be added to the FAQ? Do you think it's worth putting there?
I expect that a number of people wonder what makes up a directory's size
(ie: is the the total size of all contents?), and this answer by Steve is
(as expected) great. :)

 --> Jijo

Federico Sevilla III  :: jijo@xxxxxxxxxxxxxxxxxxxx
Network Administrator :: The Leather Collection, Inc.
GnuPG Key: <http://jijo.leathercollection.ph/jijo.gpg>

<Prev in Thread] Current Thread [Next in Thread>