xfs: support non-power-of-two rtextsize with exchange-range
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:23 +0000 (14:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:23 +0000 (14:54 -0700)
commitb3e60f84838d5abc3a73d7ef0fc595dd1041c565
treeb8ff59b7adf14fd2329fc5649f43e5ba7128680d
parente62941103faa2eedba6a155316e059a490c743a6
xfs: support non-power-of-two rtextsize with exchange-range

The generic exchange-range alignment checks use (fast) bitmasking
operations to perform block alignment checks on the exchange parameters.
Unfortunately, bitmasks require that the alignment size be a power of
two.  This isn't true for realtime devices with a non-power-of-two
extent size, so we have to copy-pasta the generic checks using long
division for this to work properly.

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