]> Git Repo - J-linux.git/commitdiff
xfs: use swap() to make dabtree code cleaner
authorYang Guang <[email protected]>
Mon, 8 Nov 2021 19:23:25 +0000 (11:23 -0800)
committerDarrick J. Wong <[email protected]>
Mon, 8 Nov 2021 19:23:25 +0000 (11:23 -0800)
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]>
fs/xfs/libxfs/xfs_da_btree.c

index dd7a2dbce1d144679871ca7c7ca2ecadc217eca3..9dc1ecb9713d80dc91677dcdfc899c9c9ba1e5ad 100644 (file)
@@ -864,7 +864,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;
@@ -894,9 +893,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;
This page took 0.048031 seconds and 4 git commands to generate.