bcachefs: Use btree_type_has_ptrs() more consistently
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 9 Oct 2022 06:25:53 +0000 (02:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:42 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_gc.c
fs/bcachefs/sysfs.c

index 77a1fe81ac3568300787a6a8f847b9163eb4411a..5d19029477cfc83eb3caa82086fc84e0a3ab7f1e 100644 (file)
@@ -1963,7 +1963,7 @@ int bch2_gc_gens(struct bch_fs *c)
        }
 
        for (i = 0; i < BTREE_ID_NR; i++)
-               if ((1 << i) & BTREE_ID_HAS_PTRS) {
+               if (btree_type_has_ptrs(i)) {
                        struct btree_iter iter;
                        struct bkey_s_c k;
 
index 50b3ba92c5ae9e77732be33cdab4a0a6eb1f4685..a27ceabd5e49697829fbcbca1be1c098afd3a9d2 100644 (file)
@@ -298,7 +298,7 @@ static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
        bch2_trans_init(&trans, c, 0, 0);
 
        for (id = 0; id < BTREE_ID_NR; id++) {
-               if (!((1U << id) & BTREE_ID_HAS_PTRS))
+               if (!btree_type_has_ptrs(id))
                        continue;
 
                for_each_btree_key(&trans, iter, id, POS_MIN,