Skip to content

Commit 5b068aa

Browse files
Yang GuangDarrick J. Wong
authored andcommitted
xfs: use swap() to make dabtree code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Yang Guang <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 2a09b57 commit 5b068aa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/xfs/libxfs/xfs_da_btree.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ xfs_da3_node_rebalance(
864864
{
865865
struct xfs_da_intnode *node1;
866866
struct xfs_da_intnode *node2;
867-
struct xfs_da_intnode *tmpnode;
868867
struct xfs_da_node_entry *btree1;
869868
struct xfs_da_node_entry *btree2;
870869
struct xfs_da_node_entry *btree_s;
@@ -894,9 +893,7 @@ xfs_da3_node_rebalance(
894893
((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) ||
895894
(be32_to_cpu(btree2[nodehdr2.count - 1].hashval) <
896895
be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) {
897-
tmpnode = node1;
898-
node1 = node2;
899-
node2 = tmpnode;
896+
swap(node1, node2);
900897
xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1);
901898
xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2);
902899
btree1 = nodehdr1.btree;

0 commit comments

Comments
 (0)