@@ -1011,3 +1011,32 @@ xfs_rtfree_extent(
}
return 0;
}
+
+/* Is the given extent all free? */
+int
+xfs_rtbitmap_extent_is_free(
+ struct xfs_mount *mp,
+ xfs_rtblock_t start,
+ xfs_rtblock_t len,
+ bool *is_free)
+{
+ xfs_rtblock_t end;
+ xfs_extlen_t clen;
+ int matches;
+ int error;
+
+ *is_free = false;
+ while (len) {
+ clen = len > ~0U ? ~0U : len;
+ error = xfs_rtcheck_range(mp, NULL, start, clen, 1, &end,
+ &matches);
+ if (error || !matches || end < start + clen)
+ return error;
+
+ len -= end - start;
+ start = end + 1;
+ }
+
+ *is_free = true;
+ return error;
+}
While we're scrubbing various btrees, cross-reference the records with the other metadata. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> --- libxfs/xfs_rtbitmap.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)