I don't have code, but let me remind you of this post:
http://marc.theaimsgroup.com/?l=ext2-devel&m=102132142032096&w=2
A sketch of the coalescing design is at the end. I'll formalize that.
One issue Stephen touched on that I hadn't settled at the time, is how
to handle deleted blocks. My inclination is to copy the last block of
the directory into the vacated block as opposed to leaving a hole in
the file. The slight extra cost doesn't seem to be worth worrying
about, and it's guaranteed to leave the directory in a compact state
when emptied.
The two competing approaches are the hole-punch idea - which I didn't
consider before - and keeping a list of free blocks somehow. I think
it's best to err on the side of simplicity this time: the copy-down-last
strategy eliminates the need to search for a free block when the
directory needs to be expanded again,
-- Daniel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/