btrfs-progs: scrub start: print device limit if set

Print one message per scrubbed device and also print the limit if set:

  $ btrfs scrub start /mnt
  scrub started on /mnt, fsid 9ee93131-f680-4d6c-8ca4-a194506e3081 (pid=27257)
  Starting scrub on devid 1 (limit 100.00MiB/s)

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-12-08 17:06:23 +01:00
parent 6e96df640b
commit 9a044fa0ff

View file

@ -1523,6 +1523,12 @@ static int scrub_start(const struct cmd_struct *cmd, int argc, char **argv,
devid = di_args[i].devid;
gettimeofday(&tv, NULL);
sp[i].stats.t_start = tv.tv_sec;
pr_verbose(LOG_DEFAULT, "Starting scrub on devid %llu", devid);
if (sp[i].limit > 0)
pr_verbose(LOG_DEFAULT, " (limit %s/s)\n", pretty_size(sp[i].limit));
else
pr_verbose(LOG_DEFAULT, "\n");
ret = pthread_create(&t_devs[i], NULL,
scrub_one_dev, &sp[i]);
if (ret) {