]> git.dujemihanovic.xyz Git - linux.git/commitdiff
bcachefs: ec_stripe_head.nr_created
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 1 Sep 2024 20:44:36 +0000 (16:44 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Sep 2024 15:39:48 +0000 (11:39 -0400)
additional debug stat

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c
fs/bcachefs/ec.h

index 50e5fdc30874c182f076e971c11754411fb5cd56..24140c485eee24a9bb2ce5fad73ab9da04919847 100644 (file)
@@ -1703,6 +1703,7 @@ static int ec_new_stripe_alloc(struct bch_fs *c, struct ec_stripe_head *h)
                           h->blocksize, h->disk_label);
 
        h->s = s;
+       h->nr_created++;
        return 0;
 }
 
@@ -2278,9 +2279,10 @@ void bch2_new_stripes_to_text(struct printbuf *out, struct bch_fs *c)
 
        mutex_lock(&c->ec_stripe_head_lock);
        list_for_each_entry(h, &c->ec_stripe_head_list, list) {
-               prt_printf(out, "disk label %u algo %u redundancy %u %s:\n",
+               prt_printf(out, "disk label %u algo %u redundancy %u %s nr created %llu:\n",
                       h->disk_label, h->algo, h->redundancy,
-                      bch2_watermarks[h->watermark]);
+                      bch2_watermarks[h->watermark],
+                      h->nr_created);
 
                if (h->s)
                        bch2_new_stripe_to_text(out, c, h->s);
index b400c7e0ed9c22629dfb7b05697bef864efd6a50..f02bb7d2e7674b0ff4f711c68136bc543697f24c 100644 (file)
@@ -193,6 +193,8 @@ struct ec_stripe_head {
        unsigned                redundancy;
        enum bch_watermark      watermark;
 
+       u64                     nr_created;
+
        struct bch_devs_mask    devs;
        unsigned                nr_active_devs;