]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/alloc_background.h
Update bcachefs sources to 021e62a098 bcachefs: Fix error in filesystem initialization
[bcachefs-tools-debian] / libbcachefs / alloc_background.h
index f6b9f27f071345e2d53d06a657eb27b463683e78..d10ff56e4de169fc5bbb63823f4a5c49cfa8fe1d 100644 (file)
@@ -13,6 +13,9 @@ struct bkey_alloc_unpacked {
 #undef  x
 };
 
+/* How out of date a pointer gen is allowed to be: */
+#define BUCKET_GC_GEN_MAX      96U
+
 /* returns true if not equal */
 static inline bool bkey_alloc_unpacked_cmp(struct bkey_alloc_unpacked l,
                                           struct bkey_alloc_unpacked r)
@@ -28,6 +31,8 @@ struct bkey_alloc_unpacked bch2_alloc_unpack(struct bkey_s_c);
 void bch2_alloc_pack(struct bkey_i_alloc *,
                     const struct bkey_alloc_unpacked);
 
+int bch2_bucket_io_time_reset(struct btree_trans *, unsigned, size_t, int);
+
 static inline struct bkey_alloc_unpacked
 alloc_mem_to_key(struct bucket *g, struct bucket_mark m)
 {
@@ -61,15 +66,17 @@ static inline void bch2_wake_allocator(struct bch_dev *ca)
 
        rcu_read_lock();
        p = rcu_dereference(ca->alloc_thread);
-       if (p)
+       if (p) {
                wake_up_process(p);
+               ca->allocator_state = ALLOCATOR_RUNNING;
+       }
        rcu_read_unlock();
 }
 
 static inline void verify_not_on_freelist(struct bch_fs *c, struct bch_dev *ca,
                                          size_t bucket)
 {
-       if (expensive_debug_checks(c)) {
+       if (bch2_expensive_debug_checks) {
                size_t iter;
                long i;
                unsigned j;
@@ -91,7 +98,8 @@ void bch2_dev_allocator_quiesce(struct bch_fs *, struct bch_dev *);
 void bch2_dev_allocator_stop(struct bch_dev *);
 int bch2_dev_allocator_start(struct bch_dev *);
 
-int bch2_alloc_write(struct bch_fs *, unsigned, bool *);
+int bch2_dev_alloc_write(struct bch_fs *, struct bch_dev *, unsigned);
+int bch2_alloc_write(struct bch_fs *, unsigned);
 void bch2_fs_allocator_background_init(struct bch_fs *);
 
 #endif /* _BCACHEFS_ALLOC_BACKGROUND_H */