diff options
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index a9728680eca8..0109e5606bad 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -170,14 +170,14 @@ struct async_merge { | |||
170 | 170 | ||
171 | static void mapping_tree_init(struct mapping_tree *tree) | 171 | static void mapping_tree_init(struct mapping_tree *tree) |
172 | { | 172 | { |
173 | tree->rb_root.rb_node = NULL; | 173 | tree->rb_root = RB_ROOT; |
174 | spin_lock_init(&tree->lock); | 174 | spin_lock_init(&tree->lock); |
175 | } | 175 | } |
176 | 176 | ||
177 | static void backref_cache_init(struct backref_cache *cache) | 177 | static void backref_cache_init(struct backref_cache *cache) |
178 | { | 178 | { |
179 | int i; | 179 | int i; |
180 | cache->rb_root.rb_node = NULL; | 180 | cache->rb_root = RB_ROOT; |
181 | for (i = 0; i < BTRFS_MAX_LEVEL; i++) | 181 | for (i = 0; i < BTRFS_MAX_LEVEL; i++) |
182 | INIT_LIST_HEAD(&cache->pending[i]); | 182 | INIT_LIST_HEAD(&cache->pending[i]); |
183 | spin_lock_init(&cache->lock); | 183 | spin_lock_init(&cache->lock); |
@@ -3281,8 +3281,10 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) | |||
3281 | return -ENOMEM; | 3281 | return -ENOMEM; |
3282 | 3282 | ||
3283 | path = btrfs_alloc_path(); | 3283 | path = btrfs_alloc_path(); |
3284 | if (!path) | 3284 | if (!path) { |
3285 | kfree(cluster); | ||
3285 | return -ENOMEM; | 3286 | return -ENOMEM; |
3287 | } | ||
3286 | 3288 | ||
3287 | rc->extents_found = 0; | 3289 | rc->extents_found = 0; |
3288 | rc->extents_skipped = 0; | 3290 | rc->extents_skipped = 0; |
@@ -3762,7 +3764,8 @@ out: | |||
3762 | BTRFS_DATA_RELOC_TREE_OBJECTID); | 3764 | BTRFS_DATA_RELOC_TREE_OBJECTID); |
3763 | if (IS_ERR(fs_root)) | 3765 | if (IS_ERR(fs_root)) |
3764 | err = PTR_ERR(fs_root); | 3766 | err = PTR_ERR(fs_root); |
3765 | btrfs_orphan_cleanup(fs_root); | 3767 | else |
3768 | btrfs_orphan_cleanup(fs_root); | ||
3766 | } | 3769 | } |
3767 | return err; | 3770 | return err; |
3768 | } | 3771 | } |