Re: Ever growing directories [Re: WEIRD ext2fs dir size BUG?]

Anthony DeBoer (adb@onramp.ca)
9 Mar 1998 20:13:17 -0000


Janos Farkas <janos.farkas-nouce/priv-#kxid.mt7hkj7qbhxrtnf7lufxvw@lk9qw.mail.eon.ml.org> writes:
> On 1998-03-02 at 16:34:07, Anthony DeBoer wrote:
> > In the general case, if the number of files in a directory has
> > previously hit some high-water mark, there's a chance it'll happen
> > again, and having that much contiguous space allocated to the
> > directory should be a win.
>
> I too know how to fix things up after such an accident, but even if not
> wrong, it's clearly disadvantageous for the kernel to not fix what it
> knows must be fixed.

In the general reasonable case, if you have eg. 50 entries in a directory
file that could hold 100 or maybe 150 such entries, then you might want
to keep the directory file that large to handle future traffic.
Truncating it and then adding noncontiguous blocks later is a performance
hit; searching a directory that occupies contiguous blocks is a win. The
pathological case is when you find 50 entries in a directory file that
could hold 10000; obviously you want to free up quite a few blocks there.

-- 
Anthony DeBoer <adb@onramp.ca>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu