Messages in this thread | | | Date | Sun, 1 Mar 1998 02:34:02 +0100 (CET) | From | MOLNAR Ingo <> | Subject | Re: Big files in ext2fs (but not i_osync) |
| |
On Sat, 28 Feb 1998, Linus Torvalds wrote:
> > For that matter, we could decide that Really Big Files should not have > > any direct pointers, only indirects. That would actually be an > > optimization that would more than make up for stealing one direct > > pointer for extra size bits. > > Trust me, you don't want to do this. This results in horrible stuff when > the file grows past the cut-off point, where you'd have to start shuffling > the indirect pointers on disk around or something equally disgusting.
what about the following trick to avoid shuffling: direct, double and triple pointers have their old meaning with size<2G. Once the size is over the cut-off point, we 'steal' the _first_ direct pointer, and make it a four-ways pointer instead. The original first pointer is put into the four-ways block's _last_ table element. This way we'd only have to special-case block==0, the rest would be just like before, but with four-ways indirection for offsets above the cut-off.
in truncate() we have to put back the last element of the four-ways block if the size drops below the cut-off point. (we have the inode at that point anyway, no additional cost).
And it can even be safely ro-mounted by older kernels if that matters (and rw-mounted if the old kernel does not change the first block of such big files).
zero additional disk activity and no extra fields used up.
-- mingo
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |