Merge tag 'bcachefs-2024-05-19' of https://evilpiepirate.org/git/bcachefs
[linux-2.6-block.git] / fs / bcachefs / disk_groups.c
index 06a7df529b401c2f8665c17d66803b4649692bc9..521a86df5e52aa185aee34d079803d77e1d13354 100644 (file)
@@ -18,9 +18,8 @@ static int group_cmp(const void *_l, const void *_r)
                strncmp(l->label, r->label, sizeof(l->label));
 }
 
-static int bch2_sb_disk_groups_validate(struct bch_sb *sb,
-                                       struct bch_sb_field *f,
-                                       struct printbuf *err)
+static int bch2_sb_disk_groups_validate(struct bch_sb *sb, struct bch_sb_field *f,
+                               enum bch_validate_flags flags, struct printbuf *err)
 {
        struct bch_sb_field_disk_groups *groups =
                field_to_type(f, disk_groups);
@@ -177,7 +176,7 @@ int bch2_sb_disk_groups_to_cpu(struct bch_fs *c)
                struct bch_member m = bch2_sb_member_get(c->disk_sb.sb, i);
                struct bch_disk_group_cpu *dst;
 
-               if (!bch2_member_exists(&m))
+               if (!bch2_member_alive(&m))
                        continue;
 
                g = BCH_MEMBER_GROUP(&m);
@@ -523,7 +522,7 @@ int bch2_opt_target_parse(struct bch_fs *c, const char *val, u64 *res,
        ca = bch2_dev_lookup(c, val);
        if (!IS_ERR(ca)) {
                *res = dev_to_target(ca->dev_idx);
-               percpu_ref_put(&ca->ref);
+               bch2_dev_put(ca);
                return 0;
        }
 
@@ -588,7 +587,7 @@ static void bch2_target_to_text_sb(struct printbuf *out, struct bch_sb *sb, unsi
        case TARGET_DEV: {
                struct bch_member m = bch2_sb_member_get(sb, t.dev);
 
-               if (bch2_dev_exists(sb, t.dev)) {
+               if (bch2_member_exists(sb, t.dev)) {
                        prt_printf(out, "Device ");
                        pr_uuid(out, m.uuid.b);
                        prt_printf(out, " (%u)", t.dev);