Skip to content

Commit

Permalink
Merge tag 'xfs-fixes-6.14-rc7' of git://git.kernel.org/pub/scm/fs/xfs…
Browse files Browse the repository at this point in the history
…/xfs-linux

Pull xfs cleanup from Carlos Maiolino:
 "Use abs_diff instead of XFS_ABSDIFF"

* tag 'xfs-fixes-6.14-rc7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: Use abs_diff instead of XFS_ABSDIFF
  • Loading branch information
Linus Torvalds committed Mar 14, 2025
2 parents 912ad8b + ca3ac4b commit 2bda981
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/xfs/libxfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ struct kmem_cache *xfs_extfree_item_cache;

struct workqueue_struct *xfs_alloc_wq;

#define XFS_ABSDIFF(a,b) (((a) <= (b)) ? ((b) - (a)) : ((a) - (b)))

#define XFSA_FIXUP_BNO_OK 1
#define XFSA_FIXUP_CNT_OK 2

Expand Down Expand Up @@ -410,8 +408,8 @@ xfs_alloc_compute_diff(
if (newbno1 != NULLAGBLOCK && newbno2 != NULLAGBLOCK) {
if (newlen1 < newlen2 ||
(newlen1 == newlen2 &&
XFS_ABSDIFF(newbno1, wantbno) >
XFS_ABSDIFF(newbno2, wantbno)))
abs_diff(newbno1, wantbno) >
abs_diff(newbno2, wantbno)))
newbno1 = newbno2;
} else if (newbno2 != NULLAGBLOCK)
newbno1 = newbno2;
Expand All @@ -427,7 +425,7 @@ xfs_alloc_compute_diff(
} else
newbno1 = freeend - wantlen;
*newbnop = newbno1;
return newbno1 == NULLAGBLOCK ? 0 : XFS_ABSDIFF(newbno1, wantbno);
return newbno1 == NULLAGBLOCK ? 0 : abs_diff(newbno1, wantbno);
}

/*
Expand Down

0 comments on commit 2bda981

Please sign in to comment.