]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: fix rt device offset calculations for FITRIM
authorDarrick J. Wong <djwong@kernel.org>
Fri, 27 Sep 2024 22:40:59 +0000 (15:40 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 9 Oct 2024 13:55:39 +0000 (15:55 +0200)
commit1a56fcf45de6d4d31005d1a48b23f11a46e29e09
treea7a07f3153683d9938c5526e2cb1c21313436498
parent17c703f49ad0c1ae5f9db5bdbdc1df3d878462af
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>
fs/xfs/xfs_discard.c