[PATCH 2/4 linux-next] xfs: use swap() in xfs_lock_two_inodes()

Fabian Frederick
2015-05-18T17:14:45Z

fs/xfs/xfs_inode.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index d6ebc85..d4f3a09 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -500,7 +500,6 @@ xfs_lock_two_inodes(
xfs_inode_t *ip1,
uint lock_mode)
{
- xfs_inode_t *temp;
int attempts = 0;
xfs_log_item_t *lp;

@@ -512,11 +511,8 @@ xfs_lock_two_inodes(

ASSERT(ip0->i_ino != ip1->i_ino);

- if (ip0->i_ino > ip1->i_ino) {
- temp = ip0;
- ip0 = ip1;
- ip1 = temp;
- }
+ if (ip0->i_ino > ip1->i_ino)
+ swap(ip0, ip1);

again:
xfs_ilock(ip0, xfs_lock_inumorder(lock_mode, 0));
--
2.4.0