diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-02-20 19:47:58 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:55 -0400 |
commit | 2436cb9fada98d477bb3508a30e520ab3bfaae3e (patch) | |
tree | 8931dcf95d2ec9b8cecbd22527bf74e00461f355 /fs/bcachefs/super.h | |
parent | 41f8b09edc25d8ea1f4cee44a9931deb3cf8b9d6 (diff) |
bcachefs: Use x-macros for more enums
This patch standardizes all the enums that have associated string tables
(probably more enums should have string tables).
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.h')
-rw-r--r-- | fs/bcachefs/super.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/super.h b/fs/bcachefs/super.h index 795229e2d6a1..28e6d78f9fcd 100644 --- a/fs/bcachefs/super.h +++ b/fs/bcachefs/super.h @@ -34,7 +34,7 @@ static inline bool bch2_dev_is_online(struct bch_dev *ca) static inline bool bch2_dev_is_readable(struct bch_dev *ca) { return bch2_dev_is_online(ca) && - ca->mi.state != BCH_MEMBER_STATE_FAILED; + ca->mi.state != BCH_MEMBER_STATE_failed; } static inline bool bch2_dev_get_ioref(struct bch_dev *ca, int rw) @@ -42,8 +42,8 @@ static inline bool bch2_dev_get_ioref(struct bch_dev *ca, int rw) if (!percpu_ref_tryget(&ca->io_ref)) return false; - if (ca->mi.state == BCH_MEMBER_STATE_RW || - (ca->mi.state == BCH_MEMBER_STATE_RO && rw == READ)) + if (ca->mi.state == BCH_MEMBER_STATE_rw || + (ca->mi.state == BCH_MEMBER_STATE_ro && rw == READ)) return true; percpu_ref_put(&ca->io_ref); @@ -158,11 +158,11 @@ static inline struct bch_dev *bch2_get_next_online_dev(struct bch_fs *c, __for_each_online_member(ca, c, iter, ~0) #define for_each_rw_member(ca, c, iter) \ - __for_each_online_member(ca, c, iter, 1 << BCH_MEMBER_STATE_RW) + __for_each_online_member(ca, c, iter, 1 << BCH_MEMBER_STATE_rw) #define for_each_readable_member(ca, c, iter) \ __for_each_online_member(ca, c, iter, \ - (1 << BCH_MEMBER_STATE_RW)|(1 << BCH_MEMBER_STATE_RO)) + (1 << BCH_MEMBER_STATE_rw)|(1 << BCH_MEMBER_STATE_ro)) /* * If a key exists that references a device, the device won't be going away and |