summaryrefslogtreecommitdiff
path: root/libbcachefs/super-io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-12-16 14:42:09 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2019-12-16 14:42:09 -0500
commit92d34f6ed29e90d48c40a4c31816df805edfe483 (patch)
tree01686f4d7c446156ee54a8eb5dce2132ef54993c /libbcachefs/super-io.h
parentf574ca05f8b8284f28e61d5e788550bed15fc006 (diff)
Update bcachefs sources to fbb669e9de bcachefs: Kill btree_node_iter_large
Diffstat (limited to 'libbcachefs/super-io.h')
-rw-r--r--libbcachefs/super-io.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/libbcachefs/super-io.h b/libbcachefs/super-io.h
index f5450e5..7a06815 100644
--- a/libbcachefs/super-io.h
+++ b/libbcachefs/super-io.h
@@ -43,26 +43,6 @@ struct bch_sb_field_ops {
struct bch_sb_field *);
};
-static inline bool bch2_sb_test_feature(struct bch_sb *sb,
- enum bch_sb_features f)
-{
- unsigned w = f / 64;
- unsigned b = f % 64;
-
- return le64_to_cpu(sb->features[w]) & (1ULL << b);
-}
-
-static inline void bch2_sb_set_feature(struct bch_sb *sb,
- enum bch_sb_features f)
-{
- if (!bch2_sb_test_feature(sb, f)) {
- unsigned w = f / 64;
- unsigned b = f % 64;
-
- le64_add_cpu(&sb->features[w], 1ULL << b);
- }
-}
-
static inline __le64 bch2_sb_magic(struct bch_fs *c)
{
__le64 ret;
@@ -90,6 +70,13 @@ const char *bch2_sb_validate(struct bch_sb_handle *);
int bch2_read_super(const char *, struct bch_opts *, struct bch_sb_handle *);
int bch2_write_super(struct bch_fs *);
+void __bch2_check_set_feature(struct bch_fs *, unsigned);
+
+static inline void bch2_check_set_feature(struct bch_fs *c, unsigned feat)
+{
+ if (!(c->sb.features & (1ULL << feat)))
+ __bch2_check_set_feature(c, feat);
+}
/* BCH_SB_FIELD_journal: */