update for new option code

This commit is contained in:
Kent Overstreet 2017-11-08 15:54:01 -09:00
parent 8351bbc05b
commit b984559329
3 changed files with 19 additions and 19 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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)