]> www.infradead.org Git - users/dwmw2/linux.git/commit
xfs: fix rt device offset calculations for FITRIM
authorDarrick J. Wong <djwong@kernel.org>
Mon, 4 Nov 2024 04:19:16 +0000 (20:19 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:38 +0000 (13:38 -0800)
commitdca94251f617942f05c7c6ff30a299f6b7dff770
tree2be107d46a9d016426de504e2eb378c616357de9
parentf220f6da5f4ad7da538c39075cf57e829d5202f7
xfs: fix rt device offset calculations for FITRIM

FITRIM on xfs has this bizarro uapi where we flatten all the physically
addressable storage across two block devices into a linear address
space.  In this address space, the realtime device comes immediately
after the data device.  Therefore, the xfs_trim_rtdev_extents has to
convert its input parameters from the linear address space to actual
rtdev block addresses on the realtime volume.

Right now the address space conversion is done in units of rtblocks.
However, a future patchset will convert xfs_rtblock_t to be a segmented
address space (group:blkno) like the data device.  Change the conversion
code to be done in units of daddrs since those will never be segmented.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_discard.c