diff --git a/cmd_debug.c b/cmd_debug.c index d4613ecb..7ee4e1f2 100644 --- a/cmd_debug.c +++ b/cmd_debug.c @@ -88,10 +88,10 @@ int cmd_dump(int argc, char *argv[]) bool force = false; int fd, opt; - opts.nochanges = true; - opts.noreplay = true; - opts.errors = BCH_ON_ERROR_CONTINUE; - opts.degraded = true; + opt_set(opts, nochanges, true); + opt_set(opts, noreplay, true); + opt_set(opts, degraded, true); + opt_set(opts, errors, BCH_ON_ERROR_CONTINUE); while ((opt = getopt(argc, argv, "o:fh")) != -1) switch (opt) { @@ -265,10 +265,10 @@ int cmd_list(int argc, char *argv[]) u64 inum; int mode = 0, opt; - opts.nochanges = true; - opts.norecovery = true; - opts.errors = BCH_ON_ERROR_CONTINUE; - opts.degraded = true; + opt_set(opts, nochanges, true); + opt_set(opts, norecovery, true); + opt_set(opts, degraded, true); + opt_set(opts, errors, BCH_ON_ERROR_CONTINUE); while ((opt = getopt(argc, argv, "b:s:e:i:m:fvh")) != -1) switch (opt) { diff --git a/cmd_fsck.c b/cmd_fsck.c index 5ca9b825..22422233 100644 --- a/cmd_fsck.c +++ b/cmd_fsck.c @@ -27,25 +27,25 @@ int cmd_fsck(int argc, char *argv[]) const char *err; int opt; - opts.degraded = true; + opt_set(opts, degraded, true); while ((opt = getopt(argc, argv, "pynfvh")) != -1) switch (opt) { case 'p': - opts.fix_errors = FSCK_ERR_YES; + opt_set(opts, fix_errors, FSCK_ERR_YES); break; case 'y': - opts.fix_errors = FSCK_ERR_YES; + opt_set(opts, fix_errors, FSCK_ERR_YES); break; case 'n': - opts.nochanges = true; - opts.fix_errors = FSCK_ERR_NO; + opt_set(opts, nochanges, true); + opt_set(opts, fix_errors, FSCK_ERR_NO); break; case 'f': /* force check, even if filesystem marked clean: */ break; case 'v': - opts.verbose_recovery = true; + opt_set(opts, verbose_recovery, true); break; case 'h': usage(); diff --git a/cmd_migrate.c b/cmd_migrate.c index e79f2e06..4b0dd9bc 100644 --- a/cmd_migrate.c +++ b/cmd_migrate.c @@ -749,9 +749,9 @@ int cmd_migrate(int argc, char *argv[]) char *path[1] = { dev.path }; const char *err; - opts.sb = sb_offset; - opts.nostart = true; - opts.noexcl = true; + opt_set(opts, sb, sb_offset); + opt_set(opts, nostart, true); + opt_set(opts, noexcl, true); err = bch2_fs_open(path, 1, opts, &c); if (err) @@ -768,8 +768,8 @@ int cmd_migrate(int argc, char *argv[]) bch2_fs_stop(c); printf("Migrate complete, running fsck:\n"); - opts.nostart = false; - opts.nochanges = true; + opt_set(opts, nostart, false); + opt_set(opts, nochanges, true); err = bch2_fs_open(path, 1, opts, &c); if (err)