btrfs: switch BTRFS_BLOCK_RSV_* to enums
authorDavid Sterba <dsterba@suse.com>
Tue, 27 Nov 2018 13:53:06 +0000 (14:53 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:42 +0000 (14:51 +0100)
We can use simple enum for values that are not part of on-disk format:
block reserve types.

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/ctree.h

index 84ffd3163aec593c89696401ee62b99f0480b93a..becfe1d10e470241892327623c6b5461c1e2edb2 100644 (file)
@@ -461,13 +461,18 @@ struct btrfs_space_info {
        struct kobject *block_group_kobjs[BTRFS_NR_RAID_TYPES];
 };
 
        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;
 
 struct btrfs_block_rsv {
        u64 size;