Re: [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* to enums
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Re: [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* to enums
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 Reviewed-by: Qu Wenruo 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_DELALLOC2 > -#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_TEMP7 > +/* > + * 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; > signature.asc Description: OpenPGP digital signature
Re: [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* to enums
On Tue, Nov 27, 2018 at 08:53:43PM +0100, David Sterba wrote: > We can use simple enum for values that are not part of on-disk format: > block reserve types. Reviewed-by: Omar Sandoval > Signed-off-by: David Sterba > --- > 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_DELALLOC2 > -#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_TEMP7 > +/* > + * 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; > -- > 2.19.1 >
[PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* to enums
We can use simple enum for values that are not part of on-disk format: block reserve types. Signed-off-by: David Sterba --- 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]; }; -#defineBTRFS_BLOCK_RSV_GLOBAL 1 -#defineBTRFS_BLOCK_RSV_DELALLOC2 -#defineBTRFS_BLOCK_RSV_TRANS 3 -#defineBTRFS_BLOCK_RSV_CHUNK 4 -#defineBTRFS_BLOCK_RSV_DELOPS 5 -#defineBTRFS_BLOCK_RSV_EMPTY 6 -#defineBTRFS_BLOCK_RSV_TEMP7 +/* + * 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; -- 2.19.1