From: Darrick J. Wong Date: Tue, 27 Feb 2018 04:43:18 +0000 (-0600) Subject: xfs: cross-reference the realtime bitmap X-Git-Tag: v4.16.0-rc1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=221b1ddc29415a673750665696f95990c53d8d2e;p=thirdparty%2Fxfsprogs-dev.git xfs: cross-reference the realtime bitmap Source kernel commit: 46d9bfb5e706493777b9dfed666cd8967f69e6fd While we're scrubbing various btrees, cross-reference the records with the other metadata. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c index 9970c4814..cf04ccac4 100644 --- a/libxfs/xfs_rtbitmap.c +++ b/libxfs/xfs_rtbitmap.c @@ -1092,3 +1092,24 @@ xfs_verify_rtbno( { return rtbno < mp->m_sb.sb_rblocks; } + +/* Is the given extent all free? */ +int +xfs_rtalloc_extent_is_free( + struct xfs_mount *mp, + struct xfs_trans *tp, + xfs_rtblock_t start, + xfs_extlen_t len, + bool *is_free) +{ + xfs_rtblock_t end; + int matches; + int error; + + error = xfs_rtcheck_range(mp, tp, start, len, 1, &end, &matches); + if (error) + return error; + + *is_free = matches; + return 0; +}