]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: replace xfs_btree_has_record with a general keyspace scanner
authorDarrick J. Wong <djwong@kernel.org>
Wed, 31 May 2023 09:07:21 +0000 (11:07 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Jun 2023 08:27:50 +0000 (10:27 +0200)
commit9ba4dc82877c52e549a1734e8ce73d66028c3dba
treeb9f0132f80c08afcb860553fe8cc9c137a59472f
parente3b15d883cfa1343b1b3ea57ae7dc825947e7172
xfs: replace xfs_btree_has_record with a general keyspace scanner

Source kernel commit: 6abc7aef85b1f42cb39a3149f4ab64ca255e41e6

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 conflated
sparseness and fullness, which caused scrub to return 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>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
14 files changed:
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_alloc_btree.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount.c
libxfs/xfs_refcount.h
libxfs/xfs_refcount_btree.c
libxfs/xfs_rmap.c
libxfs/xfs_rmap.h
libxfs/xfs_rmap_btree.c
libxfs/xfs_types.h