aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index f6dac40f87ff..80e8472d618b 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -148,8 +148,7 @@ int __init btrfs_prelim_ref_init(void)
148 148
149void btrfs_prelim_ref_exit(void) 149void btrfs_prelim_ref_exit(void)
150{ 150{
151 if (btrfs_prelim_ref_cache) 151 kmem_cache_destroy(btrfs_prelim_ref_cache);
152 kmem_cache_destroy(btrfs_prelim_ref_cache);
153} 152}
154 153
155/* 154/*
@@ -566,17 +565,14 @@ static void __merge_refs(struct list_head *head, int mode)
566 struct __prelim_ref *pos2 = pos1, *tmp; 565 struct __prelim_ref *pos2 = pos1, *tmp;
567 566
568 list_for_each_entry_safe_continue(pos2, tmp, head, list) { 567 list_for_each_entry_safe_continue(pos2, tmp, head, list) {
569 struct __prelim_ref *xchg, *ref1 = pos1, *ref2 = pos2; 568 struct __prelim_ref *ref1 = pos1, *ref2 = pos2;
570 struct extent_inode_elem *eie; 569 struct extent_inode_elem *eie;
571 570
572 if (!ref_for_same_block(ref1, ref2)) 571 if (!ref_for_same_block(ref1, ref2))
573 continue; 572 continue;
574 if (mode == 1) { 573 if (mode == 1) {
575 if (!ref1->parent && ref2->parent) { 574 if (!ref1->parent && ref2->parent)
576 xchg = ref1; 575 swap(ref1, ref2);
577 ref1 = ref2;
578 ref2 = xchg;
579 }
580 } else { 576 } else {
581 if (ref1->parent != ref2->parent) 577 if (ref1->parent != ref2->parent)
582 continue; 578 continue;