Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3b4aa74 authored by David Sterba's avatar David Sterba
Browse files

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
Loading
Loading
Loading
Loading
+14 −14
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ void btrfs_free_path(struct btrfs_path *p)
{
{
	if (!p)
	if (!p)
		return;
		return;
	btrfs_release_path(NULL, p);
	btrfs_release_path(p);
	kmem_cache_free(btrfs_path_cachep, 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.
 * 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;
	int i;


@@ -1328,7 +1328,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
		ret = -EAGAIN;
		ret = -EAGAIN;


		/* release the whole path */
		/* release the whole path */
		btrfs_release_path(root, path);
		btrfs_release_path(path);


		/* read the blocks */
		/* read the blocks */
		if (block1)
		if (block1)
@@ -1475,7 +1475,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
				return 0;
				return 0;
			}
			}
			free_extent_buffer(tmp);
			free_extent_buffer(tmp);
			btrfs_release_path(NULL, p);
			btrfs_release_path(p);
			return -EIO;
			return -EIO;
		}
		}
	}
	}
@@ -1494,7 +1494,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
	if (p->reada)
	if (p->reada)
		reada_for_search(root, p, level, slot, key->objectid);
		reada_for_search(root, p, level, slot, key->objectid);


	btrfs_release_path(NULL, p);
	btrfs_release_path(p);


	ret = -EAGAIN;
	ret = -EAGAIN;
	tmp = read_tree_block(root, blocknr, blocksize, 0);
	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];
		b = p->nodes[level];
		if (!b) {
		if (!b) {
			btrfs_release_path(NULL, p);
			btrfs_release_path(p);
			goto again;
			goto again;
		}
		}
		BUG_ON(btrfs_header_nritems(b) == 1);
		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)
	if (!p->leave_spinning)
		btrfs_set_path_blocking(p);
		btrfs_set_path_blocking(p);
	if (ret < 0)
	if (ret < 0)
		btrfs_release_path(root, p);
		btrfs_release_path(p);
	return ret;
	return ret;
}
}


@@ -3026,7 +3026,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
				    struct btrfs_file_extent_item);
				    struct btrfs_file_extent_item);
		extent_len = btrfs_file_extent_num_bytes(leaf, fi);
		extent_len = btrfs_file_extent_num_bytes(leaf, fi);
	}
	}
	btrfs_release_path(root, path);
	btrfs_release_path(path);


	path->keep_locks = 1;
	path->keep_locks = 1;
	path->search_for_split = 1;
	path->search_for_split = 1;
@@ -3948,7 +3948,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
	else
	else
		return 1;
		return 1;


	btrfs_release_path(root, path);
	btrfs_release_path(path);
	ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
	ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
	if (ret < 0)
	if (ret < 0)
		return ret;
		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,
			sret = btrfs_find_next_key(root, path, min_key, level,
						  cache_only, min_trans);
						  cache_only, min_trans);
			if (sret == 0) {
			if (sret == 0) {
				btrfs_release_path(root, path);
				btrfs_release_path(path);
				goto again;
				goto again;
			} else {
			} else {
				goto out;
				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);
				btrfs_node_key_to_cpu(c, &cur_key, slot);


			orig_lowest = path->lowest_level;
			orig_lowest = path->lowest_level;
			btrfs_release_path(root, path);
			btrfs_release_path(path);
			path->lowest_level = level;
			path->lowest_level = level;
			ret = btrfs_search_slot(NULL, root, &cur_key, path,
			ret = btrfs_search_slot(NULL, root, &cur_key, path,
						0, 0);
						0, 0);
@@ -4228,7 +4228,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
again:
again:
	level = 1;
	level = 1;
	next = NULL;
	next = NULL;
	btrfs_release_path(root, path);
	btrfs_release_path(path);


	path->keep_locks = 1;
	path->keep_locks = 1;


@@ -4284,7 +4284,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
			goto again;
			goto again;


		if (ret < 0) {
		if (ret < 0) {
			btrfs_release_path(root, path);
			btrfs_release_path(path);
			goto done;
			goto done;
		}
		}


@@ -4323,7 +4323,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
			goto again;
			goto again;


		if (ret < 0) {
		if (ret < 0) {
			btrfs_release_path(root, path);
			btrfs_release_path(path);
			goto done;
			goto done;
		}
		}


+1 −1
Original line number Original line Diff line number Diff line
@@ -2290,7 +2290,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
		       struct btrfs_root *root, struct extent_buffer *parent,
		       struct btrfs_root *root, struct extent_buffer *parent,
		       int start_slot, int cache_only, u64 *last_ret,
		       int start_slot, int cache_only, u64 *last_ret,
		       struct btrfs_key *progress);
		       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);
struct btrfs_path *btrfs_alloc_path(void);
void btrfs_free_path(struct btrfs_path *p);
void btrfs_free_path(struct btrfs_path *p);
void btrfs_set_path_blocking(struct btrfs_path *p);
void btrfs_set_path_blocking(struct btrfs_path *p);
+1 −1
Original line number Original line Diff line number Diff line
@@ -172,7 +172,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
		ret = 0;
		ret = 0;
		goto out_free;
		goto out_free;
	}
	}
	btrfs_release_path(root, path);
	btrfs_release_path(path);


	btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
	btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
	key.offset = index;
	key.offset = index;
