diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-07-12 12:47:02 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-07-12 19:49:41 -0400 |
commit | f9d8d2c51da619c0714ff5778f1f9c586034389c (patch) | |
tree | 2b9caf4a609a0425b2efdf70f4265d2e8c0be406 | |
parent | dae984cf382a5fe3572dc875b9fe86a9163ff035 (diff) |
cmd_image: hook up c->loglevel
Quieter output.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | c_src/cmd_image.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/c_src/cmd_image.c b/c_src/cmd_image.c index b79d36d1..dca01825 100644 --- a/c_src/cmd_image.c +++ b/c_src/cmd_image.c @@ -253,11 +253,9 @@ static void image_create(struct bch_opt_strs fs_opt_strs, struct bch_opts opts = bch2_opts_empty(); opt_set(opts, copygc_enabled, false); opt_set(opts, rebalance_enabled, false); + opt_set(opts, nostart, true); struct bch_fs *c = bch2_fs_open(&device_paths, &opts); - - unlink(device_paths.data[1]); - int ret = PTR_ERR_OR_ZERO(c); if (ret) { fprintf(stderr, "error opening %s: %s\n", @@ -265,10 +263,20 @@ static void image_create(struct bch_opt_strs fs_opt_strs, goto err; } + c->loglevel = 5 + max_t(int, 0, verbosity - 1); + + unlink(device_paths.data[1]); + + ret = bch2_fs_start(c); + bch_err_msg(c, ret, "starting fs"); + if (ret) + goto err; + struct copy_fs_state s = {}; copy_fs(c, src_fd, src_path, &s, 0); - printf("moving non-alloc btree to primary device\n"); + if (verbosity > 1) + printf("moving non-alloc btree to primary device\n"); mutex_lock(&c->sb_lock); struct bch_member *m = bch2_members_v2_get_mut(c->disk_sb.sb, 0); |