Re: ext2fs: do directories ever shrink?

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Sat, 11 Jul 1998 13:49:17 +0200 (CEST)


On Sat, 11 Jul 1998, Farzad FARID wrote:
> On Fri, 10 Jul 1998, Rik van Riel wrote:
>
> > Ext2 directories never shrink. This is mainly because of
> > race conditions and coding difficulty.
>
> I have an program that sometimes manipulates directories containing
> thousands of files, sometimes 40000. The directory size sometimes reached
> 1.6 Mb...
> getdents() is a hundred times slower than for a fresh directory!
> So globally my apps run slower even though I emptied all the directories,
> and if I want to attain top speed again I have to rmdir/mkdir the
> directories again. Is this a permanent limitation is ext2? Is there a way
> to fix it?

Well, there are two ways, the easy way and the hard way.
Starting with the hard way, you could fix ext2fs, but
as I understood it from the ext2fs folks, this is very
hard so you might want to change your apps instead ;(

The situation will become a _lot_ better once the ext2fs
btree support is integrated (2.3) though...

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

-
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