btrfs-progs: cmds: use LOG_DEFAULT for messages

Use LOG_DEFAULT message level for all commands where it currently uses
the LOG_ALWAYS level. There are now hardcoded values in many other calls
to pr_verbose and this will be updated in following patches.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-10-04 16:28:33 +02:00
parent dd724f2180
commit 2f491989e1
6 changed files with 16 additions and 16 deletions

View File

@ -351,7 +351,7 @@ static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args,
} else if (ret > 0) {
error("balance: %s", btrfs_err_str(ret));
} else {
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"Done, had to relocate %llu out of %llu chunks\n",
(unsigned long long)args->stat.completed,
(unsigned long long)args->stat.considered);
@ -742,7 +742,7 @@ static int cmd_balance_resume(const struct cmd_struct *cmd,
ret = 1;
}
} else {
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"Done, had to relocate %llu out of %llu chunks\n",
(unsigned long long)args.stat.completed,
(unsigned long long)args.stat.considered);

View File

@ -453,7 +453,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
error("cannot unregister devices: %m");
}
} else {
pr_verbose(LOG_ALWAYS, "Scanning for Btrfs filesystems\n");
pr_verbose(LOG_DEFAULT, "Scanning for Btrfs filesystems\n");
ret = btrfs_scan_devices(1);
error_on(ret, "error %d while scanning", ret);
ret = btrfs_register_all_devices();

View File

@ -177,7 +177,7 @@ static int cmd_quota_rescan(const struct cmd_struct *cmd, int argc, char **argv)
}
if (ret == 0) {
pr_verbose(LOG_ALWAYS, "quota rescan started\n");
pr_verbose(LOG_DEFAULT, "quota rescan started\n");
fflush(stdout);
} else if (ret < 0 && (!wait_for_completion || e != EINPROGRESS)) {
error("quota rescan failed: %m");

View File

@ -787,8 +787,8 @@ static int overwrite_ok(const char * path)
return 2;
if (!warn) {
pr_verbose(LOG_ALWAYS, "Skipping existing file %s\n", path);
pr_verbose(LOG_ALWAYS, "If you wish to overwrite use -o\n");
pr_verbose(LOG_DEFAULT, "Skipping existing file %s\n", path);
pr_verbose(LOG_DEFAULT, "If you wish to overwrite use -o\n");
} else {
pr_verbose(1, "Skipping existing file %s\n", path);
}

View File

@ -1354,7 +1354,7 @@ static int scrub_start(const struct cmd_struct *cmd, int argc, char **argv,
}
if (!n_start && !n_resume) {
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"scrub: nothing to resume for %s, fsid %s\n",
path, fsid);
nothing_to_resume = 1;
@ -1427,7 +1427,7 @@ static int scrub_start(const struct cmd_struct *cmd, int argc, char **argv,
if (pid) {
int stat;
scrub_handle_sigint_parent();
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"scrub %s on %s, fsid %s (pid=%d)\n",
n_start ? "started" : "resumed",
path, fsid, pid);
@ -1688,7 +1688,7 @@ static int cmd_scrub_cancel(const struct cmd_struct *cmd, int argc, char **argv)
}
ret = 0;
pr_verbose(LOG_ALWAYS, "scrub cancelled\n");
pr_verbose(LOG_DEFAULT, "scrub cancelled\n");
out:
close_file_or_dir(fdmnt, dirstream);

View File

@ -172,7 +172,7 @@ static int cmd_subvol_create(const struct cmd_struct *cmd,
if (fddst < 0)
goto out;
pr_verbose(LOG_ALWAYS, "Create subvolume '%s/%s'\n", dstdir, newname);
pr_verbose(LOG_DEFAULT, "Create subvolume '%s/%s'\n", dstdir, newname);
if (inherit) {
struct btrfs_ioctl_vol_args_v2 args;
@ -402,17 +402,17 @@ again:
goto out;
}
pr_verbose(LOG_ALWAYS, "Delete subvolume (%s): ",
pr_verbose(LOG_DEFAULT, "Delete subvolume (%s): ",
commit_mode == COMMIT_EACH ||
(commit_mode == COMMIT_AFTER && cnt + 1 == argc) ?
"commit" : "no-commit");
if (subvolid == 0)
pr_verbose(LOG_ALWAYS, "'%s/%s'\n", dname, vname);
pr_verbose(LOG_DEFAULT, "'%s/%s'\n", dname, vname);
else if (!subvol_path_not_found)
pr_verbose(LOG_ALWAYS, "'%s'\n", full_subvolpath);
pr_verbose(LOG_DEFAULT, "'%s'\n", full_subvolpath);
else
pr_verbose(LOG_ALWAYS, "subvolid=%llu\n", subvolid);
pr_verbose(LOG_DEFAULT, "subvolid=%llu\n", subvolid);
if (subvolid == 0)
err = btrfs_util_delete_subvolume_fd(fd, vname, 0);
@ -634,11 +634,11 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
if (readonly) {
args.flags |= BTRFS_SUBVOL_RDONLY;
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"Create a readonly snapshot of '%s' in '%s/%s'\n",
subvol, dstdir, newname);
} else {
pr_verbose(LOG_ALWAYS,
pr_verbose(LOG_DEFAULT,
"Create a snapshot of '%s' in '%s/%s'\n",
subvol, dstdir, newname);
}