]> www.infradead.org Git - linux.git/commit
xfs: clean up xfs_getfsmap_helper arguments
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 04:19:03 +0000 (20:19 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:35 +0000 (13:38 -0800)
commitdcfc65befb76dfcb6fa1e49a3c2cc60f3f53a337
tree082f4efb737baf869bc169a463980f01ed07f24f
parent0d2c636e489c115add86bd66952880f92b5edab7
xfs: clean up xfs_getfsmap_helper arguments

The calling conventions for xfs_getfsmap_helper are confusing -- callers
pass in an rmap record, but they must also supply startblock and
blockcount in daddr units.  This was bolted onto the original fsmap
implementation so that we could report *something* for realtime
volumes, which do not support rmap and hence can draw only from the rt
free space bitmap.  Free space on the rt volume can be more than 2^32
fsblocks long, which means that we can't use the rmap startblock or
blockcount fields.

This is confusing for callers, because they must supplying redundant
data, but not all of it is used.  Streamline this by creating a separate
fsmap irec structure that contains exactly the data we need, once.

Note that we actually do need rm_startblock for rmap key comparisons
when we're actually querying an rmap btree, so leave that field but
document why it's there.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_fsmap.c
fs/xfs/xfs_fsmap.h
fs/xfs/xfs_trace.h