diff options
Diffstat (limited to 'fs/bcachefs/inode.h')
-rw-r--r-- | fs/bcachefs/inode.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h index 7bf95f889d35..07d7020f230d 100644 --- a/fs/bcachefs/inode.h +++ b/fs/bcachefs/inode.h @@ -6,6 +6,8 @@ #include <linux/math64.h> +extern const char * const bch2_inode_opts[]; + const char *bch2_inode_invalid(const struct bch_fs *, struct bkey_s_c); void bch2_inode_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c); @@ -73,17 +75,13 @@ static inline struct bch_io_opts bch2_inode_opts_get(struct bch_inode_unpacked * return ret; } -static inline void __bch2_inode_opt_set(struct bch_inode_unpacked *inode, - enum bch_opt_id id, u64 v) +static inline void bch2_inode_opt_set(struct bch_inode_unpacked *inode, + enum inode_opt_id id, u64 v) { switch (id) { -#define x(_name, ...) \ - case Opt_##_name: \ +#define x(_name, ...) \ + case Inode_opt_##_name: \ inode->bi_##_name = v; \ - if (v) \ - inode->bi_fields_set |= 1U << Inode_opt_##_name;\ - else \ - inode->bi_fields_set &= ~(1U << Inode_opt_##_name);\ break; BCH_INODE_OPTS() #undef x @@ -92,16 +90,18 @@ static inline void __bch2_inode_opt_set(struct bch_inode_unpacked *inode, } } -static inline void bch2_inode_opt_set(struct bch_inode_unpacked *inode, - enum bch_opt_id id, u64 v) -{ - return __bch2_inode_opt_set(inode, id, v + 1); -} - -static inline void bch2_inode_opt_clear(struct bch_inode_unpacked *inode, - enum bch_opt_id id) +static inline u64 bch2_inode_opt_get(struct bch_inode_unpacked *inode, + enum inode_opt_id id) { - return __bch2_inode_opt_set(inode, id, 0); + switch (id) { +#define x(_name, ...) \ + case Inode_opt_##_name: \ + return inode->bi_##_name; + BCH_INODE_OPTS() +#undef x + default: + BUG(); + } } #ifdef CONFIG_BCACHEFS_DEBUG |