Lines Matching refs:cpu_r
520 struct bch_replicas_cpu *cpu_r) in __bch2_sb_replicas_to_cpu_replicas() argument
531 cpu_r->entries = kcalloc(nr, entry_size, GFP_KERNEL); in __bch2_sb_replicas_to_cpu_replicas()
532 if (!cpu_r->entries) in __bch2_sb_replicas_to_cpu_replicas()
535 cpu_r->nr = nr; in __bch2_sb_replicas_to_cpu_replicas()
536 cpu_r->entry_size = entry_size; in __bch2_sb_replicas_to_cpu_replicas()
539 dst = cpu_replicas_entry(cpu_r, idx++); in __bch2_sb_replicas_to_cpu_replicas()
549 struct bch_replicas_cpu *cpu_r) in __bch2_sb_replicas_v0_to_cpu_replicas() argument
563 cpu_r->entries = kcalloc(nr, entry_size, GFP_KERNEL); in __bch2_sb_replicas_v0_to_cpu_replicas()
564 if (!cpu_r->entries) in __bch2_sb_replicas_v0_to_cpu_replicas()
567 cpu_r->nr = nr; in __bch2_sb_replicas_v0_to_cpu_replicas()
568 cpu_r->entry_size = entry_size; in __bch2_sb_replicas_v0_to_cpu_replicas()
572 cpu_replicas_entry(cpu_r, idx++); in __bch2_sb_replicas_v0_to_cpu_replicas()
691 static int bch2_cpu_replicas_validate(struct bch_replicas_cpu *cpu_r, in bch2_cpu_replicas_validate() argument
697 sort_r(cpu_r->entries, in bch2_cpu_replicas_validate()
698 cpu_r->nr, in bch2_cpu_replicas_validate()
699 cpu_r->entry_size, in bch2_cpu_replicas_validate()
701 (void *)(size_t)cpu_r->entry_size); in bch2_cpu_replicas_validate()
703 for (i = 0; i < cpu_r->nr; i++) { in bch2_cpu_replicas_validate()
705 cpu_replicas_entry(cpu_r, i); in bch2_cpu_replicas_validate()
711 if (i + 1 < cpu_r->nr) { in bch2_cpu_replicas_validate()
713 cpu_replicas_entry(cpu_r, i + 1); in bch2_cpu_replicas_validate()
715 BUG_ON(memcmp(e, n, cpu_r->entry_size) > 0); in bch2_cpu_replicas_validate()
717 if (!memcmp(e, n, cpu_r->entry_size)) { in bch2_cpu_replicas_validate()
732 struct bch_replicas_cpu cpu_r; in bch2_sb_replicas_validate() local
735 ret = __bch2_sb_replicas_to_cpu_replicas(sb_r, &cpu_r); in bch2_sb_replicas_validate()
739 ret = bch2_cpu_replicas_validate(&cpu_r, sb, err); in bch2_sb_replicas_validate()
740 kfree(cpu_r.entries); in bch2_sb_replicas_validate()
771 struct bch_replicas_cpu cpu_r; in bch2_sb_replicas_v0_validate() local
774 ret = __bch2_sb_replicas_v0_to_cpu_replicas(sb_r, &cpu_r); in bch2_sb_replicas_v0_validate()
778 ret = bch2_cpu_replicas_validate(&cpu_r, sb, err); in bch2_sb_replicas_v0_validate()
779 kfree(cpu_r.entries); in bch2_sb_replicas_v0_validate()