Skip to content

Commit

Permalink
Btrfs: remove path arg from btrfs_truncate_free_space_cache
Browse files Browse the repository at this point in the history
Not used for anything, and removing it avoids caller's need to
allocate a path structure.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Filipe David Borba Manana authored and Chris Mason committed Nov 12, 2013
1 parent 53645a9 commit 7451432
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3197,8 +3197,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
if (ret)
goto out_put;

ret = btrfs_truncate_free_space_cache(root, trans, path,
inode);
ret = btrfs_truncate_free_space_cache(root, trans, inode);
if (ret)
goto out_put;
}
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ int btrfs_check_trunc_cache_free_space(struct btrfs_root *root,

int btrfs_truncate_free_space_cache(struct btrfs_root *root,
struct btrfs_trans_handle *trans,
struct btrfs_path *path,
struct inode *inode)
{
int ret = 0;
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/free-space-cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int btrfs_check_trunc_cache_free_space(struct btrfs_root *root,
struct btrfs_block_rsv *rsv);
int btrfs_truncate_free_space_cache(struct btrfs_root *root,
struct btrfs_trans_handle *trans,
struct btrfs_path *path,
struct inode *inode);
int load_free_space_cache(struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *block_group);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
}

if (i_size_read(inode) > 0) {
ret = btrfs_truncate_free_space_cache(root, trans, path, inode);
ret = btrfs_truncate_free_space_cache(root, trans, inode);
if (ret) {
if (ret != -ENOSPC)
btrfs_abort_transaction(trans, root, ret);
Expand Down
11 changes: 1 addition & 10 deletions fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,6 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
struct inode *inode, u64 ino)
{
struct btrfs_key key;
struct btrfs_path *path;
struct btrfs_root *root = fs_info->tree_root;
struct btrfs_trans_handle *trans;
int ret = 0;
Expand All @@ -3432,22 +3431,14 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
if (ret)
goto out;

path = btrfs_alloc_path();
if (!path) {
ret = -ENOMEM;
goto out;
}

trans = btrfs_join_transaction(root);
if (IS_ERR(trans)) {
btrfs_free_path(path);
ret = PTR_ERR(trans);
goto out;
}

ret = btrfs_truncate_free_space_cache(root, trans, path, inode);
ret = btrfs_truncate_free_space_cache(root, trans, inode);

btrfs_free_path(path);
btrfs_end_transaction(trans, root);
btrfs_btree_balance_dirty(root);
out:
Expand Down

0 comments on commit 7451432

Please sign in to comment.