Tidy up the comparison code in this function to match the kernel.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
{
__u64 oa;
__u64 ob;
- int64_t d;
struct xfs_rmap_irec tmp;
tmp = *kp1;
tmp.rm_flags &= ~XFS_RMAP_REC_FLAGS;
ob = libxfs_rmap_irec_offset_pack(&tmp);
- d = (int64_t)kp1->rm_startblock - kp2->rm_startblock;
- if (d)
- return d;
+ if (kp1->rm_startblock > kp2->rm_startblock)
+ return 1;
+ else if (kp2->rm_startblock > kp1->rm_startblock)
+ return -1;
if (kp1->rm_owner > kp2->rm_owner)
return 1;