aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-04-20 19:20:15 -0400
committerDavid Sterba <dsterba@suse.cz>2011-05-02 07:57:22 -0400
commitb3b4aa74b58bded927f579fff787fb6fa1c0393c (patch)
tree30dab4ab26558992dd8b6b212bef805de11c4c29 /fs/btrfs
parentba14419264684b290f0d0b7f48d26eafb11fc0c6 (diff)
btrfs: drop unused parameter from btrfs_release_path
parameter tree root it's not used since commit 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee ("Btrfs: Create extent_buffer interface for large blocksizes") Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.c28
-rw-r--r--fs/btrfs/ctree.h2
-rw-r--r--fs/btrfs/dir-item.c2
-rw-r--r--fs/btrfs/extent-tree.c44
-rw-r--r--fs/btrfs/file-item.c12
-rw-r--r--fs/btrfs/file.c12
-rw-r--r--fs/btrfs/free-space-cache.c14
-rw-r--r--fs/btrfs/inode.c34
-rw-r--r--fs/btrfs/ioctl.c12
-rw-r--r--fs/btrfs/relocation.c30
-rw-r--r--fs/btrfs/root-tree.c10
-rw-r--r--fs/btrfs/tree-defrag.c2
-rw-r--r--fs/btrfs/tree-log.c98
-rw-r--r--fs/btrfs/volumes.c16
-rw-r--r--fs/btrfs/xattr.c4
15 files changed, 160 insertions, 160 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index a36c87db4dc4..fad8f23d70f0 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -107,7 +107,7 @@ void btrfs_free_path(struct btrfs_path *p)
107{ 107{
108 if (!p) 108 if (!p)
109 return; 109 return;
110 btrfs_release_path(NULL, p); 110 btrfs_release_path(p);
111 kmem_cache_free(btrfs_path_cachep, p); 111 kmem_cache_free(btrfs_path_cachep, p);
112} 112}
113 113
@@ -117,7 +117,7 @@ void btrfs_free_path(struct btrfs_path *p)
117 * 117 *
118 * It is safe to call this on paths that no locks or extent buffers held. 118 * It is safe to call this on paths that no locks or extent buffers held.
119 */ 119 */
120noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p) 120noinline void btrfs_release_path(struct btrfs_path *p)
121{ 121{
122 int i; 122 int i;
123 123
@@ -1328,7 +1328,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
1328 ret = -EAGAIN; 1328 ret = -EAGAIN;
1329 1329
1330 /* release the whole path */ 1330 /* release the whole path */
1331 btrfs_release_path(root, path); 1331 btrfs_release_path(path);
1332 1332
1333 /* read the blocks */ 1333 /* read the blocks */
1334 if (block1) 1334 if (block1)
@@ -1475,7 +1475,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
1475 return 0; 1475 return 0;
1476 } 1476 }
1477 free_extent_buffer(tmp); 1477 free_extent_buffer(tmp);
1478 btrfs_release_path(NULL, p); 1478 btrfs_release_path(p);
1479 return -EIO; 1479 return -EIO;
1480 } 1480 }
1481 } 1481 }
@@ -1494,7 +1494,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
1494 if (p->reada) 1494 if (p->reada)
1495 reada_for_search(root, p, level, slot, key->objectid); 1495 reada_for_search(root, p, level, slot, key->objectid);
1496 1496
1497 btrfs_release_path(NULL, p); 1497 btrfs_release_path(p);
1498 1498
1499 ret = -EAGAIN; 1499 ret = -EAGAIN;
1500 tmp = read_tree_block(root, blocknr, blocksize, 0); 1500 tmp = read_tree_block(root, blocknr, blocksize, 0);
@@ -1563,7 +1563,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans,
1563 } 1563 }
1564 b = p->nodes[level]; 1564 b = p->nodes[level];
1565 if (!b) { 1565 if (!b) {
1566 btrfs_release_path(NULL, p); 1566 btrfs_release_path(p);
1567 goto again; 1567 goto again;
1568 } 1568 }
1569 BUG_ON(btrfs_header_nritems(b) == 1); 1569 BUG_ON(btrfs_header_nritems(b) == 1);
@@ -1753,7 +1753,7 @@ done:
1753 if (!p->leave_spinning) 1753 if (!p->leave_spinning)
1754 btrfs_set_path_blocking(p); 1754 btrfs_set_path_blocking(p);
1755 if (ret < 0) 1755 if (ret < 0)
1756 btrfs_release_path(root, p); 1756 btrfs_release_path(p);
1757 return ret; 1757 return ret;
1758} 1758}
1759 1759
@@ -3026,7 +3026,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
3026 struct btrfs_file_extent_item); 3026 struct btrfs_file_extent_item);
3027 extent_len = btrfs_file_extent_num_bytes(leaf, fi); 3027 extent_len = btrfs_file_extent_num_bytes(leaf, fi);
3028 } 3028 }
3029 btrfs_release_path(root, path); 3029 btrfs_release_path(path);
3030 3030
3031 path->keep_locks = 1; 3031 path->keep_locks = 1;
3032 path->search_for_split = 1; 3032 path->search_for_split = 1;
@@ -3948,7 +3948,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
3948 else 3948 else
3949 return 1; 3949 return 1;
3950 3950
3951 btrfs_release_path(root, path); 3951 btrfs_release_path(path);
3952 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 3952 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3953 if (ret < 0) 3953 if (ret < 0)
3954 return ret; 3954 return ret;
@@ -4072,7 +4072,7 @@ find_next_key:
4072 sret = btrfs_find_next_key(root, path, min_key, level, 4072 sret = btrfs_find_next_key(root, path, min_key, level,
4073 cache_only, min_trans); 4073 cache_only, min_trans);
4074 if (sret == 0) { 4074 if (sret == 0) {
4075 btrfs_release_path(root, path); 4075 btrfs_release_path(path);
4076 goto again; 4076 goto again;
4077 } else { 4077 } else {
4078 goto out; 4078 goto out;
@@ -4151,7 +4151,7 @@ next:
4151 btrfs_node_key_to_cpu(c, &cur_key, slot); 4151 btrfs_node_key_to_cpu(c, &cur_key, slot);
4152 4152
4153 orig_lowest = path->lowest_level; 4153 orig_lowest = path->lowest_level;
4154 btrfs_release_path(root, path); 4154 btrfs_release_path(path);
4155 path->lowest_level = level; 4155 path->lowest_level = level;
4156 ret = btrfs_search_slot(NULL, root, &cur_key, path, 4156 ret = btrfs_search_slot(NULL, root, &cur_key, path,
4157 0, 0); 4157 0, 0);
@@ -4228,7 +4228,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
4228again: 4228again:
4229 level = 1; 4229 level = 1;
4230 next = NULL; 4230 next = NULL;
4231 btrfs_release_path(root, path); 4231 btrfs_release_path(path);
4232 4232
4233 path->keep_locks = 1; 4233 path->keep_locks = 1;
4234 4234
@@ -4284,7 +4284,7 @@ again:
4284 goto again; 4284 goto again;
4285 4285
4286 if (ret < 0) { 4286 if (ret < 0) {
4287 btrfs_release_path(root, path); 4287 btrfs_release_path(path);
4288 goto done; 4288 goto done;
4289 } 4289 }
4290 4290
@@ -4323,7 +4323,7 @@ again:
4323 goto again; 4323 goto again;
4324 4324
4325 if (ret < 0) { 4325 if (ret < 0) {
4326 btrfs_release_path(root, path); 4326 btrfs_release_path(path);
4327 goto done; 4327 goto done;
4328 } 4328 }
4329 4329
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b5433bbe7516..3f301f05099d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2290,7 +2290,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
2290 struct btrfs_root *root, struct extent_buffer *parent, 2290 struct btrfs_root *root, struct extent_buffer *parent,
2291 int start_slot, int cache_only, u64 *last_ret, 2291 int start_slot, int cache_only, u64 *last_ret,
2292 struct btrfs_key *progress); 2292 struct btrfs_key *progress);
2293void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); 2293void btrfs_release_path(struct btrfs_path *p);
2294struct btrfs_path *btrfs_alloc_path(void); 2294struct btrfs_path *btrfs_alloc_path(void);
2295void btrfs_free_path(struct btrfs_path *p); 2295void btrfs_free_path(struct btrfs_path *p);
2296void btrfs_set_path_blocking(struct btrfs_path *p); 2296void btrfs_set_path_blocking(struct btrfs_path *p);
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index c62f02f6ae69..ab8afed671a0 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -172,7 +172,7 @@ second_insert:
172 ret = 0; 172 ret = 0;
173 goto out_free; 173 goto out_free;
174 } 174 }
175 btrfs_release_path(root, path); 175 btrfs_release_path(path);
176 176
177 btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY); 177 btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
178 key.offset = index; 178 key.offset = index;
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6a3d53783d55..a160f11465f8 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);
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index a6a9d4e8b491..f47e43d855aa 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -193,7 +193,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
193 u32 item_size; 193 u32 item_size;
194 194
195 if (item) 195 if (item)
196 btrfs_release_path(root, path); 196 btrfs_release_path(path);
197 item = btrfs_lookup_csum(NULL, root->fs_info->csum_root, 197 item = btrfs_lookup_csum(NULL, root->fs_info->csum_root,
198 path, disk_bytenr, 0); 198 path, disk_bytenr, 0);
199 if (IS_ERR(item)) { 199 if (IS_ERR(item)) {
@@ -213,7 +213,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
213 (unsigned long long)offset); 213 (unsigned long long)offset);
214 } 214 }
215 item = NULL; 215 item = NULL;
216 btrfs_release_path(root, path); 216 btrfs_release_path(path);
217 goto found; 217 goto found;
218 } 218 }
219 btrfs_item_key_to_cpu(path->nodes[0], &found_key, 219 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
@@ -631,7 +631,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
631 if (key.offset < bytenr) 631 if (key.offset < bytenr)
632 break; 632 break;
633 } 633 }
634 btrfs_release_path(root, path); 634 btrfs_release_path(path);
635 } 635 }
636out: 636out:
637 btrfs_free_path(path); 637 btrfs_free_path(path);
@@ -722,7 +722,7 @@ again:
722 * at this point, we know the tree has an item, but it isn't big 722 * at this point, we know the tree has an item, but it isn't big
723 * enough yet to put our csum in. Grow it 723 * enough yet to put our csum in. Grow it
724 */ 724 */
725 btrfs_release_path(root, path); 725 btrfs_release_path(path);
726 ret = btrfs_search_slot(trans, root, &file_key, path, 726 ret = btrfs_search_slot(trans, root, &file_key, path,
727 csum_size, 1); 727 csum_size, 1);
728 if (ret < 0) 728 if (ret < 0)
@@ -766,7 +766,7 @@ again:
766 } 766 }
767 767
768insert: 768insert:
769 btrfs_release_path(root, path); 769 btrfs_release_path(path);
770 csum_offset = 0; 770 csum_offset = 0;
771 if (found_next) { 771 if (found_next) {
772 u64 tmp = total_bytes + root->sectorsize; 772 u64 tmp = total_bytes + root->sectorsize;
@@ -850,7 +850,7 @@ next_sector:
850 } 850 }
851 btrfs_mark_buffer_dirty(path->nodes[0]); 851 btrfs_mark_buffer_dirty(path->nodes[0]);
852 if (total_bytes < sums->len) { 852 if (total_bytes < sums->len) {
853 btrfs_release_path(root, path); 853 btrfs_release_path(path);
854 cond_resched(); 854 cond_resched();
855 goto again; 855 goto again;
856 } 856 }
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 80eabe85409a..566bdf298ea8 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -376,7 +376,7 @@ next_slot:
376 376
377 search_start = max(key.offset, start); 377 search_start = max(key.offset, start);
378 if (recow) { 378 if (recow) {
379 btrfs_release_path(root, path); 379 btrfs_release_path(path);
380 continue; 380 continue;
381 } 381 }
382 382
@@ -393,7 +393,7 @@ next_slot:
393 ret = btrfs_duplicate_item(trans, root, path, 393 ret = btrfs_duplicate_item(trans, root, path,
394 &new_key); 394 &new_key);
395 if (ret == -EAGAIN) { 395 if (ret == -EAGAIN) {
396 btrfs_release_path(root, path); 396 btrfs_release_path(path);
397 continue; 397 continue;
398 } 398 }
399 if (ret < 0) 399 if (ret < 0)
@@ -516,7 +516,7 @@ next_slot:
516 del_nr = 0; 516 del_nr = 0;
517 del_slot = 0; 517 del_slot = 0;
518 518
519 btrfs_release_path(root, path); 519 btrfs_release_path(path);
520 continue; 520 continue;
521 } 521 }
522 522
@@ -681,7 +681,7 @@ again:
681 new_key.offset = split; 681 new_key.offset = split;
682 ret = btrfs_duplicate_item(trans, root, path, &new_key); 682 ret = btrfs_duplicate_item(trans, root, path, &new_key);
683 if (ret == -EAGAIN) { 683 if (ret == -EAGAIN) {
684 btrfs_release_path(root, path); 684 btrfs_release_path(path);
685 goto again; 685 goto again;
686 } 686 }
687 BUG_ON(ret < 0); 687 BUG_ON(ret < 0);
@@ -721,7 +721,7 @@ again:
721 inode->i_ino, bytenr, orig_offset, 721 inode->i_ino, bytenr, orig_offset,
722 &other_start, &other_end)) { 722 &other_start, &other_end)) {
723 if (recow) { 723 if (recow) {
724 btrfs_release_path(root, path); 724 btrfs_release_path(path);
725 goto again; 725 goto again;
726 } 726 }
727 extent_end = other_end; 727 extent_end = other_end;
@@ -738,7 +738,7 @@ again:
738 inode->i_ino, bytenr, orig_offset, 738 inode->i_ino, bytenr, orig_offset,
739 &other_start, &other_end)) { 739 &other_start, &other_end)) {
740 if (recow) { 740 if (recow) {
741 btrfs_release_path(root, path); 741 btrfs_release_path(path);
742 goto again; 742 goto again;
743 } 743 }
744 key.offset = other_start; 744 key.offset = other_start;
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index d06abe20a729..48fafcb85b0e 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -61,7 +61,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
61 if (ret < 0) 61 if (ret < 0)
62 return ERR_PTR(ret); 62 return ERR_PTR(ret);
63 if (ret > 0) { 63 if (ret > 0) {
64 btrfs_release_path(root, path); 64 btrfs_release_path(path);
65 return ERR_PTR(-ENOENT); 65 return ERR_PTR(-ENOENT);
66 } 66 }
67 67
@@ -70,7 +70,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
70 struct btrfs_free_space_header); 70 struct btrfs_free_space_header);
71 btrfs_free_space_key(leaf, header, &disk_key); 71 btrfs_free_space_key(leaf, header, &disk_key);
72 btrfs_disk_key_to_cpu(&location, &disk_key); 72 btrfs_disk_key_to_cpu(&location, &disk_key);
73 btrfs_release_path(root, path); 73 btrfs_release_path(path);
74 74
75 inode = btrfs_iget(root->fs_info->sb, &location, root, NULL); 75 inode = btrfs_iget(root->fs_info->sb, &location, root, NULL);
76 if (!inode) 76 if (!inode)
@@ -134,7 +134,7 @@ int create_free_space_inode(struct btrfs_root *root,
134 btrfs_set_inode_block_group(leaf, inode_item, 134 btrfs_set_inode_block_group(leaf, inode_item,
135 block_group->key.objectid); 135 block_group->key.objectid);
136 btrfs_mark_buffer_dirty(leaf); 136 btrfs_mark_buffer_dirty(leaf);
137 btrfs_release_path(root, path); 137 btrfs_release_path(path);
138 138
139 key.objectid = BTRFS_FREE_SPACE_OBJECTID; 139 key.objectid = BTRFS_FREE_SPACE_OBJECTID;
140 key.offset = block_group->key.objectid; 140 key.offset = block_group->key.objectid;
@@ -143,7 +143,7 @@ int create_free_space_inode(struct btrfs_root *root,
143 ret = btrfs_insert_empty_item(trans, root, path, &key, 143 ret = btrfs_insert_empty_item(trans, root, path, &key,
144 sizeof(struct btrfs_free_space_header)); 144 sizeof(struct btrfs_free_space_header));
145 if (ret < 0) { 145 if (ret < 0) {
146 btrfs_release_path(root, path); 146 btrfs_release_path(path);
147 return ret; 147 return ret;
148 } 148 }
149 leaf = path->nodes[0]; 149 leaf = path->nodes[0];
@@ -152,7 +152,7 @@ int create_free_space_inode(struct btrfs_root *root,
152 memset_extent_buffer(leaf, 0, (unsigned long)header, sizeof(*header)); 152 memset_extent_buffer(leaf, 0, (unsigned long)header, sizeof(*header));
153 btrfs_set_free_space_key(leaf, header, &disk_key); 153 btrfs_set_free_space_key(leaf, header, &disk_key);
154 btrfs_mark_buffer_dirty(leaf); 154 btrfs_mark_buffer_dirty(leaf);
155 btrfs_release_path(root, path); 155 btrfs_release_path(path);
156 156
157 return 0; 157 return 0;
158} 158}
@@ -822,7 +822,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
822 EXTENT_DIRTY | EXTENT_DELALLOC | 822 EXTENT_DIRTY | EXTENT_DELALLOC |
823 EXTENT_DO_ACCOUNTING, 0, 0, NULL, 823 EXTENT_DO_ACCOUNTING, 0, 0, NULL,
824 GFP_NOFS); 824 GFP_NOFS);
825 btrfs_release_path(root, path); 825 btrfs_release_path(path);
826 goto out_free; 826 goto out_free;
827 } 827 }
828 } 828 }
@@ -832,7 +832,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
832 btrfs_set_free_space_bitmaps(leaf, header, bitmaps); 832 btrfs_set_free_space_bitmaps(leaf, header, bitmaps);
833 btrfs_set_free_space_generation(leaf, header, trans->transid); 833 btrfs_set_free_space_generation(leaf, header, trans->transid);
834 btrfs_mark_buffer_dirty(leaf); 834 btrfs_mark_buffer_dirty(leaf);
835 btrfs_release_path(root, path); 835 btrfs_release_path(path);
836 836
837 ret = 1; 837 ret = 1;
838 838
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 26f4d56cf049..2840989737b7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1164,7 +1164,7 @@ out_check:
1164 goto next_slot; 1164 goto next_slot;
1165 } 1165 }
1166 1166
1167 btrfs_release_path(root, path); 1167 btrfs_release_path(path);
1168 if (cow_start != (u64)-1) { 1168 if (cow_start != (u64)-1) {
1169 ret = cow_file_range(inode, locked_page, cow_start, 1169 ret = cow_file_range(inode, locked_page, cow_start,
1170 found_key.offset - 1, page_started, 1170 found_key.offset - 1, page_started,
@@ -1222,7 +1222,7 @@ out_check:
1222 if (cur_offset > end) 1222 if (cur_offset > end)
1223 break; 1223 break;
1224 } 1224 }
1225 btrfs_release_path(root, path); 1225 btrfs_release_path(path);
1226 1226
1227 if (cur_offset <= end && cow_start == (u64)-1) 1227 if (cur_offset <= end && cow_start == (u64)-1)
1228 cow_start = cur_offset; 1228 cow_start = cur_offset;
@@ -2346,7 +2346,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
2346 break; 2346 break;
2347 2347
2348 /* release the path since we're done with it */ 2348 /* release the path since we're done with it */
2349 btrfs_release_path(root, path); 2349 btrfs_release_path(path);
2350 2350
2351 /* 2351 /*
2352 * this is where we are basically btrfs_lookup, without the 2352 * this is where we are basically btrfs_lookup, without the
@@ -2712,7 +2712,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
2712 ret = btrfs_delete_one_dir_name(trans, root, path, di); 2712 ret = btrfs_delete_one_dir_name(trans, root, path, di);
2713 if (ret) 2713 if (ret)
2714 goto err; 2714 goto err;
2715 btrfs_release_path(root, path); 2715 btrfs_release_path(path);
2716 2716
2717 ret = btrfs_del_inode_ref(trans, root, name, name_len, 2717 ret = btrfs_del_inode_ref(trans, root, name, name_len,
2718 inode->i_ino, 2718 inode->i_ino,
@@ -2735,7 +2735,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
2735 goto err; 2735 goto err;
2736 } 2736 }
2737 ret = btrfs_delete_one_dir_name(trans, root, path, di); 2737 ret = btrfs_delete_one_dir_name(trans, root, path, di);
2738 btrfs_release_path(root, path); 2738 btrfs_release_path(path);
2739 2739
2740 ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len, 2740 ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len,
2741 inode, dir->i_ino); 2741 inode, dir->i_ino);
@@ -2862,7 +2862,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
2862 } else { 2862 } else {
2863 check_link = 0; 2863 check_link = 0;
2864 } 2864 }
2865 btrfs_release_path(root, path); 2865 btrfs_release_path(path);
2866 2866
2867 ret = btrfs_lookup_inode(trans, root, path, 2867 ret = btrfs_lookup_inode(trans, root, path,
2868 &BTRFS_I(inode)->location, 0); 2868 &BTRFS_I(inode)->location, 0);
@@ -2876,7 +2876,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
2876 } else { 2876 } else {
2877 check_link = 0; 2877 check_link = 0;
2878 } 2878 }
2879 btrfs_release_path(root, path); 2879 btrfs_release_path(path);
2880 2880
2881 if (ret == 0 && S_ISREG(inode->i_mode)) { 2881 if (ret == 0 && S_ISREG(inode->i_mode)) {
2882 ret = btrfs_lookup_file_extent(trans, root, path, 2882 ret = btrfs_lookup_file_extent(trans, root, path,
@@ -2888,7 +2888,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
2888 BUG_ON(ret == 0); 2888 BUG_ON(ret == 0);
2889 if (check_path_shared(root, path)) 2889 if (check_path_shared(root, path))
2890 goto out; 2890 goto out;
2891 btrfs_release_path(root, path); 2891 btrfs_release_path(path);
2892 } 2892 }
2893 2893
2894 if (!check_link) { 2894 if (!check_link) {
@@ -2909,7 +2909,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
2909 err = 0; 2909 err = 0;
2910 goto out; 2910 goto out;
2911 } 2911 }
2912 btrfs_release_path(root, path); 2912 btrfs_release_path(path);
2913 2913
2914 ref = btrfs_lookup_inode_ref(trans, root, path, 2914 ref = btrfs_lookup_inode_ref(trans, root, path,
2915 dentry->d_name.name, dentry->d_name.len, 2915 dentry->d_name.name, dentry->d_name.len,
@@ -2922,7 +2922,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
2922 if (check_path_shared(root, path)) 2922 if (check_path_shared(root, path))
2923 goto out; 2923 goto out;
2924 index = btrfs_inode_ref_index(path->nodes[0], ref); 2924 index = btrfs_inode_ref_index(path->nodes[0], ref);
2925 btrfs_release_path(root, path); 2925 btrfs_release_path(path);
2926 2926
2927 di = btrfs_lookup_dir_index_item(trans, root, path, dir->i_ino, index, 2927 di = btrfs_lookup_dir_index_item(trans, root, path, dir->i_ino, index,
2928 dentry->d_name.name, dentry->d_name.len, 0); 2928 dentry->d_name.name, dentry->d_name.len, 0);
@@ -3013,7 +3013,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
3013 WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid); 3013 WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid);
3014 ret = btrfs_delete_one_dir_name(trans, root, path, di); 3014 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3015 BUG_ON(ret); 3015 BUG_ON(ret);
3016 btrfs_release_path(root, path); 3016 btrfs_release_path(path);
3017 3017
3018 ret = btrfs_del_root_ref(trans, root->fs_info->tree_root, 3018 ret = btrfs_del_root_ref(trans, root->fs_info->tree_root,
3019 objectid, root->root_key.objectid, 3019 objectid, root->root_key.objectid,
@@ -3026,7 +3026,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
3026 3026
3027 leaf = path->nodes[0]; 3027 leaf = path->nodes[0];
3028 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 3028 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
3029 btrfs_release_path(root, path); 3029 btrfs_release_path(path);
3030 index = key.offset; 3030 index = key.offset;
3031 } 3031 }
3032 3032
@@ -3039,7 +3039,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
3039 WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid); 3039 WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid);
3040 ret = btrfs_delete_one_dir_name(trans, root, path, di); 3040 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3041 BUG_ON(ret); 3041 BUG_ON(ret);
3042 btrfs_release_path(root, path); 3042 btrfs_release_path(path);
3043 3043
3044 btrfs_i_size_write(dir, dir->i_size - name_len * 2); 3044 btrfs_i_size_write(dir, dir->i_size - name_len * 2);
3045 dir->i_mtime = dir->i_ctime = CURRENT_TIME; 3045 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
@@ -3477,7 +3477,7 @@ delete:
3477 BUG_ON(ret); 3477 BUG_ON(ret);
3478 pending_del_nr = 0; 3478 pending_del_nr = 0;
3479 } 3479 }
3480 btrfs_release_path(root, path); 3480 btrfs_release_path(path);
3481 goto search_again; 3481 goto search_again;
3482 } else { 3482 } else {
3483 path->slots[0]--; 3483 path->slots[0]--;
@@ -3899,7 +3899,7 @@ static int fixup_tree_root_location(struct btrfs_root *root,
3899 if (ret) 3899 if (ret)
3900 goto out; 3900 goto out;
3901 3901
3902 btrfs_release_path(root->fs_info->tree_root, path); 3902 btrfs_release_path(path);
3903 3903
3904 new_root = btrfs_read_fs_root_no_name(root->fs_info, location); 3904 new_root = btrfs_read_fs_root_no_name(root->fs_info, location);
3905 if (IS_ERR(new_root)) { 3905 if (IS_ERR(new_root)) {
@@ -5223,7 +5223,7 @@ again:
5223 kunmap(page); 5223 kunmap(page);
5224 free_extent_map(em); 5224 free_extent_map(em);
5225 em = NULL; 5225 em = NULL;
5226 btrfs_release_path(root, path); 5226 btrfs_release_path(path);
5227 trans = btrfs_join_transaction(root, 1); 5227 trans = btrfs_join_transaction(root, 1);
5228 if (IS_ERR(trans)) 5228 if (IS_ERR(trans))
5229 return ERR_CAST(trans); 5229 return ERR_CAST(trans);
@@ -5249,7 +5249,7 @@ not_found_em:
5249 em->block_start = EXTENT_MAP_HOLE; 5249 em->block_start = EXTENT_MAP_HOLE;
5250 set_bit(EXTENT_FLAG_VACANCY, &em->flags); 5250 set_bit(EXTENT_FLAG_VACANCY, &em->flags);
5251insert: 5251insert:
5252 btrfs_release_path(root, path); 5252 btrfs_release_path(path);
5253 if (em->start > start || extent_map_end(em) <= start) { 5253 if (em->start > start || extent_map_end(em) <= start) {
5254 printk(KERN_ERR "Btrfs: bad extent! em: [%llu %llu] passed " 5254 printk(KERN_ERR "Btrfs: bad extent! em: [%llu %llu] passed "
5255 "[%llu %llu]\n", (unsigned long long)em->start, 5255 "[%llu %llu]\n", (unsigned long long)em->start,
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index ffb48d6c5433..d11fc6548e15 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1396,7 +1396,7 @@ static noinline int search_ioctl(struct inode *inode,
1396 } 1396 }
1397 ret = copy_to_sk(root, path, &key, sk, args->buf, 1397 ret = copy_to_sk(root, path, &key, sk, args->buf,
1398 &sk_offset, &num_found); 1398 &sk_offset, &num_found);
1399 btrfs_release_path(root, path); 1399 btrfs_release_path(path);
1400 if (ret || num_found >= sk->nr_items) 1400 if (ret || num_found >= sk->nr_items)
1401 break; 1401 break;
1402 1402
@@ -1503,7 +1503,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
1503 if (key.offset == BTRFS_FIRST_FREE_OBJECTID) 1503 if (key.offset == BTRFS_FIRST_FREE_OBJECTID)
1504 break; 1504 break;
1505 1505
1506 btrfs_release_path(root, path); 1506 btrfs_release_path(path);
1507 key.objectid = key.offset; 1507 key.objectid = key.offset;
1508 key.offset = (u64)-1; 1508 key.offset = (u64)-1;
1509 dirid = key.objectid; 1509 dirid = key.objectid;
@@ -1982,7 +1982,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1982 datal = btrfs_file_extent_ram_bytes(leaf, 1982 datal = btrfs_file_extent_ram_bytes(leaf,
1983 extent); 1983 extent);
1984 } 1984 }
1985 btrfs_release_path(root, path); 1985 btrfs_release_path(path);
1986 1986
1987 if (key.offset + datal <= off || 1987 if (key.offset + datal <= off ||
1988 key.offset >= off+len) 1988 key.offset >= off+len)
@@ -2092,7 +2092,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2092 } 2092 }
2093 2093
2094 btrfs_mark_buffer_dirty(leaf); 2094 btrfs_mark_buffer_dirty(leaf);
2095 btrfs_release_path(root, path); 2095 btrfs_release_path(path);
2096 2096
2097 inode->i_mtime = inode->i_ctime = CURRENT_TIME; 2097 inode->i_mtime = inode->i_ctime = CURRENT_TIME;
2098 2098
@@ -2113,12 +2113,12 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2113 btrfs_end_transaction(trans, root); 2113 btrfs_end_transaction(trans, root);
2114 } 2114 }
2115next: 2115next:
2116 btrfs_release_path(root, path); 2116 btrfs_release_path(path);
2117 key.offset++; 2117 key.offset++;
2118 } 2118 }
2119 ret = 0; 2119 ret = 0;
2120out: 2120out:
2121 btrfs_release_path(root, path); 2121 btrfs_release_path(path);
2122 unlock_extent(&BTRFS_I(src)->io_tree, off, off+len, GFP_NOFS); 2122 unlock_extent(&BTRFS_I(src)->io_tree, off, off+len, GFP_NOFS);
2123out_unlock: 2123out_unlock:
2124 mutex_unlock(&src->i_mutex); 2124 mutex_unlock(&src->i_mutex);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 2097a88f60aa..f7b799b151aa 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -961,7 +961,7 @@ again:
961 lower = upper; 961 lower = upper;
962 upper = NULL; 962 upper = NULL;
963 } 963 }
964 btrfs_release_path(root, path2); 964 btrfs_release_path(path2);
965next: 965next:
966 if (ptr < end) { 966 if (ptr < end) {
967 ptr += btrfs_extent_inline_ref_size(key.type); 967 ptr += btrfs_extent_inline_ref_size(key.type);
@@ -974,7 +974,7 @@ next:
974 if (ptr >= end) 974 if (ptr >= end)
975 path1->slots[0]++; 975 path1->slots[0]++;
976 } 976 }
977 btrfs_release_path(rc->extent_root, path1); 977 btrfs_release_path(path1);
978 978
979 cur->checked = 1; 979 cur->checked = 1;
980 WARN_ON(exist); 980 WARN_ON(exist);
@@ -1749,7 +1749,7 @@ again:
1749 1749
1750 btrfs_node_key_to_cpu(path->nodes[level], &key, 1750 btrfs_node_key_to_cpu(path->nodes[level], &key,
1751 path->slots[level]); 1751 path->slots[level]);
1752 btrfs_release_path(src, path); 1752 btrfs_release_path(path);
1753 1753
1754 path->lowest_level = level; 1754 path->lowest_level = level;
1755 ret = btrfs_search_slot(trans, src, &key, path, 0, 1); 1755 ret = btrfs_search_slot(trans, src, &key, path, 0, 1);
@@ -2496,7 +2496,7 @@ static int do_relocation(struct btrfs_trans_handle *trans,
2496 path->locks[upper->level] = 0; 2496 path->locks[upper->level] = 0;
2497 2497
2498 slot = path->slots[upper->level]; 2498 slot = path->slots[upper->level];
2499 btrfs_release_path(NULL, path); 2499 btrfs_release_path(path);
2500 } else { 2500 } else {
2501 ret = btrfs_bin_search(upper->eb, key, upper->level, 2501 ret = btrfs_bin_search(upper->eb, key, upper->level,
2502 &slot); 2502 &slot);
@@ -2737,7 +2737,7 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans,
2737 } else { 2737 } else {
2738 path->lowest_level = node->level; 2738 path->lowest_level = node->level;
2739 ret = btrfs_search_slot(trans, root, key, path, 0, 1); 2739 ret = btrfs_search_slot(trans, root, key, path, 0, 1);
2740 btrfs_release_path(root, path); 2740 btrfs_release_path(path);
2741 if (ret > 0) 2741 if (ret > 0)
2742 ret = 0; 2742 ret = 0;
2743 } 2743 }
@@ -3119,7 +3119,7 @@ static int add_tree_block(struct reloc_control *rc,
3119#endif 3119#endif
3120 } 3120 }
3121 3121
3122 btrfs_release_path(rc->extent_root, path); 3122 btrfs_release_path(path);
3123 3123
3124 BUG_ON(level == -1); 3124 BUG_ON(level == -1);
3125 3125
@@ -3505,7 +3505,7 @@ int add_data_references(struct reloc_control *rc,
3505 } 3505 }
3506 path->slots[0]++; 3506 path->slots[0]++;
3507 } 3507 }
3508 btrfs_release_path(rc->extent_root, path); 3508 btrfs_release_path(path);
3509 if (err) 3509 if (err)
3510 free_block_list(blocks); 3510 free_block_list(blocks);
3511 return err; 3511 return err;
@@ -3568,7 +3568,7 @@ next:
3568 EXTENT_DIRTY); 3568 EXTENT_DIRTY);
3569 3569
3570 if (ret == 0 && start <= key.objectid) { 3570 if (ret == 0 && start <= key.objectid) {
3571 btrfs_release_path(rc->extent_root, path); 3571 btrfs_release_path(path);
3572 rc->search_start = end + 1; 3572 rc->search_start = end + 1;
3573 } else { 3573 } else {
3574 rc->search_start = key.objectid + key.offset; 3574 rc->search_start = key.objectid + key.offset;
@@ -3576,7 +3576,7 @@ next:
3576 return 0; 3576 return 0;
3577 } 3577 }
3578 } 3578 }
3579 btrfs_release_path(rc->extent_root, path); 3579 btrfs_release_path(path);
3580 return ret; 3580 return ret;
3581} 3581}
3582 3582
@@ -3713,7 +3713,7 @@ restart:
3713 flags = BTRFS_EXTENT_FLAG_DATA; 3713 flags = BTRFS_EXTENT_FLAG_DATA;
3714 3714
3715 if (path_change) { 3715 if (path_change) {
3716 btrfs_release_path(rc->extent_root, path); 3716 btrfs_release_path(path);
3717 3717
3718 path->search_commit_root = 1; 3718 path->search_commit_root = 1;
3719 path->skip_locking = 1; 3719 path->skip_locking = 1;
@@ -3736,7 +3736,7 @@ restart:
3736 (flags & BTRFS_EXTENT_FLAG_DATA)) { 3736 (flags & BTRFS_EXTENT_FLAG_DATA)) {
3737 ret = add_data_references(rc, &key, path, &blocks); 3737 ret = add_data_references(rc, &key, path, &blocks);
3738 } else { 3738 } else {
3739 btrfs_release_path(rc->extent_root, path); 3739 btrfs_release_path(path);
3740 ret = 0; 3740 ret = 0;
3741 } 3741 }
3742 if (ret < 0) { 3742 if (ret < 0) {
@@ -3799,7 +3799,7 @@ restart:
3799 } 3799 }
3800 } 3800 }
3801 3801
3802 btrfs_release_path(rc->extent_root, path); 3802 btrfs_release_path(path);
3803 clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, 3803 clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY,
3804 GFP_NOFS); 3804 GFP_NOFS);
3805 3805
@@ -3867,7 +3867,7 @@ static int __insert_orphan_inode(struct btrfs_trans_handle *trans,
3867 btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS | 3867 btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS |
3868 BTRFS_INODE_PREALLOC); 3868 BTRFS_INODE_PREALLOC);
3869 btrfs_mark_buffer_dirty(leaf); 3869 btrfs_mark_buffer_dirty(leaf);
3870 btrfs_release_path(root, path); 3870 btrfs_release_path(path);
3871out: 3871out:
3872 btrfs_free_path(path); 3872 btrfs_free_path(path);
3873 return ret; 3873 return ret;
@@ -4109,7 +4109,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
4109 } 4109 }
4110 leaf = path->nodes[0]; 4110 leaf = path->nodes[0];
4111 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 4111 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
4112 btrfs_release_path(root->fs_info->tree_root, path); 4112 btrfs_release_path(path);
4113 4113
4114 if (key.objectid != BTRFS_TREE_RELOC_OBJECTID || 4114 if (key.objectid != BTRFS_TREE_RELOC_OBJECTID ||
4115 key.type != BTRFS_ROOT_ITEM_KEY) 4115 key.type != BTRFS_ROOT_ITEM_KEY)
@@ -4141,7 +4141,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
4141 4141
4142 key.offset--; 4142 key.offset--;
4143 } 4143 }
4144 btrfs_release_path(root->fs_info->tree_root, path); 4144 btrfs_release_path(path);
4145 4145
4146 if (list_empty(&reloc_roots)) 4146 if (list_empty(&reloc_roots))
4147 goto out; 4147 goto out;
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 6928bff62daa..59a94c1d9815 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -57,7 +57,7 @@ again:
57 btrfs_item_key_to_cpu(path->nodes[0], &search_key, path->slots[0]); 57 btrfs_item_key_to_cpu(path->nodes[0], &search_key, path->slots[0]);
58 if (search_key.type != BTRFS_ROOT_ITEM_KEY) { 58 if (search_key.type != BTRFS_ROOT_ITEM_KEY) {
59 search_key.offset++; 59 search_key.offset++;
60 btrfs_release_path(root, path); 60 btrfs_release_path(path);
61 goto again; 61 goto again;
62 } 62 }
63 ret = 0; 63 ret = 0;
@@ -230,7 +230,7 @@ again:
230 230
231 memcpy(&found_key, &key, sizeof(key)); 231 memcpy(&found_key, &key, sizeof(key));
232 key.offset++; 232 key.offset++;
233 btrfs_release_path(root, path); 233 btrfs_release_path(path);
234 dead_root = 234 dead_root =
235 btrfs_read_fs_root_no_radix(root->fs_info->tree_root, 235 btrfs_read_fs_root_no_radix(root->fs_info->tree_root,
236 &found_key); 236 &found_key);
@@ -292,7 +292,7 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root)
292 } 292 }
293 293
294 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 294 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
295 btrfs_release_path(tree_root, path); 295 btrfs_release_path(path);
296 296
297 if (key.objectid != BTRFS_ORPHAN_OBJECTID || 297 if (key.objectid != BTRFS_ORPHAN_OBJECTID ||
298 key.type != BTRFS_ORPHAN_ITEM_KEY) 298 key.type != BTRFS_ORPHAN_ITEM_KEY)
@@ -390,7 +390,7 @@ again:
390 err = -ENOENT; 390 err = -ENOENT;
391 391
392 if (key.type == BTRFS_ROOT_BACKREF_KEY) { 392 if (key.type == BTRFS_ROOT_BACKREF_KEY) {
393 btrfs_release_path(tree_root, path); 393 btrfs_release_path(path);
394 key.objectid = ref_id; 394 key.objectid = ref_id;
395 key.type = BTRFS_ROOT_REF_KEY; 395 key.type = BTRFS_ROOT_REF_KEY;
396 key.offset = root_id; 396 key.offset = root_id;
@@ -463,7 +463,7 @@ again:
463 btrfs_mark_buffer_dirty(leaf); 463 btrfs_mark_buffer_dirty(leaf);
464 464
465 if (key.type == BTRFS_ROOT_BACKREF_KEY) { 465 if (key.type == BTRFS_ROOT_BACKREF_KEY) {
466 btrfs_release_path(tree_root, path); 466 btrfs_release_path(path);
467 key.objectid = ref_id; 467 key.objectid = ref_id;
468 key.type = BTRFS_ROOT_REF_KEY; 468 key.type = BTRFS_ROOT_REF_KEY;
469 key.offset = root_id; 469 key.offset = root_id;
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c
index 992ab425599d..3b580ee8ab1d 100644
--- a/fs/btrfs/tree-defrag.c
+++ b/fs/btrfs/tree-defrag.c
@@ -97,7 +97,7 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
97 ret = 0; 97 ret = 0;
98 goto out; 98 goto out;
99 } 99 }
100 btrfs_release_path(root, path); 100 btrfs_release_path(path);
101 wret = btrfs_search_slot(trans, root, &key, path, 0, 1); 101 wret = btrfs_search_slot(trans, root, &key, path, 0, 1);
102 102
103 if (wret < 0) { 103 if (wret < 0) {
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index d5313d63f967..c599e8c2a53c 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -333,13 +333,13 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,
333 goto insert; 333 goto insert;
334 334
335 if (item_size == 0) { 335 if (item_size == 0) {
336 btrfs_release_path(root, path); 336 btrfs_release_path(path);
337 return 0; 337 return 0;
338 } 338 }
339 dst_copy = kmalloc(item_size, GFP_NOFS); 339 dst_copy = kmalloc(item_size, GFP_NOFS);
340 src_copy = kmalloc(item_size, GFP_NOFS); 340 src_copy = kmalloc(item_size, GFP_NOFS);
341 if (!dst_copy || !src_copy) { 341 if (!dst_copy || !src_copy) {
342 btrfs_release_path(root, path); 342 btrfs_release_path(path);
343 kfree(dst_copy); 343 kfree(dst_copy);
344 kfree(src_copy); 344 kfree(src_copy);
345 return -ENOMEM; 345 return -ENOMEM;
@@ -361,13 +361,13 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,
361 * sync 361 * sync
362 */ 362 */
363 if (ret == 0) { 363 if (ret == 0) {
364 btrfs_release_path(root, path); 364 btrfs_release_path(path);
365 return 0; 365 return 0;
366 } 366 }
367 367
368 } 368 }
369insert: 369insert:
370 btrfs_release_path(root, path); 370 btrfs_release_path(path);
371 /* try to insert the key into the destination tree */ 371 /* try to insert the key into the destination tree */
372 ret = btrfs_insert_empty_item(trans, root, path, 372 ret = btrfs_insert_empty_item(trans, root, path,
373 key, item_size); 373 key, item_size);
@@ -438,7 +438,7 @@ insert:
438 } 438 }
439no_copy: 439no_copy:
440 btrfs_mark_buffer_dirty(path->nodes[0]); 440 btrfs_mark_buffer_dirty(path->nodes[0]);
441 btrfs_release_path(root, path); 441 btrfs_release_path(path);
442 return 0; 442 return 0;
443} 443}
444 444
@@ -544,11 +544,11 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
544 * we don't have to do anything 544 * we don't have to do anything
545 */ 545 */
546 if (memcmp(&cmp1, &cmp2, sizeof(cmp1)) == 0) { 546 if (memcmp(&cmp1, &cmp2, sizeof(cmp1)) == 0) {
547 btrfs_release_path(root, path); 547 btrfs_release_path(path);
548 goto out; 548 goto out;
549 } 549 }
550 } 550 }
551 btrfs_release_path(root, path); 551 btrfs_release_path(path);
552 552
553 saved_nbytes = inode_get_bytes(inode); 553 saved_nbytes = inode_get_bytes(inode);
554 /* drop any overlapping extents */ 554 /* drop any overlapping extents */
@@ -600,7 +600,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
600 key->objectid, offset, &ins); 600 key->objectid, offset, &ins);
601 BUG_ON(ret); 601 BUG_ON(ret);
602 } 602 }
603 btrfs_release_path(root, path); 603 btrfs_release_path(path);
604 604
605 if (btrfs_file_extent_compression(eb, item)) { 605 if (btrfs_file_extent_compression(eb, item)) {
606 csum_start = ins.objectid; 606 csum_start = ins.objectid;
@@ -629,7 +629,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
629 kfree(sums); 629 kfree(sums);
630 } 630 }
631 } else { 631 } else {
632 btrfs_release_path(root, path); 632 btrfs_release_path(path);
633 } 633 }
634 } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { 634 } else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
635 /* inline extents are easy, we just overwrite them */ 635 /* inline extents are easy, we just overwrite them */
@@ -675,7 +675,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
675 return -ENOMEM; 675 return -ENOMEM;
676 676
677 read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len); 677 read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len);
678 btrfs_release_path(root, path); 678 btrfs_release_path(path);
679 679
680 inode = read_one_inode(root, location.objectid); 680 inode = read_one_inode(root, location.objectid);
681 BUG_ON(!inode); 681 BUG_ON(!inode);
@@ -713,7 +713,7 @@ static noinline int inode_in_dir(struct btrfs_root *root,
713 goto out; 713 goto out;
714 } else 714 } else
715 goto out; 715 goto out;
716 btrfs_release_path(root, path); 716 btrfs_release_path(path);
717 717
718 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); 718 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0);
719 if (di && !IS_ERR(di)) { 719 if (di && !IS_ERR(di)) {
@@ -724,7 +724,7 @@ static noinline int inode_in_dir(struct btrfs_root *root,
724 goto out; 724 goto out;
725 match = 1; 725 match = 1;
726out: 726out:
727 btrfs_release_path(root, path); 727 btrfs_release_path(path);
728 return match; 728 return match;
729} 729}
730 730
@@ -884,7 +884,7 @@ again:
884 if (!backref_in_log(log, key, victim_name, 884 if (!backref_in_log(log, key, victim_name,
885 victim_name_len)) { 885 victim_name_len)) {
886 btrfs_inc_nlink(inode); 886 btrfs_inc_nlink(inode);
887 btrfs_release_path(root, path); 887 btrfs_release_path(path);
888 888
889 ret = btrfs_unlink_inode(trans, root, dir, 889 ret = btrfs_unlink_inode(trans, root, dir,
890 inode, victim_name, 890 inode, victim_name,
@@ -901,7 +901,7 @@ again:
901 */ 901 */
902 search_done = 1; 902 search_done = 1;
903 } 903 }
904 btrfs_release_path(root, path); 904 btrfs_release_path(path);
905 905
906insert: 906insert:
907 /* insert our name */ 907 /* insert our name */
@@ -922,7 +922,7 @@ out:
922 BUG_ON(ret); 922 BUG_ON(ret);
923 923
924out_nowrite: 924out_nowrite:
925 btrfs_release_path(root, path); 925 btrfs_release_path(path);
926 iput(dir); 926 iput(dir);
927 iput(inode); 927 iput(inode);
928 return 0; 928 return 0;
@@ -999,9 +999,9 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans,
999 if (key.offset == 0) 999 if (key.offset == 0)
1000 break; 1000 break;
1001 key.offset--; 1001 key.offset--;
1002 btrfs_release_path(root, path); 1002 btrfs_release_path(path);
1003 } 1003 }
1004 btrfs_release_path(root, path); 1004 btrfs_release_path(path);
1005 if (nlink != inode->i_nlink) { 1005 if (nlink != inode->i_nlink) {
1006 inode->i_nlink = nlink; 1006 inode->i_nlink = nlink;
1007 btrfs_update_inode(trans, root, inode); 1007 btrfs_update_inode(trans, root, inode);
@@ -1052,7 +1052,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
1052 ret = btrfs_del_item(trans, root, path); 1052 ret = btrfs_del_item(trans, root, path);
1053 BUG_ON(ret); 1053 BUG_ON(ret);
1054 1054
1055 btrfs_release_path(root, path); 1055 btrfs_release_path(path);
1056 inode = read_one_inode(root, key.offset); 1056 inode = read_one_inode(root, key.offset);
1057 BUG_ON(!inode); 1057 BUG_ON(!inode);
1058 1058
@@ -1068,7 +1068,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
1068 */ 1068 */
1069 key.offset = (u64)-1; 1069 key.offset = (u64)-1;
1070 } 1070 }
1071 btrfs_release_path(root, path); 1071 btrfs_release_path(path);
1072 return 0; 1072 return 0;
1073} 1073}
1074 1074
@@ -1096,7 +1096,7 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
1096 1096
1097 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); 1097 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
1098 1098
1099 btrfs_release_path(root, path); 1099 btrfs_release_path(path);
1100 if (ret == 0) { 1100 if (ret == 0) {
1101 btrfs_inc_nlink(inode); 1101 btrfs_inc_nlink(inode);
1102 btrfs_update_inode(trans, root, inode); 1102 btrfs_update_inode(trans, root, inode);
@@ -1192,7 +1192,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1192 exists = 1; 1192 exists = 1;
1193 else 1193 else
1194 exists = 0; 1194 exists = 0;
1195 btrfs_release_path(root, path); 1195 btrfs_release_path(path);
1196 1196
1197 if (key->type == BTRFS_DIR_ITEM_KEY) { 1197 if (key->type == BTRFS_DIR_ITEM_KEY) {
1198 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, 1198 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid,
@@ -1236,13 +1236,13 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1236 if (key->type == BTRFS_DIR_INDEX_KEY) 1236 if (key->type == BTRFS_DIR_INDEX_KEY)
1237 goto insert; 1237 goto insert;
1238out: 1238out:
1239 btrfs_release_path(root, path); 1239 btrfs_release_path(path);
1240 kfree(name); 1240 kfree(name);
1241 iput(dir); 1241 iput(dir);
1242 return 0; 1242 return 0;
1243 1243
1244insert: 1244insert:
1245 btrfs_release_path(root, path); 1245 btrfs_release_path(path);
1246 ret = insert_one_name(trans, root, path, key->objectid, key->offset, 1246 ret = insert_one_name(trans, root, path, key->objectid, key->offset,
1247 name, name_len, log_type, &log_key); 1247 name, name_len, log_type, &log_key);
1248 1248
@@ -1363,7 +1363,7 @@ next:
1363 *end_ret = found_end; 1363 *end_ret = found_end;
1364 ret = 0; 1364 ret = 0;
1365out: 1365out:
1366 btrfs_release_path(root, path); 1366 btrfs_release_path(path);
1367 return ret; 1367 return ret;
1368} 1368}
1369 1369
@@ -1428,8 +1428,8 @@ again:
1428 } 1428 }
1429 if (IS_ERR_OR_NULL(log_di)) { 1429 if (IS_ERR_OR_NULL(log_di)) {
1430 btrfs_dir_item_key_to_cpu(eb, di, &location); 1430 btrfs_dir_item_key_to_cpu(eb, di, &location);
1431 btrfs_release_path(root, path); 1431 btrfs_release_path(path);
1432 btrfs_release_path(log, log_path); 1432 btrfs_release_path(log_path);
1433 inode = read_one_inode(root, location.objectid); 1433 inode = read_one_inode(root, location.objectid);
1434 BUG_ON(!inode); 1434 BUG_ON(!inode);
1435 1435
@@ -1453,7 +1453,7 @@ again:
1453 ret = 0; 1453 ret = 0;
1454 goto out; 1454 goto out;
1455 } 1455 }
1456 btrfs_release_path(log, log_path); 1456 btrfs_release_path(log_path);
1457 kfree(name); 1457 kfree(name);
1458 1458
1459 ptr = (unsigned long)(di + 1); 1459 ptr = (unsigned long)(di + 1);
@@ -1461,8 +1461,8 @@ again:
1461 } 1461 }
1462 ret = 0; 1462 ret = 0;
1463out: 1463out:
1464 btrfs_release_path(root, path); 1464 btrfs_release_path(path);
1465 btrfs_release_path(log, log_path); 1465 btrfs_release_path(log_path);
1466 return ret; 1466 return ret;
1467} 1467}
1468 1468
@@ -1550,7 +1550,7 @@ again:
1550 break; 1550 break;
1551 dir_key.offset = found_key.offset + 1; 1551 dir_key.offset = found_key.offset + 1;
1552 } 1552 }
1553 btrfs_release_path(root, path); 1553 btrfs_release_path(path);
1554 if (range_end == (u64)-1) 1554 if (range_end == (u64)-1)
1555 break; 1555 break;
1556 range_start = range_end + 1; 1556 range_start = range_end + 1;
@@ -1561,11 +1561,11 @@ next_type:
1561 if (key_type == BTRFS_DIR_LOG_ITEM_KEY) { 1561 if (key_type == BTRFS_DIR_LOG_ITEM_KEY) {
1562 key_type = BTRFS_DIR_LOG_INDEX_KEY; 1562 key_type = BTRFS_DIR_LOG_INDEX_KEY;
1563 dir_key.type = BTRFS_DIR_INDEX_KEY; 1563 dir_key.type = BTRFS_DIR_INDEX_KEY;
1564 btrfs_release_path(root, path); 1564 btrfs_release_path(path);
1565 goto again; 1565 goto again;
1566 } 1566 }
1567out: 1567out:
1568 btrfs_release_path(root, path); 1568 btrfs_release_path(path);
1569 btrfs_free_path(log_path); 1569 btrfs_free_path(log_path);
1570 iput(dir); 1570 iput(dir);
1571 return ret; 1571 return ret;
@@ -2225,7 +2225,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2225 bytes_del += name_len; 2225 bytes_del += name_len;
2226 BUG_ON(ret); 2226 BUG_ON(ret);
2227 } 2227 }
2228 btrfs_release_path(log, path); 2228 btrfs_release_path(path);
2229 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino, 2229 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino,
2230 index, name, name_len, -1); 2230 index, name, name_len, -1);
2231 if (IS_ERR(di)) { 2231 if (IS_ERR(di)) {
@@ -2247,7 +2247,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2247 key.objectid = dir->i_ino; 2247 key.objectid = dir->i_ino;
2248 key.offset = 0; 2248 key.offset = 0;
2249 key.type = BTRFS_INODE_ITEM_KEY; 2249 key.type = BTRFS_INODE_ITEM_KEY;
2250 btrfs_release_path(log, path); 2250 btrfs_release_path(path);
2251 2251
2252 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); 2252 ret = btrfs_search_slot(trans, log, &key, path, 0, 1);
2253 if (ret < 0) { 2253 if (ret < 0) {
@@ -2269,7 +2269,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2269 btrfs_mark_buffer_dirty(path->nodes[0]); 2269 btrfs_mark_buffer_dirty(path->nodes[0]);
2270 } else 2270 } else
2271 ret = 0; 2271 ret = 0;
2272 btrfs_release_path(log, path); 2272 btrfs_release_path(path);
2273 } 2273 }
2274fail: 2274fail:
2275 btrfs_free_path(path); 2275 btrfs_free_path(path);
@@ -2344,7 +2344,7 @@ static noinline int insert_dir_log_key(struct btrfs_trans_handle *trans,
2344 struct btrfs_dir_log_item); 2344 struct btrfs_dir_log_item);
2345 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); 2345 btrfs_set_dir_log_end(path->nodes[0], item, last_offset);
2346 btrfs_mark_buffer_dirty(path->nodes[0]); 2346 btrfs_mark_buffer_dirty(path->nodes[0]);
2347 btrfs_release_path(log, path); 2347 btrfs_release_path(path);
2348 return 0; 2348 return 0;
2349} 2349}
2350 2350
@@ -2393,10 +2393,10 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2393 min_key.objectid = inode->i_ino; 2393 min_key.objectid = inode->i_ino;
2394 min_key.type = key_type; 2394 min_key.type = key_type;
2395 min_key.offset = (u64)-1; 2395 min_key.offset = (u64)-1;
2396 btrfs_release_path(root, path); 2396 btrfs_release_path(path);
2397 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 2397 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
2398 if (ret < 0) { 2398 if (ret < 0) {
2399 btrfs_release_path(root, path); 2399 btrfs_release_path(path);
2400 return ret; 2400 return ret;
2401 } 2401 }
2402 ret = btrfs_previous_item(root, path, inode->i_ino, key_type); 2402 ret = btrfs_previous_item(root, path, inode->i_ino, key_type);
@@ -2432,7 +2432,7 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2432 } 2432 }
2433 } 2433 }
2434 } 2434 }
2435 btrfs_release_path(root, path); 2435 btrfs_release_path(path);
2436 2436
2437 /* find the first key from this transaction again */ 2437 /* find the first key from this transaction again */
2438 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 2438 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
@@ -2490,8 +2490,8 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2490 } 2490 }
2491 } 2491 }
2492done: 2492done:
2493 btrfs_release_path(root, path); 2493 btrfs_release_path(path);
2494 btrfs_release_path(log, dst_path); 2494 btrfs_release_path(dst_path);
2495 2495
2496 if (err == 0) { 2496 if (err == 0) {
2497 *last_offset_ret = last_offset; 2497 *last_offset_ret = last_offset;
@@ -2588,9 +2588,9 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans,
2588 2588
2589 ret = btrfs_del_item(trans, log, path); 2589 ret = btrfs_del_item(trans, log, path);
2590 BUG_ON(ret); 2590 BUG_ON(ret);
2591 btrfs_release_path(log, path); 2591 btrfs_release_path(path);
2592 } 2592 }
2593 btrfs_release_path(log, path); 2593 btrfs_release_path(path);
2594 return ret; 2594 return ret;
2595} 2595}
2596 2596
@@ -2696,7 +2696,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
2696 } 2696 }
2697 2697
2698 btrfs_mark_buffer_dirty(dst_path->nodes[0]); 2698 btrfs_mark_buffer_dirty(dst_path->nodes[0]);
2699 btrfs_release_path(log, dst_path); 2699 btrfs_release_path(dst_path);
2700 kfree(ins_data); 2700 kfree(ins_data);
2701 2701
2702 /* 2702 /*
@@ -2845,7 +2845,7 @@ next_slot:
2845 } 2845 }
2846 ins_nr = 0; 2846 ins_nr = 0;
2847 } 2847 }
2848 btrfs_release_path(root, path); 2848 btrfs_release_path(path);
2849 2849
2850 if (min_key.offset < (u64)-1) 2850 if (min_key.offset < (u64)-1)
2851 min_key.offset++; 2851 min_key.offset++;
@@ -2868,8 +2868,8 @@ next_slot:
2868 } 2868 }
2869 WARN_ON(ins_nr); 2869 WARN_ON(ins_nr);
2870 if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) { 2870 if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
2871 btrfs_release_path(root, path); 2871 btrfs_release_path(path);
2872 btrfs_release_path(log, dst_path); 2872 btrfs_release_path(dst_path);
2873 ret = log_directory_changes(trans, root, inode, path, dst_path); 2873 ret = log_directory_changes(trans, root, inode, path, dst_path);
2874 if (ret) { 2874 if (ret) {
2875 err = ret; 2875 err = ret;
@@ -3136,7 +3136,7 @@ again:
3136 } 3136 }
3137 btrfs_item_key_to_cpu(path->nodes[0], &found_key, 3137 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
3138 path->slots[0]); 3138 path->slots[0]);
3139 btrfs_release_path(log_root_tree, path); 3139 btrfs_release_path(path);
3140 if (found_key.objectid != BTRFS_TREE_LOG_OBJECTID) 3140 if (found_key.objectid != BTRFS_TREE_LOG_OBJECTID)
3141 break; 3141 break;
3142 3142
@@ -3171,7 +3171,7 @@ again:
3171 if (found_key.offset == 0) 3171 if (found_key.offset == 0)
3172 break; 3172 break;
3173 } 3173 }
3174 btrfs_release_path(log_root_tree, path); 3174 btrfs_release_path(path);
3175 3175
3176 /* step one is to pin it all, step two is to replay just inodes */ 3176 /* step one is to pin it all, step two is to replay just inodes */
3177 if (wc.pin) { 3177 if (wc.pin) {
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 76acd1d235e4..e21130d3f98a 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1475,7 +1475,7 @@ next_slot:
1475 goto error; 1475 goto error;
1476 leaf = path->nodes[0]; 1476 leaf = path->nodes[0];
1477 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 1477 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
1478 btrfs_release_path(root, path); 1478 btrfs_release_path(path);
1479 continue; 1479 continue;
1480 } 1480 }
1481 1481
@@ -1947,7 +1947,7 @@ again:
1947 chunk = btrfs_item_ptr(leaf, path->slots[0], 1947 chunk = btrfs_item_ptr(leaf, path->slots[0],
1948 struct btrfs_chunk); 1948 struct btrfs_chunk);
1949 chunk_type = btrfs_chunk_type(leaf, chunk); 1949 chunk_type = btrfs_chunk_type(leaf, chunk);
1950 btrfs_release_path(chunk_root, path); 1950 btrfs_release_path(path);
1951 1951
1952 if (chunk_type & BTRFS_BLOCK_GROUP_SYSTEM) { 1952 if (chunk_type & BTRFS_BLOCK_GROUP_SYSTEM) {
1953 ret = btrfs_relocate_chunk(chunk_root, chunk_tree, 1953 ret = btrfs_relocate_chunk(chunk_root, chunk_tree,
@@ -2065,7 +2065,7 @@ int btrfs_balance(struct btrfs_root *dev_root)
2065 if (found_key.offset == 0) 2065 if (found_key.offset == 0)
2066 break; 2066 break;
2067 2067
2068 btrfs_release_path(chunk_root, path); 2068 btrfs_release_path(path);
2069 ret = btrfs_relocate_chunk(chunk_root, 2069 ret = btrfs_relocate_chunk(chunk_root,
2070 chunk_root->root_key.objectid, 2070 chunk_root->root_key.objectid,
2071 found_key.objectid, 2071 found_key.objectid,
@@ -2137,7 +2137,7 @@ again:
2137 goto done; 2137 goto done;
2138 if (ret) { 2138 if (ret) {
2139 ret = 0; 2139 ret = 0;
2140 btrfs_release_path(root, path); 2140 btrfs_release_path(path);
2141 break; 2141 break;
2142 } 2142 }
2143 2143
@@ -2146,7 +2146,7 @@ again:
2146 btrfs_item_key_to_cpu(l, &key, path->slots[0]); 2146 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
2147 2147
2148 if (key.objectid != device->devid) { 2148 if (key.objectid != device->devid) {
2149 btrfs_release_path(root, path); 2149 btrfs_release_path(path);
2150 break; 2150 break;
2151 } 2151 }
2152 2152
@@ -2154,14 +2154,14 @@ again:
2154 length = btrfs_dev_extent_length(l, dev_extent); 2154 length = btrfs_dev_extent_length(l, dev_extent);
2155 2155
2156 if (key.offset + length <= new_size) { 2156 if (key.offset + length <= new_size) {
2157 btrfs_release_path(root, path); 2157 btrfs_release_path(path);
2158 break; 2158 break;
2159 } 2159 }
2160 2160
2161 chunk_tree = btrfs_dev_extent_chunk_tree(l, dev_extent); 2161 chunk_tree = btrfs_dev_extent_chunk_tree(l, dev_extent);
2162 chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent); 2162 chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent);
2163 chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent); 2163 chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent);
2164 btrfs_release_path(root, path); 2164 btrfs_release_path(path);
2165 2165
2166 ret = btrfs_relocate_chunk(root, chunk_tree, chunk_objectid, 2166 ret = btrfs_relocate_chunk(root, chunk_tree, chunk_objectid,
2167 chunk_offset); 2167 chunk_offset);
@@ -3813,7 +3813,7 @@ again:
3813 } 3813 }
3814 if (key.objectid == BTRFS_DEV_ITEMS_OBJECTID) { 3814 if (key.objectid == BTRFS_DEV_ITEMS_OBJECTID) {
3815 key.objectid = 0; 3815 key.objectid = 0;
3816 btrfs_release_path(root, path); 3816 btrfs_release_path(path);
3817 goto again; 3817 goto again;
3818 } 3818 }
3819 ret = 0; 3819 ret = 0;
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index cfd660550ded..4ca88d1e18e2 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -120,13 +120,13 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
120 120
121 ret = btrfs_delete_one_dir_name(trans, root, path, di); 121 ret = btrfs_delete_one_dir_name(trans, root, path, di);
122 BUG_ON(ret); 122 BUG_ON(ret);
123 btrfs_release_path(root, path); 123 btrfs_release_path(path);
124 124
125 /* if we don't have a value then we are removing the xattr */ 125 /* if we don't have a value then we are removing the xattr */
126 if (!value) 126 if (!value)
127 goto out; 127 goto out;
128 } else { 128 } else {
129 btrfs_release_path(root, path); 129 btrfs_release_path(path);
130 130
131 if (flags & XATTR_REPLACE) { 131 if (flags & XATTR_REPLACE) {
132 /* we couldn't find the attr to replace */ 132 /* we couldn't find the attr to replace */