]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: track logical to physical block mapping more effeciently
authorBarry Naujok <bnaujok@sgi.com>
Thu, 12 Nov 2009 10:27:28 +0000 (11:27 +0100)
committerhch@lst.de <Christoph Hellwig>
Thu, 12 Nov 2009 10:27:28 +0000 (11:27 +0100)
commit610f3285d096ba6fc7339a8cb70cd3fb76144d31
tree30dd20d26737a6971b9364a94cb30e4c910b051c
parent4c0a98ae87ff8416ec35e6dece22e6a92af60bf7
repair: track logical to physical block mapping more effeciently

Currently we track the logical to physical block mapping by a structure which
contains an array of physicial blocks.  This is extremly inefficient and is
replaced with the normal startblock, length extent descriptors.

In addition also use thread-local storage for the block map, this is possible
because repair only processes one inode at a given time per thread, and the
block map does not have to outlive the processing of a single inode.

The combination of those factors means we can use pthread thread-local
storage to store the block map, and we can re-use the allocation over
and over again.

This should be ported over to xfs_db eventually, or even better we could try
to share the code.

[hch: added a small fix in blkmap_set_ext to not call memmove unless needed]

Signed-off-by: Barry Naujok <bnaujok@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
repair/bmap.c
repair/bmap.h
repair/dinode.c
repair/init.c