summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-25 01:55:31 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-25 02:49:40 +0200
commitab1ba02181ea543a3f504d035a0f4fa53feb6e36 (patch)
treebeea5dab044e85b975150adf7f49392b1d1c31b2 /fs/ocfs2
parentocfs2: use swap() in swap_refcount_rec() (diff)
downloadlinux-ab1ba02181ea543a3f504d035a0f4fa53feb6e36.tar.xz
linux-ab1ba02181ea543a3f504d035a0f4fa53feb6e36.zip
ocfs2: use swap() in ocfs2_double_lock()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/namei.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 08a7a5b70494..6e6abb93fda5 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -1116,8 +1116,6 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
int inode1_is_ancestor, inode2_is_ancestor;
struct ocfs2_inode_info *oi1 = OCFS2_I(inode1);
struct ocfs2_inode_info *oi2 = OCFS2_I(inode2);
- struct buffer_head **tmpbh;
- struct inode *tmpinode;
trace_ocfs2_double_lock((unsigned long long)oi1->ip_blkno,
(unsigned long long)oi2->ip_blkno);
@@ -1148,13 +1146,8 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
(oi1->ip_blkno < oi2->ip_blkno &&
inode2_is_ancestor == 0)) {
/* switch id1 and id2 around */
- tmpbh = bh2;
- bh2 = bh1;
- bh1 = tmpbh;
-
- tmpinode = inode2;
- inode2 = inode1;
- inode1 = tmpinode;
+ swap(bh2, bh1);
+ swap(inode2, inode1);
}
/* lock id2 */
status = ocfs2_inode_lock_nested(inode2, bh2, 1,