RE: [PATCH] btrfs-progs: mkfs: Replace number with enum

2017-08-22 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Tuesday, August 22, 2017 10:04 PM > To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com>; linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs-progs: mkfs: Replace number with enum > > On

Re: [PATCH] btrfs-progs: mkfs: Replace number with enum

2017-08-22 Thread David Sterba
On Mon, Aug 21, 2017 at 07:39:49PM +0200, David Sterba wrote: > > +/* roots: root tree, extent tree, chunk tree, dev tree, fs tree, csum tree > > */ > > +enum btrfs_mkfs_block { > > + SUPER_BLOCK = 0, > > + ROOT_TREE, > > + EXTENT_TREE, > > + CHUNK_TREE, > > + DEV_TREE, > > + FS_TREE,

Re: [PATCH] btrfs-progs: mkfs: Replace number with enum

2017-08-21 Thread David Sterba
On Wed, Jun 28, 2017 at 05:59:24PM +0800, Gu Jinxiang wrote: > For code maintainability and scalability, > replace hardcoded constant with a meaningful enum. > > Signed-off-by: Gu Jinxiang Sorry for late reply. Patch applied with some tweaks, the added enum names are too

[PATCH] btrfs-progs: mkfs: Replace number with enum

2017-06-28 Thread Gu Jinxiang
For code maintainability and scalability, replace hardcoded constant with a meaningful enum. Signed-off-by: Gu Jinxiang --- mkfs/common.c | 47 --- mkfs/common.h | 14 +- 2 files changed, 37 insertions(+), 24