Commit b3b4aa74 authored by David Sterba's avatar David Sterba

btrfs: drop unused parameter from btrfs_release_path

parameter tree root it's not used since commit
5f39d397 ("Btrfs: Create extent_buffer
interface for large blocksizes")
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent ba144192
......@@ -107,7 +107,7 @@ void btrfs_free_path(struct btrfs_path *p)
{
if (!p)
return;
btrfs_release_path(NULL, p);
btrfs_release_path(p);
kmem_cache_free(btrfs_path_cachep, p);
}
......@@ -117,7 +117,7 @@ void btrfs_free_path(struct btrfs_path *p)
*
* It is safe to call this on paths that no locks or extent buffers held.
*/
noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
noinline void btrfs_release_path(struct btrfs_path *p)
{
int i;
......@@ -1328,7 +1328,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
ret = -EAGAIN;
/* release the whole path */
btrfs_release_path(root, path);
btrfs_release_path(path);
/* read the blocks */
if (block1)
......@@ -1475,7 +1475,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
return 0;
}
free_extent_buffer(tmp);
btrfs_release_path(NULL, p);
btrfs_release_path(p);
return -EIO;
}
}
......@@ -1494,7 +1494,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
if (p->reada)
reada_for_search(root, p, level, slot, key->objectid);
btrfs_release_path(NULL, p);
btrfs_release_path(p);
ret = -EAGAIN;
tmp = read_tree_block(root, blocknr, blocksize, 0);
......@@ -1563,7 +1563,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans,
}
b = p->nodes[level];
if (!b) {
btrfs_release_path(NULL, p);
btrfs_release_path(p);
goto again;
}
BUG_ON(btrfs_header_nritems(b) == 1);
......@@ -1753,7 +1753,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
if (!p->leave_spinning)
btrfs_set_path_blocking(p);
if (ret < 0)
btrfs_release_path(root, p);
btrfs_release_path(p);
return ret;
}
......@@ -3026,7 +3026,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
struct btrfs_file_extent_item);
extent_len = btrfs_file_extent_num_bytes(leaf, fi);
}
btrfs_release_path(root, path);
btrfs_release_path(path);
path->keep_locks = 1;
path->search_for_split = 1;
......@@ -3948,7 +3948,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
else
return 1;
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
return ret;
......@@ -4072,7 +4072,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
sret = btrfs_find_next_key(root, path, min_key, level,
cache_only, min_trans);
if (sret == 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
} else {
goto out;
......@@ -4151,7 +4151,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
btrfs_node_key_to_cpu(c, &cur_key, slot);
orig_lowest = path->lowest_level;
btrfs_release_path(root, path);
btrfs_release_path(path);
path->lowest_level = level;
ret = btrfs_search_slot(NULL, root, &cur_key, path,
0, 0);
......@@ -4228,7 +4228,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
again:
level = 1;
next = NULL;
btrfs_release_path(root, path);
btrfs_release_path(path);
path->keep_locks = 1;
......@@ -4284,7 +4284,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
goto again;
if (ret < 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto done;
}
......@@ -4323,7 +4323,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
goto again;
if (ret < 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto done;
}
......
......@@ -2290,7 +2290,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *parent,
int start_slot, int cache_only, u64 *last_ret,
struct btrfs_key *progress);
void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
void btrfs_release_path(struct btrfs_path *p);
struct btrfs_path *btrfs_alloc_path(void);
void btrfs_free_path(struct btrfs_path *p);
void btrfs_set_path_blocking(struct btrfs_path *p);
......
......@@ -172,7 +172,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
ret = 0;
goto out_free;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
key.offset = index;
......
......@@ -379,7 +379,7 @@ static int caching_kthread(void *data)
break;
caching_ctl->progress = last;
btrfs_release_path(extent_root, path);
btrfs_release_path(path);
up_read(&fs_info->extent_commit_sem);
mutex_unlock(&caching_ctl->mutex);
if (btrfs_transaction_in_commit(fs_info))
......@@ -754,7 +754,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
atomic_inc(&head->node.refs);
spin_unlock(&delayed_refs->lock);
btrfs_release_path(root->fs_info->extent_root, path);
btrfs_release_path(path);
mutex_lock(&head->mutex);
mutex_unlock(&head->mutex);
......@@ -934,7 +934,7 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
break;
}
}
btrfs_release_path(root, path);
btrfs_release_path(path);
if (owner < BTRFS_FIRST_FREE_OBJECTID)
new_size += sizeof(*bi);
......@@ -1042,7 +1042,7 @@ static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
return 0;
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
key.type = BTRFS_EXTENT_REF_V0_KEY;
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret < 0) {
err = ret;
......@@ -1080,7 +1080,7 @@ static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
if (match_extent_data_ref(leaf, ref, root_objectid,
owner, offset)) {
if (recow) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
err = 0;
......@@ -1141,7 +1141,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
if (match_extent_data_ref(leaf, ref, root_objectid,
owner, offset))
break;
btrfs_release_path(root, path);
btrfs_release_path(path);
key.offset++;
ret = btrfs_insert_empty_item(trans, root, path, &key,
size);
......@@ -1167,7 +1167,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);
ret = 0;
fail:
btrfs_release_path(root, path);
btrfs_release_path(path);
return ret;
}
......@@ -1293,7 +1293,7 @@ static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
ret = -ENOENT;
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
if (ret == -ENOENT && parent) {
btrfs_release_path(root, path);
btrfs_release_path(path);
key.type = BTRFS_EXTENT_REF_V0_KEY;
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret > 0)
......@@ -1322,7 +1322,7 @@ static noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
}
ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
btrfs_release_path(root, path);
btrfs_release_path(path);
return ret;
}
......@@ -1608,7 +1608,7 @@ static int lookup_extent_backref(struct btrfs_trans_handle *trans,
if (ret != -ENOENT)
return ret;
btrfs_release_path(root, path);
btrfs_release_path(path);
*ref_ret = NULL;
if (owner < BTRFS_FIRST_FREE_OBJECTID) {
......@@ -1862,7 +1862,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
__run_delayed_extent_op(extent_op, leaf, item);
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root->fs_info->extent_root, path);
btrfs_release_path(path);
path->reada = 1;
path->leave_spinning = 1;
......@@ -2361,7 +2361,7 @@ static noinline int check_delayed_ref(struct btrfs_trans_handle *trans,
atomic_inc(&head->node.refs);
spin_unlock(&delayed_refs->lock);
btrfs_release_path(root->fs_info->extent_root, path);
btrfs_release_path(path);
mutex_lock(&head->mutex);
mutex_unlock(&head->mutex);
......@@ -2732,7 +2732,7 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item));
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(extent_root, path);
btrfs_release_path(path);
fail:
if (ret)
return ret;
......@@ -2785,7 +2785,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
inode = lookup_free_space_inode(root, block_group, path);
if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
ret = PTR_ERR(inode);
btrfs_release_path(root, path);
btrfs_release_path(path);
goto out;
}
......@@ -2854,7 +2854,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
out_put:
iput(inode);
out_free:
btrfs_release_path(root, path);
btrfs_release_path(path);
out:
spin_lock(&block_group->lock);
block_group->disk_cache_state = dcs;
......@@ -4541,7 +4541,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
NULL, refs_to_drop,
is_data);
BUG_ON(ret);
btrfs_release_path(extent_root, path);
btrfs_release_path(path);
path->leave_spinning = 1;
key.objectid = bytenr;
......@@ -4580,7 +4580,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
owner_objectid, 0);
BUG_ON(ret < 0);
btrfs_release_path(extent_root, path);
btrfs_release_path(path);
path->leave_spinning = 1;
key.objectid = bytenr;
......@@ -4650,7 +4650,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
num_to_del);
BUG_ON(ret);
btrfs_release_path(extent_root, path);
btrfs_release_path(path);
if (is_data) {
ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
......@@ -6480,7 +6480,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
trans->block_rsv = block_rsv;
}
}
btrfs_release_path(root, path);
btrfs_release_path(path);
BUG_ON(err);
ret = btrfs_del_root(trans, tree_root, &root->root_key);
......@@ -8580,7 +8580,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
memcpy(&cache->key, &found_key, sizeof(found_key));
key.objectid = found_key.objectid + found_key.offset;
btrfs_release_path(root, path);
btrfs_release_path(path);
cache->flags = btrfs_block_group_flags(&cache->item);
cache->sectorsize = root->sectorsize;
......@@ -8802,12 +8802,12 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
if (ret < 0)
goto out;
if (ret > 0)
btrfs_release_path(tree_root, path);
btrfs_release_path(path);
if (ret == 0) {
ret = btrfs_del_item(trans, tree_root, path);
if (ret)
goto out;
btrfs_release_path(tree_root, path);
btrfs_release_path(path);
}
spin_lock(&root->fs_info->block_group_cache_lock);
......
......@@ -193,7 +193,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
u32 item_size;
if (item)
btrfs_release_path(root, path);
btrfs_release_path(path);
item = btrfs_lookup_csum(NULL, root->fs_info->csum_root,
path, disk_bytenr, 0);
if (IS_ERR(item)) {
......@@ -213,7 +213,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
(unsigned long long)offset);
}
item = NULL;
btrfs_release_path(root, path);
btrfs_release_path(path);
goto found;
}
btrfs_item_key_to_cpu(path->nodes[0], &found_key,
......@@ -631,7 +631,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
if (key.offset < bytenr)
break;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
}
out:
btrfs_free_path(path);
......@@ -722,7 +722,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
* at this point, we know the tree has an item, but it isn't big
* enough yet to put our csum in. Grow it
*/
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_search_slot(trans, root, &file_key, path,
csum_size, 1);
if (ret < 0)
......@@ -766,7 +766,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
}
insert:
btrfs_release_path(root, path);
btrfs_release_path(path);
csum_offset = 0;
if (found_next) {
u64 tmp = total_bytes + root->sectorsize;
......@@ -850,7 +850,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
}
btrfs_mark_buffer_dirty(path->nodes[0]);
if (total_bytes < sums->len) {
btrfs_release_path(root, path);
btrfs_release_path(path);
cond_resched();
goto again;
}
......
......@@ -376,7 +376,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
search_start = max(key.offset, start);
if (recow) {
btrfs_release_path(root, path);
btrfs_release_path(path);
continue;
}
......@@ -393,7 +393,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
ret = btrfs_duplicate_item(trans, root, path,
&new_key);
if (ret == -EAGAIN) {
btrfs_release_path(root, path);
btrfs_release_path(path);
continue;
}
if (ret < 0)
......@@ -516,7 +516,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
del_nr = 0;
del_slot = 0;
btrfs_release_path(root, path);
btrfs_release_path(path);
continue;
}
......@@ -681,7 +681,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
new_key.offset = split;
ret = btrfs_duplicate_item(trans, root, path, &new_key);
if (ret == -EAGAIN) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
BUG_ON(ret < 0);
......@@ -721,7 +721,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
inode->i_ino, bytenr, orig_offset,
&other_start, &other_end)) {
if (recow) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
extent_end = other_end;
......@@ -738,7 +738,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
inode->i_ino, bytenr, orig_offset,
&other_start, &other_end)) {
if (recow) {
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
key.offset = other_start;
......
......@@ -61,7 +61,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
if (ret < 0)
return ERR_PTR(ret);
if (ret > 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
return ERR_PTR(-ENOENT);
}
......@@ -70,7 +70,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
struct btrfs_free_space_header);
btrfs_free_space_key(leaf, header, &disk_key);
btrfs_disk_key_to_cpu(&location, &disk_key);
btrfs_release_path(root, path);
btrfs_release_path(path);
inode = btrfs_iget(root->fs_info->sb, &location, root, NULL);
if (!inode)
......@@ -134,7 +134,7 @@ int create_free_space_inode(struct btrfs_root *root,
btrfs_set_inode_block_group(leaf, inode_item,
block_group->key.objectid);
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
btrfs_release_path(path);
key.objectid = BTRFS_FREE_SPACE_OBJECTID;
key.offset = block_group->key.objectid;
......@@ -143,7 +143,7 @@ int create_free_space_inode(struct btrfs_root *root,
ret = btrfs_insert_empty_item(trans, root, path, &key,
sizeof(struct btrfs_free_space_header));
if (ret < 0) {
btrfs_release_path(root, path);
btrfs_release_path(path);
return ret;
}
leaf = path->nodes[0];
......@@ -152,7 +152,7 @@ int create_free_space_inode(struct btrfs_root *root,
memset_extent_buffer(leaf, 0, (unsigned long)header, sizeof(*header));
btrfs_set_free_space_key(leaf, header, &disk_key);
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
btrfs_release_path(path);
return 0;
}
......@@ -822,7 +822,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
EXTENT_DIRTY | EXTENT_DELALLOC |
EXTENT_DO_ACCOUNTING, 0, 0, NULL,
GFP_NOFS);
btrfs_release_path(root, path);
btrfs_release_path(path);
goto out_free;
}
}
......@@ -832,7 +832,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
btrfs_set_free_space_bitmaps(leaf, header, bitmaps);
btrfs_set_free_space_generation(leaf, header, trans->transid);
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = 1;
......
......@@ -1164,7 +1164,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
goto next_slot;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
if (cow_start != (u64)-1) {
ret = cow_file_range(inode, locked_page, cow_start,
found_key.offset - 1, page_started,
......@@ -1222,7 +1222,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
if (cur_offset > end)
break;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
if (cur_offset <= end && cow_start == (u64)-1)
cow_start = cur_offset;
......@@ -2346,7 +2346,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
break;
/* release the path since we're done with it */
btrfs_release_path(root, path);
btrfs_release_path(path);
/*
* this is where we are basically btrfs_lookup, without the
......@@ -2712,7 +2712,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
ret = btrfs_delete_one_dir_name(trans, root, path, di);
if (ret)
goto err;
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_del_inode_ref(trans, root, name, name_len,
inode->i_ino,
......@@ -2735,7 +2735,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
goto err;
}
ret = btrfs_delete_one_dir_name(trans, root, path, di);
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len,
inode, dir->i_ino);
......@@ -2862,7 +2862,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
} else {
check_link = 0;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_lookup_inode(trans, root, path,
&BTRFS_I(inode)->location, 0);
......@@ -2876,7 +2876,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
} else {
check_link = 0;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
if (ret == 0 && S_ISREG(inode->i_mode)) {
ret = btrfs_lookup_file_extent(trans, root, path,
......@@ -2888,7 +2888,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
BUG_ON(ret == 0);
if (check_path_shared(root, path))
goto out;
btrfs_release_path(root, path);
btrfs_release_path(path);
}
if (!check_link) {
......@@ -2909,7 +2909,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
err = 0;
goto out;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
ref = btrfs_lookup_inode_ref(trans, root, path,
dentry->d_name.name, dentry->d_name.len,
......@@ -2922,7 +2922,7 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
if (check_path_shared(root, path))
goto out;
index = btrfs_inode_ref_index(path->nodes[0], ref);
btrfs_release_path(root, path);
btrfs_release_path(path);
di = btrfs_lookup_dir_index_item(trans, root, path, dir->i_ino, index,
dentry->d_name.name, dentry->d_name.len, 0);
......@@ -3013,7 +3013,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid);
ret = btrfs_delete_one_dir_name(trans, root, path, di);
BUG_ON(ret);
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_del_root_ref(trans, root->fs_info->tree_root,
objectid, root->root_key.objectid,
......@@ -3026,7 +3026,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
leaf = path->nodes[0];
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
btrfs_release_path(root, path);
btrfs_release_path(path);
index = key.offset;
}
......@@ -3039,7 +3039,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid);
ret = btrfs_delete_one_dir_name(trans, root, path, di);
BUG_ON(ret);
btrfs_release_path(root, path);
btrfs_release_path(path);
btrfs_i_size_write(dir, dir->i_size - name_len * 2);
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
......@@ -3477,7 +3477,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
BUG_ON(ret);
pending_del_nr = 0;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
goto search_again;
} else {
path->slots[0]--;
......@@ -3899,7 +3899,7 @@ static int fixup_tree_root_location(struct btrfs_root *root,
if (ret)
goto out;
btrfs_release_path(root->fs_info->tree_root, path);
btrfs_release_path(path);
new_root = btrfs_read_fs_root_no_name(root->fs_info, location);
if (IS_ERR(new_root)) {
......@@ -5223,7 +5223,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
kunmap(page);
free_extent_map(em);
em = NULL;
btrfs_release_path(root, path);
btrfs_release_path(path);
trans = btrfs_join_transaction(root, 1);
if (IS_ERR(trans))
return ERR_CAST(trans);
......@@ -5249,7 +5249,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
em->block_start = EXTENT_MAP_HOLE;
set_bit(EXTENT_FLAG_VACANCY, &em->flags);
insert:
btrfs_release_path(root, path);
btrfs_release_path(path);
if (em->start > start || extent_map_end(em) <= start) {
printk(KERN_ERR "Btrfs: bad extent! em: [%llu %llu] passed "
"[%llu %llu]\n", (unsigned long long)em->start,
......
......@@ -1396,7 +1396,7 @@ static noinline int search_ioctl(struct inode *inode,
}
ret = copy_to_sk(root, path, &key, sk, args->buf,
&sk_offset, &num_found);
btrfs_release_path(root, path);
btrfs_release_path(path);
if (ret || num_found >= sk->nr_items)
break;
......@@ -1503,7 +1503,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
if (key.offset == BTRFS_FIRST_FREE_OBJECTID)
break;
btrfs_release_path(root, path);
btrfs_release_path(path);
key.objectid = key.offset;
key.offset = (u64)-1;
dirid = key.objectid;
......@@ -1982,7 +1982,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
datal = btrfs_file_extent_ram_bytes(leaf,
extent);
}
btrfs_release_path(root, path);
btrfs_release_path(path);
if (key.offset + datal <= off ||
key.offset >= off+len)
......@@ -2092,7 +2092,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
}
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
btrfs_release_path(path);
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
......@@ -2113,12 +2113,12 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
btrfs_end_transaction(trans, root);
}
next:
btrfs_release_path(root, path);
btrfs_release_path(path);
key.offset++;
}
ret = 0;
out:
btrfs_release_path(root, path);
btrfs_release_path(path);
unlock_extent(&BTRFS_I(src)->io_tree, off, off+len, GFP_NOFS);
out_unlock:
mutex_unlock(&src->i_mutex);
......
......@@ -961,7 +961,7 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
lower = upper;
upper = NULL;
}
btrfs_release_path(root, path2);
btrfs_release_path(path2);
next:
if (ptr < end) {
ptr += btrfs_extent_inline_ref_size(key.type);
......@@ -974,7 +974,7 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
if (ptr >= end)
path1->slots[0]++;
}
btrfs_release_path(rc->extent_root, path1);
btrfs_release_path(path1);
cur->checked = 1;
WARN_ON(exist);
......@@ -1749,7 +1749,7 @@ int replace_path(struct btrfs_trans_handle *trans,
btrfs_node_key_to_cpu(path->nodes[level], &key,
path->slots[level]);
btrfs_release_path(src, path);
btrfs_release_path(path);
path->lowest_level = level;
ret = btrfs_search_slot(trans, src, &key, path, 0, 1);
......@@ -2496,7 +2496,7 @@ static int do_relocation(struct btrfs_trans_handle *trans,
path->locks[upper->level] = 0;
slot = path->slots[upper->level];
btrfs_release_path(NULL, path);
btrfs_release_path(path);
} else {
ret = btrfs_bin_search(upper->eb, key, upper->level,
&slot);
......@@ -2737,7 +2737,7 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans,
} else {
path->lowest_level = node->level;
ret = btrfs_search_slot(trans, root, key, path, 0, 1);
btrfs_release_path(root, path);
btrfs_release_path(path);
if (ret > 0)
ret = 0;
}
......@@ -3119,7 +3119,7 @@ static int add_tree_block(struct reloc_control *rc,
#endif
}
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
BUG_ON(level == -1);
......@@ -3505,7 +3505,7 @@ int add_data_references(struct reloc_control *rc,
}
path->slots[0]++;
}
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
if (err)
free_block_list(blocks);
return err;
......@@ -3568,7 +3568,7 @@ int find_next_extent(struct btrfs_trans_handle *trans,
EXTENT_DIRTY);
if (ret == 0 && start <= key.objectid) {
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
rc->search_start = end + 1;
} else {
rc->search_start = key.objectid + key.offset;
......@@ -3576,7 +3576,7 @@ int find_next_extent(struct btrfs_trans_handle *trans,
return 0;
}
}
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
return ret;
}
......@@ -3713,7 +3713,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
flags = BTRFS_EXTENT_FLAG_DATA;
if (path_change) {
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
path->search_commit_root = 1;
path->skip_locking = 1;
......@@ -3736,7 +3736,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
(flags & BTRFS_EXTENT_FLAG_DATA)) {
ret = add_data_references(rc, &key, path, &blocks);
} else {
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
ret = 0;
}
if (ret < 0) {
......@@ -3799,7 +3799,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
}
}
btrfs_release_path(rc->extent_root, path);
btrfs_release_path(path);
clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY,
GFP_NOFS);
......@@ -3867,7 +3867,7 @@ static int __insert_orphan_inode(struct btrfs_trans_handle *trans,
btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS |
BTRFS_INODE_PREALLOC);
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
btrfs_release_path(path);
out:
btrfs_free_path(path);
return ret;
......@@ -4109,7 +4109,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
}
leaf = path->nodes[0];
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
btrfs_release_path(root->fs_info->tree_root, path);
btrfs_release_path(path);
if (key.objectid != BTRFS_TREE_RELOC_OBJECTID ||
key.type != BTRFS_ROOT_ITEM_KEY)
......@@ -4141,7 +4141,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
key.offset--;
}
btrfs_release_path(root->fs_info->tree_root, path);
btrfs_release_path(path);
if (list_empty(&reloc_roots))
goto out;
......
......@@ -57,7 +57,7 @@ int btrfs_search_root(struct btrfs_root *root, u64 search_start,
btrfs_item_key_to_cpu(path->nodes[0], &search_key, path->slots[0]);
if (search_key.type != BTRFS_ROOT_ITEM_KEY) {
search_key.offset++;
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
ret = 0;
......@@ -230,7 +230,7 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid)
memcpy(&found_key, &key, sizeof(key));
key.offset++;
btrfs_release_path(root, path);
btrfs_release_path(path);
dead_root =
btrfs_read_fs_root_no_radix(root->fs_info->tree_root,
&found_key);
......@@ -292,7 +292,7 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root)
}
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
btrfs_release_path(tree_root, path);
btrfs_release_path(path);
if (key.objectid != BTRFS_ORPHAN_OBJECTID ||
key.type != BTRFS_ORPHAN_ITEM_KEY)
......@@ -390,7 +390,7 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans,
err = -ENOENT;
if (key.type == BTRFS_ROOT_BACKREF_KEY) {
btrfs_release_path(tree_root, path);
btrfs_release_path(path);
key.objectid = ref_id;
key.type = BTRFS_ROOT_REF_KEY;
key.offset = root_id;
......@@ -463,7 +463,7 @@ int btrfs_add_root_ref(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);
if (key.type == BTRFS_ROOT_BACKREF_KEY) {
btrfs_release_path(tree_root, path);
btrfs_release_path(path);
key.objectid = ref_id;
key.type = BTRFS_ROOT_REF_KEY;
key.offset = root_id;
......
......@@ -97,7 +97,7 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
ret = 0;
goto out;
}
btrfs_release_path(root, path);
btrfs_release_path(path);
wret = btrfs_search_slot(trans, root, &key, path, 0, 1);
if (wret < 0) {
......
This diff is collapsed.
......@@ -1475,7 +1475,7 @@ static int btrfs_finish_sprout(struct btrfs_trans_handle *trans,
goto error;
leaf = path->nodes[0];
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
btrfs_release_path(root, path);
btrfs_release_path(path);
continue;
}
......@@ -1947,7 +1947,7 @@ static int btrfs_relocate_sys_chunks(struct btrfs_root *root)
chunk = btrfs_item_ptr(leaf, path->slots[0],
struct btrfs_chunk);
chunk_type = btrfs_chunk_type(leaf, chunk);
btrfs_release_path(chunk_root, path);
btrfs_release_path(path);
if (chunk_type & BTRFS_BLOCK_GROUP_SYSTEM) {
ret = btrfs_relocate_chunk(chunk_root, chunk_tree,
......@@ -2065,7 +2065,7 @@ int btrfs_balance(struct btrfs_root *dev_root)
if (found_key.offset == 0)
break;
btrfs_release_path(chunk_root, path);
btrfs_release_path(path);
ret = btrfs_relocate_chunk(chunk_root,
chunk_root->root_key.objectid,
found_key.objectid,
......@@ -2137,7 +2137,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
goto done;
if (ret) {
ret = 0;
btrfs_release_path(root, path);
btrfs_release_path(path);
break;
}
......@@ -2146,7 +2146,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
btrfs_item_key_to_cpu(l, &key, path->slots[0]);
if (key.objectid != device->devid) {
btrfs_release_path(root, path);
btrfs_release_path(path);
break;
}
......@@ -2154,14 +2154,14 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
length = btrfs_dev_extent_length(l, dev_extent);
if (key.offset + length <= new_size) {
btrfs_release_path(root, path);
btrfs_release_path(path);
break;
}
chunk_tree = btrfs_dev_extent_chunk_tree(l, dev_extent);
chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent);
chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent);
btrfs_release_path(root, path);
btrfs_release_path(path);
ret = btrfs_relocate_chunk(root, chunk_tree, chunk_objectid,
chunk_offset);
......@@ -3813,7 +3813,7 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
}
if (key.objectid == BTRFS_DEV_ITEMS_OBJECTID) {
key.objectid = 0;
btrfs_release_path(root, path);
btrfs_release_path(path);
goto again;
}
ret = 0;
......
......@@ -120,13 +120,13 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
ret = btrfs_delete_one_dir_name(trans, root, path, di);
BUG_ON(ret);
btrfs_release_path(root, path);
btrfs_release_path(path);
/* if we don't have a value then we are removing the xattr */
if (!value)
goto out;
} else {
btrfs_release_path(root, path);
btrfs_release_path(path);
if (flags & XATTR_REPLACE) {
/* we couldn't find the attr to replace */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment