lkml.org 
[lkml]   [1998]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.072 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site