Skip to content

Commit 7451432

Browse files
fdmananaChris Mason
authored andcommitted
Btrfs: remove path arg from btrfs_truncate_free_space_cache
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>
1 parent 53645a9 commit 7451432

5 files changed

Lines changed: 3 additions & 15 deletions

File tree

‎fs/btrfs/extent-tree.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,8 +3197,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
31973197
if (ret)
31983198
goto out_put;
31993199

3200-
ret = btrfs_truncate_free_space_cache(root, trans, path,
3201-
inode);
3200+
ret = btrfs_truncate_free_space_cache(root, trans, inode);
32023201
if (ret)
32033202
goto out_put;
32043203
}

‎fs/btrfs/free-space-cache.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ int btrfs_check_trunc_cache_free_space(struct btrfs_root *root,
218218

219219
int btrfs_truncate_free_space_cache(struct btrfs_root *root,
220220
struct btrfs_trans_handle *trans,
221-
struct btrfs_path *path,
222221
struct inode *inode)
223222
{
224223
int ret = 0;

‎fs/btrfs/free-space-cache.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ int btrfs_check_trunc_cache_free_space(struct btrfs_root *root,
5858
struct btrfs_block_rsv *rsv);
5959
int btrfs_truncate_free_space_cache(struct btrfs_root *root,
6060
struct btrfs_trans_handle *trans,
61-
struct btrfs_path *path,
6261
struct inode *inode);
6362
int load_free_space_cache(struct btrfs_fs_info *fs_info,
6463
struct btrfs_block_group_cache *block_group);

‎fs/btrfs/inode-map.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
466466
}
467467

468468
if (i_size_read(inode) > 0) {
469-
ret = btrfs_truncate_free_space_cache(root, trans, path, inode);
469+
ret = btrfs_truncate_free_space_cache(root, trans, inode);
470470
if (ret) {
471471
if (ret != -ENOSPC)
472472
btrfs_abort_transaction(trans, root, ret);

‎fs/btrfs/relocation.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,7 +3407,6 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
34073407
struct inode *inode, u64 ino)
34083408
{
34093409
struct btrfs_key key;
3410-
struct btrfs_path *path;
34113410
struct btrfs_root *root = fs_info->tree_root;
34123411
struct btrfs_trans_handle *trans;
34133412
int ret = 0;
@@ -3432,22 +3431,14 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
34323431
if (ret)
34333432
goto out;
34343433

3435-
path = btrfs_alloc_path();
3436-
if (!path) {
3437-
ret = -ENOMEM;
3438-
goto out;
3439-
}
3440-
34413434
trans = btrfs_join_transaction(root);
34423435
if (IS_ERR(trans)) {
3443-
btrfs_free_path(path);
34443436
ret = PTR_ERR(trans);
34453437
goto out;
34463438
}
34473439

3448-
ret = btrfs_truncate_free_space_cache(root, trans, path, inode);
3440+
ret = btrfs_truncate_free_space_cache(root, trans, inode);
34493441

3450-
btrfs_free_path(path);
34513442
btrfs_end_transaction(trans, root);
34523443
btrfs_btree_balance_dirty(root);
34533444
out:

0 commit comments

Comments
 (0)