]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: refactor cmp_key_with_cur routines to take advantage of cmp_int()
authorFedor Pchelkin <pchelkin@ispras.ru>
Wed, 2 Jul 2025 09:39:31 +0000 (12:39 +0300)
committerCarlos Maiolino <cem@kernel.org>
Thu, 24 Jul 2025 15:30:13 +0000 (17:30 +0200)
commit734b871d6cf7d4f815bb1eff8c808289079701c2
tree11d916228cc945bab039b3f789297618b8c93db9
parent3b583adf55c649d5ba37bcd1ca87644b0bc10b86
xfs: refactor cmp_key_with_cur routines to take advantage of cmp_int()

The net value of these functions is to determine the result of a
three-way-comparison between operands of the same type.

Simplify the code using cmp_int() to eliminate potential errors with
opencoded casts and subtractions. This also means we can change the return
value type of cmp_key_with_cur routines from int64_t to int and make the
interface a bit clearer.

Found by Linux Verification Center (linuxtesting.org).

Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_refcount_btree.c
fs/xfs/libxfs/xfs_rmap_btree.c
fs/xfs/libxfs/xfs_rtrefcount_btree.c
fs/xfs/libxfs/xfs_rtrmap_btree.c
fs/xfs/scrub/rcbag_btree.c