Commit c4c129db authored by Gu JinXiang's avatar Gu JinXiang Committed by David Sterba

btrfs: drop unused parameter qgroup_reserved

Since commit 7775c818 ("btrfs: remove unused parameter from
btrfs_subvolume_release_metadata") parameter qgroup_reserved is not used
by caller of function btrfs_subvolume_reserve_metadata.  So remove it.
Signed-off-by: default avatarGu JinXiang <gujx@cn.fujitsu.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e73e81b6
...@@ -2767,8 +2767,7 @@ void btrfs_free_reserved_data_space_noquota(struct inode *inode, u64 start, ...@@ -2767,8 +2767,7 @@ void btrfs_free_reserved_data_space_noquota(struct inode *inode, u64 start,
void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans); void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans);
int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
struct btrfs_block_rsv *rsv, struct btrfs_block_rsv *rsv,
int nitems, int nitems, bool use_global_rsv);
u64 *qgroup_reserved, bool use_global_rsv);
void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info, void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
struct btrfs_block_rsv *rsv); struct btrfs_block_rsv *rsv);
void btrfs_delalloc_release_extents(struct btrfs_inode *inode, u64 num_bytes, void btrfs_delalloc_release_extents(struct btrfs_inode *inode, u64 num_bytes,
......
...@@ -5947,7 +5947,6 @@ void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans) ...@@ -5947,7 +5947,6 @@ void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans)
int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
struct btrfs_block_rsv *rsv, struct btrfs_block_rsv *rsv,
int items, int items,
u64 *qgroup_reserved,
bool use_global_rsv) bool use_global_rsv)
{ {
u64 num_bytes; u64 num_bytes;
...@@ -5965,8 +5964,6 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, ...@@ -5965,8 +5964,6 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
num_bytes = 0; num_bytes = 0;
} }
*qgroup_reserved = num_bytes;
num_bytes = btrfs_calc_trans_metadata_size(fs_info, items); num_bytes = btrfs_calc_trans_metadata_size(fs_info, items);
rsv->space_info = __find_space_info(fs_info, rsv->space_info = __find_space_info(fs_info,
BTRFS_BLOCK_GROUP_METADATA); BTRFS_BLOCK_GROUP_METADATA);
...@@ -5976,8 +5973,8 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, ...@@ -5976,8 +5973,8 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
if (ret == -ENOSPC && use_global_rsv) if (ret == -ENOSPC && use_global_rsv)
ret = btrfs_block_rsv_migrate(global_rsv, rsv, num_bytes, 1); ret = btrfs_block_rsv_migrate(global_rsv, rsv, num_bytes, 1);
if (ret && *qgroup_reserved) if (ret && num_bytes)
btrfs_qgroup_free_meta_prealloc(root, *qgroup_reserved); btrfs_qgroup_free_meta_prealloc(root, num_bytes);
return ret; return ret;
} }
......
...@@ -4293,7 +4293,6 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) ...@@ -4293,7 +4293,6 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
struct btrfs_block_rsv block_rsv; struct btrfs_block_rsv block_rsv;
u64 root_flags; u64 root_flags;
u64 qgroup_reserved;
int ret; int ret;
int err; int err;
...@@ -4328,8 +4327,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) ...@@ -4328,8 +4327,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
* two for dir entries, * two for dir entries,
* two for root ref/backref. * two for root ref/backref.
*/ */
err = btrfs_subvolume_reserve_metadata(root, &block_rsv, err = btrfs_subvolume_reserve_metadata(root, &block_rsv, 5, true);
5, &qgroup_reserved, true);
if (err) if (err)
goto out_up_write; goto out_up_write;
......
...@@ -569,7 +569,6 @@ static noinline int create_subvol(struct inode *dir, ...@@ -569,7 +569,6 @@ static noinline int create_subvol(struct inode *dir,
u64 objectid; u64 objectid;
u64 new_dirid = BTRFS_FIRST_FREE_OBJECTID; u64 new_dirid = BTRFS_FIRST_FREE_OBJECTID;
u64 index = 0; u64 index = 0;
u64 qgroup_reserved;
uuid_le new_uuid; uuid_le new_uuid;
root_item = kzalloc(sizeof(*root_item), GFP_KERNEL); root_item = kzalloc(sizeof(*root_item), GFP_KERNEL);
...@@ -594,8 +593,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -594,8 +593,7 @@ static noinline int create_subvol(struct inode *dir,
* The same as the snapshot creation, please see the comment * The same as the snapshot creation, please see the comment
* of create_snapshot(). * of create_snapshot().
*/ */
ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, 8, false);
8, &qgroup_reserved, false);
if (ret) if (ret)
goto fail_free; goto fail_free;
...@@ -803,7 +801,6 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir, ...@@ -803,7 +801,6 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
*/ */
ret = btrfs_subvolume_reserve_metadata(BTRFS_I(dir)->root, ret = btrfs_subvolume_reserve_metadata(BTRFS_I(dir)->root,
&pending_snapshot->block_rsv, 8, &pending_snapshot->block_rsv, 8,
&pending_snapshot->qgroup_reserved,
false); false);
if (ret) if (ret)
goto dec_and_free; goto dec_and_free;
......
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