Re: ext2fs enhacement/fix [re: shrinking directories]

Chris Wedgwood (chris@cybernet.co.nz)
Thu, 16 Jul 1998 20:56:02 +1200


On Thu, Jul 16, 1998 at 01:20:19AM -0600, Larry McVoy wrote:

> : Have unlink check to see if the current size >= 2* required size and
> : shrink on that?
>
> I like this idea a lot.
>
> It has the nice attribute that the process causing the problem is the one
> that gets slowed down.
>
> It will slow down unlinks, but I would think that is OK for this sort of
> thing.

Only for some unlinks. Assuming 4k block and a news server where filenames
are about 5 chars long, we can get 200 or do files per block, so if we have
to remove all files from a directory that once contained 40,000 files, the
shrink operation only happens 8 times or so.

(Umm... ceiling(log_2 (40,000 / 200) ) right?)

-cw

-
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.altern.org/andrebalsa/doc/lkml-faq.html