+22 −22
Original line number Original line Diff line number Diff line
@@ -379,7 +379,7 @@ static int caching_kthread(void *data)
				break;
				break;


			caching_ctl->progress = last;
			caching_ctl->progress = last;
			btrfs_release_path(extent_root, path);
			btrfs_release_path(path);
			up_read(&fs_info->extent_commit_sem);
			up_read(&fs_info->extent_commit_sem);
			mutex_unlock(&caching_ctl->mutex);
			mutex_unlock(&caching_ctl->mutex);
			if (btrfs_transaction_in_commit(fs_info))
			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);
			atomic_inc(&head->node.refs);
			spin_unlock(&delayed_refs->lock);
			spin_unlock(&delayed_refs->lock);


			btrfs_release_path(root->fs_info->extent_root, path);
			btrfs_release_path(path);


			mutex_lock(&head->mutex);
			mutex_lock(&head->mutex);
			mutex_unlock(&head->mutex);
			mutex_unlock(&head->mutex);
@@ -934,7 +934,7 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
			break;
			break;
		}
		}
	}
	}
	btrfs_release_path(root, path);
	btrfs_release_path(path);


	if (owner < BTRFS_FIRST_FREE_OBJECTID)
	if (owner < BTRFS_FIRST_FREE_OBJECTID)
		new_size += sizeof(*bi);
		new_size += sizeof(*bi);
@@ -1042,7 +1042,7 @@ static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
			return 0;
			return 0;
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
		key.type = BTRFS_EXTENT_REF_V0_KEY;
		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);
		ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
		if (ret < 0) {
		if (ret < 0) {
			err = ret;
			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,
		if (match_extent_data_ref(leaf, ref, root_objectid,
					  owner, offset)) {
					  owner, offset)) {
			if (recow) {
			if (recow) {
				btrfs_release_path(root, path);
				btrfs_release_path(path);
				goto again;
				goto again;
			}
			}
			err = 0;
			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,
			if (match_extent_data_ref(leaf, ref, root_objectid,
						  owner, offset))
						  owner, offset))
				break;
				break;
			btrfs_release_path(root, path);
			btrfs_release_path(path);
			key.offset++;
			key.offset++;
			ret = btrfs_insert_empty_item(trans, root, path, &key,
			ret = btrfs_insert_empty_item(trans, root, path, &key,
						      size);
						      size);
@@ -1167,7 +1167,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
	btrfs_mark_buffer_dirty(leaf);
	btrfs_mark_buffer_dirty(leaf);
	ret = 0;
	ret = 0;
fail:
fail:
	btrfs_release_path(root, path);
	btrfs_release_path(path);
	return ret;
	return ret;
}
}


@@ -1293,7 +1293,7 @@ static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
		ret = -ENOENT;
		ret = -ENOENT;
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
	if (ret == -ENOENT && parent) {
	if (ret == -ENOENT && parent) {
		btrfs_release_path(root, path);
		btrfs_release_path(path);
		key.type = BTRFS_EXTENT_REF_V0_KEY;
		key.type = BTRFS_EXTENT_REF_V0_KEY;
		ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
		ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
		if (ret > 0)
		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);
	ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
	btrfs_release_path(root, path);
	btrfs_release_path(path);
	return ret;
	return ret;
}
}


@@ -1608,7 +1608,7 @@ static int lookup_extent_backref(struct btrfs_trans_handle *trans,
	if (ret != -ENOENT)
	if (ret != -ENOENT)
		return ret;
		return ret;


	btrfs_release_path(root, path);
	btrfs_release_path(path);
	*ref_ret = NULL;
	*ref_ret = NULL;


	if (owner < BTRFS_FIRST_FREE_OBJECTID) {
	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);
		__run_delayed_extent_op(extent_op, leaf, item);


	btrfs_mark_buffer_dirty(leaf);
	btrfs_mark_buffer_dirty(leaf);
	btrfs_release_path(root->fs_info->extent_root, path);
	btrfs_release_path(path);


	path->reada = 1;
	path->reada = 1;
	path->leave_spinning = 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);
		atomic_inc(&head->node.refs);
		spin_unlock(&delayed_refs->lock);
		spin_unlock(&delayed_refs->lock);


		btrfs_release_path(root->fs_info->extent_root, path);
		btrfs_release_path(path);


		mutex_lock(&head->mutex);
		mutex_lock(&head->mutex);
		mutex_unlock(&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]);
	bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
	write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item));
	write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item));
	btrfs_mark_buffer_dirty(leaf);
	btrfs_mark_buffer_dirty(leaf);
	btrfs_release_path(extent_root, path);
	btrfs_release_path(path);
