Messages in this thread | | | Date | Mon, 23 Jan 2006 05:31:40 -0800 | From | Mitchell Blank Jr <> | Subject | Re: soft update vs journaling? |
| |
Theodore Ts'o wrote: > in general, most filesystems don't have an efficient way to > answer the question, "who owns this arbitrary disk block?" [...] > Given that this is generally not a common operation, it seems unlikely > that a filesystem designer would choose to make this particular > tradeoff.
True -- a much more rational approach would be to provide a translation table for "old block #" to "new block #" -- then when the filesystem sees a reference to an invalid blocknumber (>= the filesystem size) it can just translate it to its new location.
You have to be careful if the filesystem is regrown since some of those block numbers may now be valid again. It can easily be handled by just moving the data back to its original block # and removing the mapping.
This doesn't completely remove the extra cost on the block allocator fastpath: if an block is freed it must make sure to remove any entry pointing to it from the translation table or you can't handle regrowth properly (the block could have been reused by a file pointing to the real block # -- you won't know whether to move it back or not). However, this is probably a lot cheaper than maintaining a full reverse-map, plus you only have to take it after a shrink has actually happened.
-Mitch - 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/
| |