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>