]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: cleanup alloc/free/reset of the block usage tracking
authorBarry Naujok <bnaujok@sgi.com>
Thu, 12 Nov 2009 10:28:25 +0000 (11:28 +0100)
committerhch@lst.de <Christoph Hellwig>
Thu, 12 Nov 2009 10:28:25 +0000 (11:28 +0100)
commitc1f7a46c4d6403e3313c13487e2f2174f92db670
tree98c911db6e5065b7ced9a2cc355b22c55a8fe1cf
parent95650c4de8f7aed0f542aa7f5552e5ace1f2c45c
repair: cleanup alloc/free/reset of the block usage tracking

Currently the code to allocate, free and reset the block usage bitmaps
is a complete mess.  This patch reorganizes it into logical helpers.

Details:

 - the current incore_init code is called just before phase2 is called,
   which then marks the log and the AG headers used.
 - we get rid of incore_init init, and replace it with direct calls to the
   unchanched incore_ino_init/incore_ext_init functions and our new init_bmaps
   which does all the allocations for the block usage tracking, aswell
   as a call to reset_bmaps to initialize it to the default values.
 - reset_bmaps is also called from early phase4 code to reset all state
   instead of opencoding it.
 - there is a new free_bmaps helper which we call to free our block usage
   bitmaps when we don't need them anymore after phase5.  The current
   code frees some of it a bit early in phase5, but needs to take of it
   in phase6 in case we didn't call phase5 due to nomodify mode, and leaks
   it if we don't call phase 6, which might happen in case of a bad inode
   allocation btree.

Signed-off-by: Barry Naujok <bnaujok@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
repair/incore.c
repair/incore.h
repair/phase2.c
repair/phase4.c
repair/phase5.c
repair/phase6.c
repair/xfs_repair.c