diff options
Diffstat (limited to 'libbcachefs.c')
-rw-r--r-- | libbcachefs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libbcachefs.c b/libbcachefs.c index 499badb..e55d8ec 100644 --- a/libbcachefs.c +++ b/libbcachefs.c @@ -258,6 +258,20 @@ struct bch_sb *bch2_format(struct bch_opt_strs fs_opt_strs, SET_BCH_MEMBER_GROUP(m, idx + 1); } + for (i = devs; i < devs + nr_devs; i++) { + struct bch_member *m = bch2_members_v2_get_mut(sb.sb, (i - devs)); + + for (unsigned j = 0; j < ARRAY_SIZE(m->iops); j++) { + int iops = benchmark_device(i->bdev, j); + + if (iops < 0) + die("error benchmarking device %s", i->path); + if (!iops) + fprintf(stderr, "Warning device not performing any operations"); + m->iops[j] = cpu_to_le32(iops); + } + } + SET_BCH_SB_FOREGROUND_TARGET(sb.sb, parse_target(&sb, devs, nr_devs, fs_opt_strs.foreground_target)); SET_BCH_SB_BACKGROUND_TARGET(sb.sb, |