]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: use swap() to make dabtree code cleaner
authorYang Guang <yang.guang5@zte.com.cn>
Thu, 6 Jan 2022 22:13:24 +0000 (14:13 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 19 Apr 2022 04:04:10 +0000 (21:04 -0700)
Source kernel commit: d3d48fb93ba48bd3cb5c564235bfbc96fe4d0d7f

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_da_btree.c

index 50f3ec661a421bdd09489433e8f878a7c46871b8..1f39c108782d1cff15eb6299e6a30ce862e1e792 100644 (file)
@@ -861,7 +861,6 @@ xfs_da3_node_rebalance(
 {
        struct xfs_da_intnode   *node1;
        struct xfs_da_intnode   *node2;
-       struct xfs_da_intnode   *tmpnode;
        struct xfs_da_node_entry *btree1;
        struct xfs_da_node_entry *btree2;
        struct xfs_da_node_entry *btree_s;
@@ -891,9 +890,7 @@ xfs_da3_node_rebalance(
            ((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) ||
             (be32_to_cpu(btree2[nodehdr2.count - 1].hashval) <
                        be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) {
-               tmpnode = node1;
-               node1 = node2;
-               node2 = tmpnode;
+               swap(node1, node2);
                xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1);
                xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2);
                btree1 = nodehdr1.btree;