]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: use range query when while checking rmaps
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Oct 2016 22:14:35 +0000 (15:14 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 26 Oct 2016 23:41:08 +0000 (16:41 -0700)
commit7ba02033425eb9c115600974789cb65c5295742f
tree6f22e8b297e2aa33c7e44fbbd1557d9601952d07
parent42627ba6ba6d8925c3b9e554301fb69d3e379e34
xfs_repair: use range query when while checking rmaps

For shared extents, we ought to use a range query on the rmapbt to
find the corresponding rmap.  However, most of the time the observed
rmap will be an exact match for the rmapbt rmap, in which case we
could have used the (much faster) regular lookup.  Therefore, try the
regular lookup first and resort to the range lookup if that doesn't
get us what we want.  This can cut the run time of the rmap check of
xfs_repair in half.

Theoretically, the only reason why an observed rmap wouldn't be an
exact match for an rmapbt rmap is because we modified some file on
account of a metadata error.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
libxfs/libxfs_api_defs.h
repair/rmap.c