btrfs: drop extra enum initialization where using defaults
authorDavid Sterba <dsterba@suse.com>
Tue, 27 Nov 2018 14:25:13 +0000 (15:25 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:43 +0000 (14:51 +0100)
The first auto-assigned value to enum is 0, we can use that and not
initialize all members where the auto-increment does the same. This is
used for values that are not part of on-disk format.

Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/ctree.h
fs/btrfs/disk-io.h
fs/btrfs/qgroup.h
fs/btrfs/sysfs.h
fs/btrfs/transaction.h

index 4de321aee7a59ae648b1bc11f6192f3cf6e7d2a4..fc25607304f2db2c2d545bf906448638299b06a9 100644 (file)
@@ -20,7 +20,7 @@
  * new data the application may have written before commit.
  */
 enum {
-       BTRFS_INODE_ORDERED_DATA_CLOSE = 0,
+       BTRFS_INODE_ORDERED_DATA_CLOSE,
        BTRFS_INODE_DUMMY,
        BTRFS_INODE_IN_DEFRAG,
        BTRFS_INODE_HAS_ASYNC_EXTENT,
index 41d056010d9ee7af413a0ede78eb4078349ce4bd..81cbbb24678e3142b1f9fd2ac896a90211815377 100644 (file)
@@ -334,7 +334,7 @@ struct btrfs_node {
  * The slots array records the index of the item or block pointer
  * used while walking the tree.
  */
-enum { READA_NONE = 0, READA_BACK, READA_FORWARD };
+enum { READA_NONE, READA_BACK, READA_FORWARD };
 struct btrfs_path {
        struct extent_buffer *nodes[BTRFS_MAX_LEVEL];
        int slots[BTRFS_MAX_LEVEL];
@@ -532,18 +532,18 @@ struct btrfs_free_cluster {
 };
 
 enum btrfs_caching_type {
-       BTRFS_CACHE_NO          = 0,
-       BTRFS_CACHE_STARTED     = 1,
-       BTRFS_CACHE_FAST        = 2,
-       BTRFS_CACHE_FINISHED    = 3,
-       BTRFS_CACHE_ERROR       = 4,
+       BTRFS_CACHE_NO,
+       BTRFS_CACHE_STARTED,
+       BTRFS_CACHE_FAST,
+       BTRFS_CACHE_FINISHED,
+       BTRFS_CACHE_ERROR,
 };
 
 enum btrfs_disk_cache_state {
-       BTRFS_DC_WRITTEN        = 0,
-       BTRFS_DC_ERROR          = 1,
-       BTRFS_DC_CLEAR          = 2,
-       BTRFS_DC_SETUP          = 3,
+       BTRFS_DC_WRITTEN,
+       BTRFS_DC_ERROR,
+       BTRFS_DC_CLEAR,
+       BTRFS_DC_SETUP,
 };
 
 struct btrfs_caching_control {
@@ -2621,10 +2621,10 @@ static inline gfp_t btrfs_alloc_write_mask(struct address_space *mapping)
 /* extent-tree.c */
 
 enum btrfs_inline_ref_type {
-       BTRFS_REF_TYPE_INVALID =         0,
-       BTRFS_REF_TYPE_BLOCK =           1,
-       BTRFS_REF_TYPE_DATA =            2,
-       BTRFS_REF_TYPE_ANY =             3,
+       BTRFS_REF_TYPE_INVALID,
+       BTRFS_REF_TYPE_BLOCK,
+       BTRFS_REF_TYPE_DATA,
+       BTRFS_REF_TYPE_ANY,
 };
 
 int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
index 4cccba22640fb6c434dd699ea482c93dbc72ab72..987a64bc0c6673c02237300130f6bdd9e0b7cdb9 100644 (file)
 #define BTRFS_BDEV_BLOCKSIZE   (4096)
 
 enum btrfs_wq_endio_type {
-       BTRFS_WQ_ENDIO_DATA = 0,
-       BTRFS_WQ_ENDIO_METADATA = 1,
-       BTRFS_WQ_ENDIO_FREE_SPACE = 2,
-       BTRFS_WQ_ENDIO_RAID56 = 3,
-       BTRFS_WQ_ENDIO_DIO_REPAIR = 4,
+       BTRFS_WQ_ENDIO_DATA,
+       BTRFS_WQ_ENDIO_METADATA,
+       BTRFS_WQ_ENDIO_FREE_SPACE,
+       BTRFS_WQ_ENDIO_RAID56,
+       BTRFS_WQ_ENDIO_DIO_REPAIR,
 };
 
 static inline u64 btrfs_sb_offset(int mirror)
index d8f78f5ab854a08a7ea673b9a7df031a37b96633..e4e6ee44073ad4c6ab9fce832fea1c4c32f58593 100644 (file)
@@ -70,7 +70,7 @@ struct btrfs_qgroup_extent_record {
  *     be converted into META_PERTRANS.
  */
 enum btrfs_qgroup_rsv_type {
-       BTRFS_QGROUP_RSV_DATA = 0,
+       BTRFS_QGROUP_RSV_DATA,
        BTRFS_QGROUP_RSV_META_PERTRANS,
        BTRFS_QGROUP_RSV_META_PREALLOC,
        BTRFS_QGROUP_RSV_LAST,
index c6ee600aff899945e2e547e59826892d926bb8f8..40716b357c1d516193958479ea28702b0014003b 100644 (file)
@@ -9,7 +9,7 @@
 extern u64 btrfs_debugfs_test;
 
 enum btrfs_feature_set {
-       FEAT_COMPAT = 0,
+       FEAT_COMPAT,
        FEAT_COMPAT_RO,
        FEAT_INCOMPAT,
        FEAT_MAX
index 703d5116a2fc32de823bc724539d3468ca103318..f1ba78949d1b0c23b9ac13293a268278c4e5ce06 100644 (file)
 #include "ctree.h"
 
 enum btrfs_trans_state {
-       TRANS_STATE_RUNNING             = 0,
-       TRANS_STATE_BLOCKED             = 1,
-       TRANS_STATE_COMMIT_START        = 2,
-       TRANS_STATE_COMMIT_DOING        = 3,
-       TRANS_STATE_UNBLOCKED           = 4,
-       TRANS_STATE_COMPLETED           = 5,
-       TRANS_STATE_MAX                 = 6,
+       TRANS_STATE_RUNNING,
+       TRANS_STATE_BLOCKED,
+       TRANS_STATE_COMMIT_START,
+       TRANS_STATE_COMMIT_DOING,
+       TRANS_STATE_UNBLOCKED,
+       TRANS_STATE_COMPLETED,
+       TRANS_STATE_MAX,
 };
 
 #define BTRFS_TRANS_HAVE_FREE_BGS      0