]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/alloc.h
Update bcachefs sources to 9abf628c70 bcachefs: Fix a spurious error in fsck
[bcachefs-tools-debian] / libbcachefs / alloc.h
index f914dbd56c2cfb6ac53526dadaca569ee8bd8107..00d01f464c68f3a95c30883f076cb82eeede8aa5 100644 (file)
@@ -9,6 +9,14 @@ struct bch_dev;
 struct bch_fs;
 struct bch_devs_List;
 
+const char *bch2_alloc_invalid(const struct bch_fs *, struct bkey_s_c);
+void bch2_alloc_to_text(struct bch_fs *, char *, size_t, struct bkey_s_c);
+
+#define bch2_bkey_alloc_ops (struct bkey_ops) {                \
+       .key_invalid    = bch2_alloc_invalid,           \
+       .val_to_text    = bch2_alloc_to_text,           \
+}
+
 struct dev_alloc_list {
        unsigned        nr;
        u8              devs[BCH_SB_MEMBERS_MAX];
@@ -30,6 +38,8 @@ enum bucket_alloc_ret {
        NO_DEVICES              = -3,   /* -EROFS */
 };
 
+long bch2_bucket_alloc_new_fs(struct bch_dev *);
+
 int bch2_bucket_alloc(struct bch_fs *, struct bch_dev *, enum alloc_reserve, bool,
                      struct closure *);
 
@@ -93,7 +103,8 @@ static inline void bch2_wake_allocator(struct bch_dev *ca)
        struct task_struct *p;
 
        rcu_read_lock();
-       if ((p = READ_ONCE(ca->alloc_thread)))
+       p = rcu_dereference(ca->alloc_thread);
+       if (p)
                wake_up_process(p);
        rcu_read_unlock();
 }
@@ -127,6 +138,4 @@ int bch2_alloc_write(struct bch_fs *);
 int bch2_fs_allocator_start(struct bch_fs *);
 void bch2_fs_allocator_init(struct bch_fs *);
 
-extern const struct bkey_ops bch2_bkey_alloc_ops;
-
 #endif /* _BCACHEFS_ALLOC_H */