xfs: refactor non-power-of-two alignment checks
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:12 +0000 (14:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:12 +0000 (14:54 -0700)
commitac5cebeed61351c0a60c65bd20c70120469c46ff
treeb6273d5aaa91c015b3f85e054639f4a3596ba1aa
parent6b700a5be9b3b69419474622336c63fdc1cc3ca4
xfs: refactor non-power-of-two alignment checks

Create a helper function that can compute if a 64-bit number is an
integer multiple of a 32-bit number, where the 32-bit number is not
required to be an even power of two.  This is needed for some new code
for the realtime device, where we can set 37k allocation units and then
have to remap them.

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