xfs: clean up the rtbitmap fsmap backend
authorDarrick J. Wong <djwong@kernel.org>
Fri, 30 Jun 2023 00:39:44 +0000 (17:39 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 2 Jul 2023 16:26:19 +0000 (09:26 -0700)
commitf045dd00328d78f25d64913285f4547f772d13e2
tree80b21bc2b54d5555657424d815de45b2a7be09b1
parentd898137d789cac9ebe5eed9957e4cf25122ca524
xfs: clean up the rtbitmap fsmap backend

The rtbitmap fsmap backend doesn't query the rmapbt, so it's wasteful to
spend time initializing the rmap_irec objects.  Worse yet, the logic to
query the rtbitmap is spread across three separate functions, which is
unnecessarily difficult to follow.

Compute the start rtextent that we want from keys[0] directly and
combine the functions to avoid passing parameters around everywhere, and
consolidate all the logic into a single function.  At one point many
years ago I intended to use __xfs_getfsmap_rtdev as the launching point
for realtime rmapbt queries, but this hasn't been the case for a long
time.

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