提交 8f682f69 编写于 作者: D Dave Jones 提交者: David Sterba

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: NDave Jones <dsj@fb.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 ac1407ba
...@@ -566,17 +566,14 @@ static void __merge_refs(struct list_head *head, int mode) ...@@ -566,17 +566,14 @@ static void __merge_refs(struct list_head *head, int mode)
struct __prelim_ref *pos2 = pos1, *tmp; struct __prelim_ref *pos2 = pos1, *tmp;
list_for_each_entry_safe_continue(pos2, tmp, head, list) { 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; struct extent_inode_elem *eie;
if (!ref_for_same_block(ref1, ref2)) if (!ref_for_same_block(ref1, ref2))
continue; continue;
if (mode == 1) { if (mode == 1) {
if (!ref1->parent && ref2->parent) { if (!ref1->parent && ref2->parent)
xchg = ref1; swap(ref1, ref2);
ref1 = ref2;
ref2 = xchg;
}
} else { } else {
if (ref1->parent != ref2->parent) if (ref1->parent != ref2->parent)
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册