Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dave Jones and committed by
David Sterba
8f682f69 ac1407ba

+3 -6
+3 -6
fs/btrfs/backref.c
··· 566 566 struct __prelim_ref *pos2 = pos1, *tmp; 567 567 568 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 570 struct extent_inode_elem *eie; 571 571 572 572 if (!ref_for_same_block(ref1, ref2)) 573 573 continue; 574 574 if (mode == 1) { 575 - if (!ref1->parent && ref2->parent) { 576 - xchg = ref1; 577 - ref1 = ref2; 578 - ref2 = xchg; 579 - } 575 + if (!ref1->parent && ref2->parent) 576 + swap(ref1, ref2); 580 577 } else { 581 578 if (ref1->parent != ref2->parent) 582 579 continue;