> On Mon, 15 Oct 2001 at 17:36, Sarwer Zafiruddin wrote:
> > I appologize for the slightly OT nature of the e-mail. But I figure
> > this is a good place to ask, since there is alot of filesystems
> > experts in this list.
>
> And I think I can help make this more on-topic by asking:
>
> > hotdog_$ ls -ld gas_mech_assy
> > drwxrwxrwt 5 sarwer dba 10493952 Oct 15 17:26 loaded_pkgs
> > ^^^^^^^^
> > What is makes this number get bigger?
>
> Why does the size of this number vary not only with the directory, but
> with the filesystem as well?
>
> In particular on XFS, what dictates the size of a directory? It doesn't
> seem to be directly correlated with the total size of the contents. I did
> some tests and it looks like it has something to do with the length of the
> filenames in it, and perhaps the name of the directory itself. Is this it?
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.
Other filesystems do this differently.
Steve
>
> --> Jijo
>
> --
> Federico Sevilla III :: jijo@xxxxxxxxxxxxxxxxxxxx
> Network Administrator :: The Leather Collection, Inc.
> GnuPG Key: <http://jijo.leathercollection.ph/jijo.gpg>
>
>
|