]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: refactor cmp_two_keys routines to take advantage of cmp_int()
authorFedor Pchelkin <pchelkin@ispras.ru>
Mon, 6 Oct 2025 12:40:16 +0000 (14:40 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Mon, 13 Oct 2025 09:53:39 +0000 (11:53 +0200)
commit4a902e04d98ef28daab8bffc8c78ac59e426dd5a
treecf2acc738cfc13163f94e760347474e538642cf2
parenta6b87a3a466cf689ceafbb919b5e8a9bd47d2627
xfs: refactor cmp_two_keys routines to take advantage of cmp_int()

Source kernel commit: 3b583adf55c649d5ba37bcd1ca87644b0bc10b86

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_two_keys 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>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
include/platform_defs.h
libxfs/xfs_alloc_btree.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.h
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount_btree.c
libxfs/xfs_rmap_btree.c
libxfs/xfs_rtrefcount_btree.c
libxfs/xfs_rtrmap_btree.c
repair/rcbag_btree.c
scrub/inodes.c