xfs: convert xfs_ialloc_has_inodes_at_extent to return keyfill scan results
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:15 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:15 +0000 (19:00 -0700)
commitefc0845f5d3e253f7f46a60b66a94c3164d76ee3
treef1c6b081e9a06a86e586f20815d54ca2c13ab1be
parentbc0f3b55467e1b5833bebae011a07e72a35afc2e
xfs: convert xfs_ialloc_has_inodes_at_extent to return keyfill scan results

Convert the xfs_ialloc_has_inodes_at_extent function to return keyfill
scan results because for a given range of inode numbers, we might have
no indexed inodes at all; the entire region might be allocated ondisk
inodes; or there might be a mix of the two.

Unfortunately, sparse inodes adds to the complexity, because each inode
record can have holes, which means that we cannot use the generic btree
_scan_keyfill function because we must look for holes in individual
records to decide the result.  On the plus side, online fsck can now
detect sub-chunk discrepancies in the inobt.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/libxfs/xfs_ialloc.h
fs/xfs/scrub/ialloc.c