summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_types.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:05:41 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:29 -0700
commit29b621d45c6a305a8a032190d704a250488a8823 (patch)
tree0ccdc5b080dd759cbcb62516092e086fdaa456ba /fs/xfs/libxfs/xfs_types.h
parentfb3002944dbe0f3b612c0c96dfbaac0c813c0e3a (diff)
xfs: replace xfs_btree_has_record with a general keyspace scanner
The current implementation of xfs_btree_has_record returns true if it finds /any/ record within the given range. Unfortunately, that's not sufficient for scrub. We want to be able to tell if a range of keyspace for a btree is devoid of records, is totally mapped to records, or is somewhere in between. By forcing this to be a boolean, we were generally missing the "in between" case and returning incorrect results. Fix the API so that we can tell the caller which of those three is the current state. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_types.h')
-rw-r--r--fs/xfs/libxfs/xfs_types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 50e610a9b89c..bbbbdc816d1a 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -204,6 +204,18 @@ enum xfs_ag_resv_type {
XFS_AG_RESV_RMAPBT,
};
+/* Results of scanning a btree keyspace to check occupancy. */
+enum xfs_btree_keyfill {
+ /* None of the keyspace maps to records. */
+ XFS_BTREE_KEYFILL_EMPTY = 0,
+
+ /* Some, but not all, of the keyspace maps to records. */
+ XFS_BTREE_KEYFILL_SPARSE,
+
+ /* The entire keyspace maps to records. */
+ XFS_BTREE_KEYFILL_FULL,
+};
+
/*
* Type verifier functions
*/