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

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Sat, 18 Jul 1998 12:43:54 +0200


>
> >> How about a simple utility, added to the ext2 utilities, that compacts
> >> directories that can be run periodically as the user wishes. By the way
>
>
> > This is of course possible but it's very hard (if not almost impossible)
> >to do it when filesystem is mounted...
>
> I doubt this, the directory is after all just a special file. The program
> could check to time stamp before updating and give it three tries.
I'm not sure if I can follow your thoughts. You mean the program would
make a separate "packed" copy of dir and then replace the old dir?

>
> >> don't these ghost entries hamper performance, albeit possibly by a
> >> negligible amount. I would think that these ghost entries get processed
> >> along with the other entries whenever the directory is accessed. And if
> >> this utility is made other file system optimization options can be thrown
> >> in. Perhaps the directory entries can be sorted by their last access
> date
> >> as the directory is compacted so as to improve file access performance.
> > But keeping the directory sorted will cost you probably more than you
> gain.
> >And you have completely forgotten the dchache. So the used files will be
> >in it and so they won't be looked up on the disk..
> >
>
> I said run the utility "periodically", this doesn't mean all the time.
> Perhaps once a week along with a fsck.
With fsck probably not ;) (The fs would have to be unmounted). I don't
think it will speed up things considerably but maybe...

Cheers Honza

PS: I think the best will be to wait for btrees in ext3...

-
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