fail:
fail:
	if (ret)
	if (ret)
		return 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);
	inode = lookup_free_space_inode(root, block_group, path);
	if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
	if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
		ret = PTR_ERR(inode);
		ret = PTR_ERR(inode);
		btrfs_release_path(root, path);
		btrfs_release_path(path);
		goto out;
		goto out;
	}
	}


@@ -2854,7 +2854,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
out_put:
out_put:
	iput(inode);
	iput(inode);
out_free:
out_free:
	btrfs_release_path(root, path);
	btrfs_release_path(path);
out:
out:
	spin_lock(&block_group->lock);
	spin_lock(&block_group->lock);
	block_group->disk_cache_state = dcs;
	block_group->disk_cache_state = dcs;
@@ -4541,7 +4541,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
						    NULL, refs_to_drop,
						    NULL, refs_to_drop,
						    is_data);
						    is_data);
			BUG_ON(ret);
			BUG_ON(ret);
			btrfs_release_path(extent_root, path);
			btrfs_release_path(path);
			path->leave_spinning = 1;
			path->leave_spinning = 1;


			key.objectid = bytenr;
			key.objectid = bytenr;
@@ -4580,7 +4580,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
					     owner_objectid, 0);
					     owner_objectid, 0);
		BUG_ON(ret < 0);
		BUG_ON(ret < 0);


		btrfs_release_path(extent_root, path);
		btrfs_release_path(path);
		path->leave_spinning = 1;
		path->leave_spinning = 1;


		key.objectid = bytenr;
		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],
		ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
				      num_to_del);
				      num_to_del);
		BUG_ON(ret);
		BUG_ON(ret);
		btrfs_release_path(extent_root, path);
		btrfs_release_path(path);


		if (is_data) {
		if (is_data) {
			ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
			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;
				trans->block_rsv = block_rsv;
		}
		}
	}
	}
	btrfs_release_path(root, path);
	btrfs_release_path(path);
	BUG_ON(err);
	BUG_ON(err);


	ret = btrfs_del_root(trans, tree_root, &root->root_key);
	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));
		memcpy(&cache->key, &found_key, sizeof(found_key));


		key.objectid = found_key.objectid + found_key.offset;
		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->flags = btrfs_block_group_flags(&cache->item);
		cache->sectorsize = root->sectorsize;
		cache->sectorsize = root->sectorsize;


@@ -8802,12 +8802,12 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
	if (ret < 0)
	if (ret < 0)
		goto out;
		goto out;
	if (ret > 0)
	if (ret > 0)
		btrfs_release_path(tree_root, path);
		btrfs_release_path(path);
	if (ret == 0) {
	if (ret == 0) {
		ret = btrfs_del_item(trans, tree_root, path);
		ret = btrfs_del_item(trans, tree_root, path);
		if (ret)
		if (ret)
			goto out;
			goto out;
		btrfs_release_path(tree_root, path);
		btrfs_release_path(path);
	}
	}


	spin_lock(&root->fs_info->block_group_cache_lock);
	spin_lock(&root->fs_info->block_group_cache_lock);
+6 −6
Original line number Original line Diff line number Diff line
@@ -193,7 +193,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
			u32 item_size;
			u32 item_size;


			if (item)
			if (item)
				btrfs_release_path(root, path);
				btrfs_release_path(path);
			item = btrfs_lookup_csum(NULL, root->fs_info->csum_root,
			item = btrfs_lookup_csum(NULL, root->fs_info->csum_root,
						 path, disk_bytenr, 0);
						 path, disk_bytenr, 0);
			if (IS_ERR(item)) {
			if (IS_ERR(item)) {
@@ -213,7 +213,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
					       (unsigned long long)offset);
					       (unsigned long long)offset);
				}
				}
				item = NULL;
				item = NULL;
				btrfs_release_path(root, path);
				btrfs_release_path(path);
				goto found;
				goto found;
			}
			}
			btrfs_item_key_to_cpu(path->nodes[0], &found_key,
			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)
			if (key.offset < bytenr)
				break;
				break;
		}
		}
		btrfs_release_path(root, path);
		btrfs_release_path(path);
	}
	}
out:
out:
	btrfs_free_path(path);
	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
	 * at this point, we know the tree has an item, but it isn't big
	 * enough yet to put our csum in.  Grow it
	 * 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,
	ret = btrfs_search_slot(trans, root, &file_key, path,
				csum_size, 1);
				csum_size, 1);
	if (ret < 0)
	if (ret < 0)
@@ -766,7 +766,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
	}
	}


insert:
insert:
	btrfs_release_path(root, path);
	btrfs_release_path(path);
	csum_offset = 0;
	csum_offset = 0;
	if (found_next) {
	if (found_next) {
		u64 tmp = total_bytes + root->sectorsize;
		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]);
	btrfs_mark_buffer_dirty(path->nodes[0]);
	if (total_bytes < sums->len) {
	if (total_bytes < sums->len) {
		btrfs_release_path(root, path);
		btrfs_release_path(path);
		cond_resched();
		cond_resched();
		goto again;
		goto again;
	}
	}
Loading