OSDN Git Service

btrfs: switch EXTENT_FLAG_* to enums
authorDavid Sterba <dsterba@suse.com>
Tue, 27 Nov 2018 14:11:43 +0000 (15:11 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:43 +0000 (14:51 +0100)
We can use simple enum for values that are not part of on-disk format:
extent map flags.

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

index 31977ff..ef05a01 100644 (file)
 #define EXTENT_MAP_INLINE ((u64)-2)
 #define EXTENT_MAP_DELALLOC ((u64)-1)
 
-/* bits for the flags field */
-#define EXTENT_FLAG_PINNED 0 /* this entry not yet on disk, don't free it */
-#define EXTENT_FLAG_COMPRESSED 1
-#define EXTENT_FLAG_PREALLOC 3 /* pre-allocated extent */
-#define EXTENT_FLAG_LOGGING 4 /* Logging this extent */
-#define EXTENT_FLAG_FILLING 5 /* Filling in a preallocated extent */
-#define EXTENT_FLAG_FS_MAPPING 6 /* filesystem extent mapping type */
+/* bits for the extent_map::flags field */
+enum {
+       /* this entry not yet on disk, don't free it */
+       EXTENT_FLAG_PINNED,
+       EXTENT_FLAG_COMPRESSED,
+       /* pre-allocated extent */
+       EXTENT_FLAG_PREALLOC,
+       /* Logging this extent */
+       EXTENT_FLAG_LOGGING,
+       /* Filling in a preallocated extent */
+       EXTENT_FLAG_FILLING,
+       /* filesystem extent mapping type */
+       EXTENT_FLAG_FS_MAPPING,
+};
 
 struct extent_map {
        struct rb_node rb_node;