Re: [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* to enums

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

 




On 2018/11/28 上午3:53, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> block reserve types.
> 
> Signed-off-by: David Sterba <dsterba@xxxxxxxx>

Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>

However more comment will always be a good thing.

Thanks,
Qu

> ---
>  fs/btrfs/ctree.h | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index f82ec5e41b0c..40c405d74a01 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -461,13 +461,18 @@ struct btrfs_space_info {
>  	struct kobject *block_group_kobjs[BTRFS_NR_RAID_TYPES];
>  };
>  
> -#define	BTRFS_BLOCK_RSV_GLOBAL		1
> -#define	BTRFS_BLOCK_RSV_DELALLOC	2
> -#define	BTRFS_BLOCK_RSV_TRANS		3
> -#define	BTRFS_BLOCK_RSV_CHUNK		4
> -#define	BTRFS_BLOCK_RSV_DELOPS		5
> -#define	BTRFS_BLOCK_RSV_EMPTY		6
> -#define	BTRFS_BLOCK_RSV_TEMP		7
> +/*
> + * Types of block reserves
> + */
> +enum {
> +	BTRFS_BLOCK_RSV_GLOBAL,
> +	BTRFS_BLOCK_RSV_DELALLOC,
> +	BTRFS_BLOCK_RSV_TRANS,
> +	BTRFS_BLOCK_RSV_CHUNK,
> +	BTRFS_BLOCK_RSV_DELOPS,
> +	BTRFS_BLOCK_RSV_EMPTY,
> +	BTRFS_BLOCK_RSV_TEMP,
> +};
>  
>  struct btrfs_block_rsv {
>  	u64 size;
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[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