Re: [PATCH 2/3] btrfs-progs: Remove type argument from btrfs_alloc_data_chunk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2019/10/30 下午8:22, Nikolay Borisov wrote:
> It's always set to BTRFS_BLOCK_GROUP_DATA so sink it into the function.
>
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>

Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>

Thanks,
Qu

> ---
>  convert/main.c | 3 +--
>  volumes.c      | 6 +++---
>  volumes.h      | 2 +-
>  3 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/convert/main.c b/convert/main.c
> index bb689be9f3e4..9904deafba45 100644
> --- a/convert/main.c
> +++ b/convert/main.c
> @@ -943,8 +943,7 @@ static int make_convert_data_block_groups(struct btrfs_trans_handle *trans,
>  			len = min(max_chunk_size,
>  				  cache->start + cache->size - cur);
>  			ret = btrfs_alloc_data_chunk(trans, fs_info,
> -					&cur_backup, len,
> -					BTRFS_BLOCK_GROUP_DATA, 1);
> +					&cur_backup, len, 1);
>  			if (ret < 0)
>  				break;
>  			ret = btrfs_make_block_group(trans, fs_info, 0,
> diff --git a/volumes.c b/volumes.c
> index 1d088d93e788..87315a884b49 100644
> --- a/volumes.c
> +++ b/volumes.c
> @@ -1245,7 +1245,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
>   */
>  int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
>  			   struct btrfs_fs_info *info, u64 *start,
> -			   u64 num_bytes, u64 type, int convert)
> +			   u64 num_bytes, int convert)
>  {
>  	u64 dev_offset;
>  	struct btrfs_root *extent_root = info->extent_root;
> @@ -1328,7 +1328,7 @@ int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
>  	btrfs_set_stack_chunk_length(chunk, num_bytes);
>  	btrfs_set_stack_chunk_owner(chunk, extent_root->root_key.objectid);
>  	btrfs_set_stack_chunk_stripe_len(chunk, stripe_len);
> -	btrfs_set_stack_chunk_type(chunk, type);
> +	btrfs_set_stack_chunk_type(chunk, BTRFS_BLOCK_GROUP_DATA);
>  	btrfs_set_stack_chunk_num_stripes(chunk, num_stripes);
>  	btrfs_set_stack_chunk_io_align(chunk, stripe_len);
>  	btrfs_set_stack_chunk_io_width(chunk, stripe_len);
> @@ -1338,7 +1338,7 @@ int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
>  	map->stripe_len = stripe_len;
>  	map->io_align = stripe_len;
>  	map->io_width = stripe_len;
> -	map->type = type;
> +	map->type = BTRFS_BLOCK_GROUP_DATA;
>  	map->num_stripes = num_stripes;
>  	map->sub_stripes = sub_stripes;
>
> diff --git a/volumes.h b/volumes.h
> index 586588c871ab..83ba827e422b 100644
> --- a/volumes.h
> +++ b/volumes.h
> @@ -272,7 +272,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
>  		      u64 *num_bytes, u64 type);
>  int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
>  			   struct btrfs_fs_info *fs_info, u64 *start,
> -			   u64 num_bytes, u64 type, int convert);
> +			   u64 num_bytes, int convert);
>  int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
>  		       int flags);
>  int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
>




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux