diff options
author | Yang Guang <yang.guang5@zte.com.cn> | 2021-11-08 11:23:25 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-11-08 11:23:25 -0800 |
commit | 5b068aadf62da006891383f6b23e47bc3ad49995 (patch) | |
tree | 31d64e70a2c2437b9ebc79de60f62a8ce81b840a | |
parent | 2a09b575074ff3ed23907b6f6f3da87af41f592b (diff) | |
download | linux-stable-5b068aadf62da006891383f6b23e47bc3ad49995.tar.gz linux-stable-5b068aadf62da006891383f6b23e47bc3ad49995.tar.bz2 linux-stable-5b068aadf62da006891383f6b23e47bc3ad49995.zip |
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 <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>
-rw-r--r-- | fs/xfs/libxfs/xfs_da_btree.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c index dd7a2dbce1d1..9dc1ecb9713d 100644 --- a/fs/xfs/libxfs/xfs_da_btree.c +++ b/fs/xfs/libxfs/xfs_da_btree.c @@ -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; |