summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jones <dsj@fb.com>2016-01-28 21:28:35 +0100
committerDavid Sterba <dsterba@suse.com>2016-02-18 11:45:55 +0100
commit8f682f6955b94ddfb548a1db23c1dd633d90f7de (patch)
treeed866d1647592363917dbf44f60669c4b08ef031
parentbtrfs: remove redundant error check (diff)
downloadlinux-8f682f6955b94ddfb548a1db23c1dd633d90f7de.tar.xz
linux-8f682f6955b94ddfb548a1db23c1dd633d90f7de.zip
btrfs: remove open-coded swap() in backref.c:__merge_refs
The kernel provides a swap() that does the same thing as this code. Signed-off-by: Dave Jones <dsj@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/backref.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index b90cd3776f8e..dc6e9a32d019 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -566,17 +566,14 @@ static void __merge_refs(struct list_head *head, int mode)
struct __prelim_ref *pos2 = pos1, *tmp;
list_for_each_entry_safe_continue(pos2, tmp, head, list) {
- struct __prelim_ref *xchg, *ref1 = pos1, *ref2 = pos2;
+ struct __prelim_ref *ref1 = pos1, *ref2 = pos2;
struct extent_inode_elem *eie;
if (!ref_for_same_block(ref1, ref2))
continue;
if (mode == 1) {
- if (!ref1->parent && ref2->parent) {
- xchg = ref1;
- ref1 = ref2;
- ref2 = xchg;
- }
+ if (!ref1->parent && ref2->parent)
+ swap(ref1, ref2);
} else {
if (ref1->parent != ref2->parent)
continue;