Commit 5b068aad authored by Yang Guang's avatar Yang Guang Committed by Darrick J. Wong

xfs: use swap() to make dabtree code cleaner

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarYang Guang <yang.guang5@zte.com.cn>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 2a09b575
...@@ -864,7 +864,6 @@ xfs_da3_node_rebalance( ...@@ -864,7 +864,6 @@ xfs_da3_node_rebalance(
{ {
struct xfs_da_intnode *node1; struct xfs_da_intnode *node1;
struct xfs_da_intnode *node2; struct xfs_da_intnode *node2;
struct xfs_da_intnode *tmpnode;
struct xfs_da_node_entry *btree1; struct xfs_da_node_entry *btree1;
struct xfs_da_node_entry *btree2; struct xfs_da_node_entry *btree2;
struct xfs_da_node_entry *btree_s; struct xfs_da_node_entry *btree_s;
...@@ -894,9 +893,7 @@ xfs_da3_node_rebalance( ...@@ -894,9 +893,7 @@ xfs_da3_node_rebalance(
((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) || ((be32_to_cpu(btree2[0].hashval) < be32_to_cpu(btree1[0].hashval)) ||
(be32_to_cpu(btree2[nodehdr2.count - 1].hashval) < (be32_to_cpu(btree2[nodehdr2.count - 1].hashval) <
be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) { be32_to_cpu(btree1[nodehdr1.count - 1].hashval)))) {
tmpnode = node1; swap(node1, node2);
node1 = node2;
node2 = tmpnode;
xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1); xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr1, node1);
xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2); xfs_da3_node_hdr_from_disk(dp->i_mount, &nodehdr2, node2);
btree1 = nodehdr1.btree; btree1 = nodehdr1.btree;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment