summaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-17 13:31:09 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:13 +0300
commit4d269918ed502cba80ddad998bdb087a633c63ab (patch)
tree4ab21b50871475d87b25fe852cccf4822893e6c8 /fs/bcachefs/inode.h
parent721d4ad8eb55bf66ef55b31438b6c8361acf283f (diff)
downloadlinux-4d269918ed502cba80ddad998bdb087a633c63ab.tar.xz
bcachefs: add bcachefs_effective xattrs
Allows seeing xattrs that were inherited, not explicitly set Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.h')
-rw-r--r--fs/bcachefs/inode.h34
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