]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: cleanup alloc/free/reset of the block usage tracking
authorChristoph Hellwig <hch@infradead.org>
Wed, 2 Sep 2009 17:55:42 +0000 (17:55 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 23 Oct 2009 17:12:41 +0000 (12:12 -0500)
commitaf20fe69165137e01ba123097ef78a1c3863bd81
tree7e411cf7b3264ffd4a664a7178a85e3182437bb9
parentadd8f6632f1797962939043223daa99071b1d933
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>
Signed-off-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