]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/alloc_background.h
Update bcachefs sources to 799716df00 bcachefs: Delete an incorrect bch2_trans_unlock()
[bcachefs-tools-debian] / libbcachefs / alloc_background.h
index c9ff590ef978f7f17445c90055cb7f349ebf6501..94b3c057cd62539fce10598c673bbc45ebbfe54f 100644 (file)
@@ -159,6 +159,7 @@ void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
        .val_to_text    = bch2_alloc_to_text,           \
        .trans_trigger  = bch2_trans_mark_alloc,        \
        .atomic_trigger = bch2_mark_alloc,              \
+       .min_val_size   = 8,                            \
 })
 
 #define bch2_bkey_ops_alloc_v2 ((struct bkey_ops) {    \
@@ -166,6 +167,7 @@ void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
        .val_to_text    = bch2_alloc_to_text,           \
        .trans_trigger  = bch2_trans_mark_alloc,        \
        .atomic_trigger = bch2_mark_alloc,              \
+       .min_val_size   = 8,                            \
 })
 
 #define bch2_bkey_ops_alloc_v3 ((struct bkey_ops) {    \
@@ -173,6 +175,7 @@ void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
        .val_to_text    = bch2_alloc_to_text,           \
        .trans_trigger  = bch2_trans_mark_alloc,        \
        .atomic_trigger = bch2_mark_alloc,              \
+       .min_val_size   = 16,                           \
 })
 
 #define bch2_bkey_ops_alloc_v4 ((struct bkey_ops) {    \
@@ -181,6 +184,7 @@ void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
        .swab           = bch2_alloc_v4_swab,           \
        .trans_trigger  = bch2_trans_mark_alloc,        \
        .atomic_trigger = bch2_mark_alloc,              \
+       .min_val_size   = 48,                           \
 })
 
 int bch2_bucket_gens_invalid(const struct bch_fs *, struct bkey_s_c, unsigned, struct printbuf *);
@@ -216,7 +220,7 @@ static inline u64 should_invalidate_buckets(struct bch_dev *ca,
        u64 free = max_t(s64, 0,
                           u.d[BCH_DATA_free].buckets
                         + u.d[BCH_DATA_need_discard].buckets
-                        - bch2_dev_buckets_reserved(ca, RESERVE_none));
+                        - bch2_dev_buckets_reserved(ca, RESERVE_stripe));
 
        return clamp_t(s64, want_free - free, 0, u.d[BCH_DATA_cached].buckets);
 }