Re: XFS shrink functionality

David Chinner
2007-06-08T14:45:19Z

On Fri, Jun 08, 2007 at 10:23:53AM +0200, Ruben Porras wrote:
> Am Montag, den 04.06.2007, 10:41 +0200 schrieb Iustin Pop:
> > Good to know. If there is at least more documentation about the
> > internals, I could try to find some time to work on this again.
>
> there is now a document explaining the XFS on disk format [0] and some
> presentations for training courses, I think none of this were available
> at the time you made the first try. Although they are not enough for our
> purpose.

There's thousands of lines of code documenting that format as well ;)

> > My suggestion would be to start implementing these steps in reverse. 4)
> > is the most important as it touches the entire FS. If 4) is working
> > correctly, then 1) would be simpler (I think)
>
> Why do you think that 1) would be simpler after 4)? For what I
> understand, they are independent.
>
> 3) worries me, if walking the entire filesystem is needed, it want
> scale...

I think walking the filesystem can be avoided effectively by
introducing an reverse map that points to the owner of the block.
(i.e. another btree). Reverse mapping provides other benefits as
well e.g. somewhere to put block checksums and more information
for repair and scrubbing.

The hard part is the moving of metadata. I haven't really though
deeply on the best method for this; there's lots of options and I
don't know what is the best way to proceed there yet. That's not
something I need to think about right now, though ;)

Cheers,

Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group