summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorDave Jones <dsj@fb.com>2016-01-28 15:28:35 -0500
committerDavid Sterba <dsterba@suse.com>2016-02-18 05:45:55 -0500
commit8f682f6955b94ddfb548a1db23c1dd633d90f7de (patch)
treeed866d1647592363917dbf44f60669c4b08ef031 /fs/btrfs/backref.c
parentac1407ba24d69015f88da18bfac978c493380b81 (diff)
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>
Diffstat (limited to 'fs/btrfs/backref.c')
-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)
566 struct __prelim_ref *pos2 = pos1, *tmp; 566 struct __prelim_ref *pos2 = pos1, *tmp;
567 567
568 list_for_each_entry_safe_continue(pos2, tmp, head, list) { 568 list_for_each_entry_safe_continue(pos2, tmp, head, list) {
569 struct __prelim_ref *xchg, *ref1 = pos1, *ref2 = pos2; 569 struct __prelim_ref *ref1 = pos1, *ref2 = pos2;
570 struct extent_inode_elem *eie; 570 struct extent_inode_elem *eie;
571 571
572 if (!ref_for_same_block(ref1, ref2)) 572 if (!ref_for_same_block(ref1, ref2))
573 continue; 573 continue;
574 if (mode == 1) { 574 if (mode == 1) {
575 if (!ref1->parent && ref2->parent) { 575 if (!ref1->parent && ref2->parent)
576 xchg = ref1; 576 swap(ref1, ref2);
577 ref1 = ref2;
578 ref2 = xchg;
579 }
580 } else { 577 } else {
581 if (ref1->parent != ref2->parent) 578 if (ref1->parent != ref2->parent)
582 continue; 579 continue;