btrfs: convert discard stat defs to enum
authorJosef Bacik <josef@toxicpanda.com>
Wed, 26 Oct 2022 19:08:16 +0000 (15:08 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:45 +0000 (18:00 +0100)
Do away with the defines and use an enum as it's cleaner.

Suggested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.h

index cab954a..a855e04 100644 (file)
@@ -48,9 +48,11 @@ static inline bool btrfs_free_space_trimming_bitmap(
  * to make it clear what we're doing.  An example is discard_extents in
  * btrfs_free_space_ctl.
  */
-#define BTRFS_STAT_NR_ENTRIES  2
-#define BTRFS_STAT_CURR                0
-#define BTRFS_STAT_PREV                1
+enum {
+       BTRFS_STAT_CURR,
+       BTRFS_STAT_PREV,
+       BTRFS_STAT_NR_ENTRIES,
+};
 
 struct btrfs_free_space_ctl {
        spinlock_t tree_lock;