aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6a3d53783d5..a160f11465f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -379,7 +379,7 @@ again:
379 break; 379 break;
380 380
381 caching_ctl->progress = last; 381 caching_ctl->progress = last;
382 btrfs_release_path(extent_root, path); 382 btrfs_release_path(path);
383 up_read(&fs_info->extent_commit_sem); 383 up_read(&fs_info->extent_commit_sem);
384 mutex_unlock(&caching_ctl->mutex); 384 mutex_unlock(&caching_ctl->mutex);
385 if (btrfs_transaction_in_commit(fs_info)) 385 if (btrfs_transaction_in_commit(fs_info))
@@ -754,7 +754,7 @@ again:
754 atomic_inc(&head->node.refs); 754 atomic_inc(&head->node.refs);
755 spin_unlock(&delayed_refs->lock); 755 spin_unlock(&delayed_refs->lock);
756 756
757 btrfs_release_path(root->fs_info->extent_root, path); 757 btrfs_release_path(path);
758 758
759 mutex_lock(&head->mutex); 759 mutex_lock(&head->mutex);
760 mutex_unlock(&head->mutex); 760 mutex_unlock(&head->mutex);
@@ -934,7 +934,7 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
934 break; 934 break;
935 } 935 }
936 } 936 }
937 btrfs_release_path(root, path); 937 btrfs_release_path(path);
938 938
939 if (owner < BTRFS_FIRST_FREE_OBJECTID) 939 if (owner < BTRFS_FIRST_FREE_OBJECTID)
940 new_size += sizeof(*bi); 940 new_size += sizeof(*bi);
@@ -1042,7 +1042,7 @@ again:
1042 return 0; 1042 return 0;
1043#ifdef BTRFS_COMPAT_EXTENT_TREE_V0 1043#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
1044 key.type = BTRFS_EXTENT_REF_V0_KEY; 1044 key.type = BTRFS_EXTENT_REF_V0_KEY;
1045 btrfs_release_path(root, path); 1045 btrfs_release_path(path);
1046 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); 1046 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1047 if (ret < 0) { 1047 if (ret < 0) {
1048 err = ret; 1048 err = ret;
@@ -1080,7 +1080,7 @@ again:
1080 if (match_extent_data_ref(leaf, ref, root_objectid, 1080 if (match_extent_data_ref(leaf, ref, root_objectid,
1081 owner, offset)) { 1081 owner, offset)) {
1082 if (recow) { 1082 if (recow) {
1083 btrfs_release_path(root, path); 1083 btrfs_release_path(path);
1084 goto again; 1084 goto again;
1085 } 1085 }
1086 err = 0; 1086 err = 0;
@@ -1141,7 +1141,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
1141 if (match_extent_data_ref(leaf, ref, root_objectid, 1141 if (match_extent_data_ref(leaf, ref, root_objectid,
1142 owner, offset)) 1142 owner, offset))
1143 break; 1143 break;
1144 btrfs_release_path(root, path); 1144 btrfs_release_path(path);
1145 key.offset++; 1145 key.offset++;
1146 ret = btrfs_insert_empty_item(trans, root, path, &key, 1146 ret = btrfs_insert_empty_item(trans, root, path, &key,
1147 size); 1147 size);
@@ -1167,7 +1167,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
1167 btrfs_mark_buffer_dirty(leaf); 1167 btrfs_mark_buffer_dirty(leaf);
1168 ret = 0; 1168 ret = 0;
1169fail: 1169fail:
1170 btrfs_release_path(root, path); 1170 btrfs_release_path(path);
1171 return ret; 1171 return ret;
1172} 1172}
1173 1173
@@ -1293,7 +1293,7 @@ static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
1293 ret = -ENOENT; 1293 ret = -ENOENT;
1294#ifdef BTRFS_COMPAT_EXTENT_TREE_V0 1294#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
1295 if (ret == -ENOENT && parent) { 1295 if (ret == -ENOENT && parent) {
1296 btrfs_release_path(root, path); 1296 btrfs_release_path(path);
1297 key.type = BTRFS_EXTENT_REF_V0_KEY; 1297 key.type = BTRFS_EXTENT_REF_V0_KEY;
1298 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); 1298 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1299 if (ret > 0) 1299 if (ret > 0)
@@ -1322,7 +1322,7 @@ static noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
1322 } 1322 }
1323 1323
1324 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); 1324 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
1325 btrfs_release_path(root, path); 1325 btrfs_release_path(path);
1326 return ret; 1326 return ret;
1327} 1327}
1328 1328
@@ -1608,7 +1608,7 @@ static int lookup_extent_backref(struct btrfs_trans_handle *trans,
1608 if (ret != -ENOENT) 1608 if (ret != -ENOENT)
1609 return ret; 1609 return ret;
1610 1610
1611 btrfs_release_path(root, path); 1611 btrfs_release_path(path);
1612 *ref_ret = NULL; 1612 *ref_ret = NULL;
1613 1613
1614 if (owner < BTRFS_FIRST_FREE_OBJECTID) { 1614 if (owner < BTRFS_FIRST_FREE_OBJECTID) {
@@ -1862,7 +1862,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
1862 __run_delayed_extent_op(extent_op, leaf, item); 1862 __run_delayed_extent_op(extent_op, leaf, item);
1863 1863
1864 btrfs_mark_buffer_dirty(leaf); 1864 btrfs_mark_buffer_dirty(leaf);
1865 btrfs_release_path(root->fs_info->extent_root, path); 1865 btrfs_release_path(path);
1866 1866
1867 path->reada = 1; 1867 path->reada = 1;
1868 path->leave_spinning = 1; 1868 path->leave_spinning = 1;
@@ -2361,7 +2361,7 @@ static noinline int check_delayed_ref(struct btrfs_trans_handle *trans,
2361 atomic_inc(&head->node.refs); 2361 atomic_inc(&head->node.refs);
2362 spin_unlock(&delayed_refs->lock); 2362 spin_unlock(&delayed_refs->lock);
2363 2363
2364 btrfs_release_path(root->fs_info->extent_root, path); 2364 btrfs_release_path(path);
2365 2365
2366 mutex_lock(&head->mutex); 2366 mutex_lock(&head->mutex);
2367 mutex_unlock(&head->mutex); 2367 mutex_unlock(&head->mutex);
@@ -2732,7 +2732,7 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
2732 bi = btrfs_item_ptr_offset(leaf, path->slots[0]); 2732 bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
2733 write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item)); 2733 write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item));
2734 btrfs_mark_buffer_dirty(leaf); 2734 btrfs_mark_buffer_dirty(leaf);
2735 btrfs_release_path(extent_root, path); 2735 btrfs_release_path(path);
2736fail: 2736fail:
2737 if (ret) 2737 if (ret)
2738 return ret; 2738 return ret;
@@ -2785,7 +2785,7 @@ again:
2785 inode = lookup_free_space_inode(root, block_group, path); 2785 inode = lookup_free_space_inode(root, block_group, path);
2786 if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) { 2786 if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
2787 ret = PTR_ERR(inode); 2787 ret = PTR_ERR(inode);
2788 btrfs_release_path(root, path); 2788 btrfs_release_path(path);
2789 goto out; 2789 goto out;
2790 } 2790 }
2791 2791
@@ -2854,7 +2854,7 @@ again:
2854out_put: 2854out_put:
2855 iput(inode); 2855 iput(inode);
2856out_free: 2856out_free:
2857 btrfs_release_path(root, path); 2857 btrfs_release_path(path);
2858out: 2858out:
2859 spin_lock(&block_group->lock); 2859 spin_lock(&block_group->lock);
2860 block_group->disk_cache_state = dcs; 2860 block_group->disk_cache_state = dcs;
@@ -4541,7 +4541,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
4541 NULL, refs_to_drop, 4541 NULL, refs_to_drop,
4542 is_data); 4542 is_data);
4543 BUG_ON(ret); 4543 BUG_ON(ret);
4544 btrfs_release_path(extent_root, path); 4544 btrfs_release_path(path);
4545 path->leave_spinning = 1; 4545 path->leave_spinning = 1;
4546 4546
4547 key.objectid = bytenr; 4547 key.objectid = bytenr;
@@ -4580,7 +4580,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
4580 owner_objectid, 0); 4580 owner_objectid, 0);
4581 BUG_ON(ret < 0); 4581 BUG_ON(ret < 0);
4582 4582
4583 btrfs_release_path(extent_root, path); 4583 btrfs_release_path(path);
4584 path->leave_spinning = 1; 4584 path->leave_spinning = 1;
4585 4585
4586 key.objectid = bytenr; 4586 key.objectid = bytenr;
@@ -4650,7 +4650,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
4650 ret = btrfs_del_items(trans, extent_root, path, path->slots[0], 4650 ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
4651 num_to_del); 4651 num_to_del);
4652 BUG_ON(ret); 4652 BUG_ON(ret);
4653 btrfs_release_path(extent_root, path); 4653 btrfs_release_path(path);
4654 4654
4655 if (is_data) { 4655 if (is_data) {
4656 ret = btrfs_del_csums(trans, root, bytenr, num_bytes); 4656 ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
@@ -6480,7 +6480,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
6480 trans->block_rsv = block_rsv; 6480 trans->block_rsv = block_rsv;
6481 } 6481 }
6482 } 6482 }
6483 btrfs_release_path(root, path); 6483 btrfs_release_path(path);
6484 BUG_ON(err); 6484 BUG_ON(err);
6485 6485
6486 ret = btrfs_del_root(trans, tree_root, &root->root_key); 6486 ret = btrfs_del_root(trans, tree_root, &root->root_key);
@@ -8580,7 +8580,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
8580 memcpy(&cache->key, &found_key, sizeof(found_key)); 8580 memcpy(&cache->key, &found_key, sizeof(found_key));
8581 8581
8582 key.objectid = found_key.objectid + found_key.offset; 8582 key.objectid = found_key.objectid + found_key.offset;
8583 btrfs_release_path(root, path); 8583 btrfs_release_path(path);
8584 cache->flags = btrfs_block_group_flags(&cache->item); 8584 cache->flags = btrfs_block_group_flags(&cache->item);
8585 cache->sectorsize = root->sectorsize; 8585 cache->sectorsize = root->sectorsize;
8586 8586
@@ -8802,12 +8802,12 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
8802 if (ret < 0) 8802 if (ret < 0)
8803 goto out; 8803 goto out;
8804 if (ret > 0) 8804 if (ret > 0)
8805 btrfs_release_path(tree_root, path); 8805 btrfs_release_path(path);
8806 if (ret == 0) { 8806 if (ret == 0) {
8807 ret = btrfs_del_item(trans, tree_root, path); 8807 ret = btrfs_del_item(trans, tree_root, path);
8808 if (ret) 8808 if (ret)
8809 goto out; 8809 goto out;
8810 btrfs_release_path(tree_root, path); 8810 btrfs_release_path(path);
8811 } 8811 }
8812 8812
8813 spin_lock(&root->fs_info->block_group_cache_lock); 8813 spin_lock(&root->fs_info->block_group_cache_lock);