diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-20 19:27:02 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-20 20:01:27 -0500 |
commit | c48aaac378fb02b8de98032909e155dfe46dac28 (patch) | |
tree | 7373ee95f39827e6d091d8d302f1e8a73df4e2e1 | |
parent | 0939e1c73231c779c961e1143e1ba489ef2b168c (diff) |
bcachefs: Make log message at startup a bit cleaner
Don't print out opts= if no options have been specified.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/super.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 95c16f70512f..30818e838814 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -850,9 +850,12 @@ static void print_mount_opts(struct bch_fs *c) struct printbuf p = PRINTBUF; bool first = true; + prt_printf(&p, "mounted version=%s", bch2_metadata_versions[c->sb.version]); + if (c->opts.read_only) { - prt_printf(&p, "ro"); + prt_str(&p, " opts="); first = false; + prt_printf(&p, "ro"); } for (i = 0; i < bch2_opts_nr; i++) { @@ -865,16 +868,12 @@ static void print_mount_opts(struct bch_fs *c) if (v == bch2_opt_get_by_id(&bch2_opts_default, i)) continue; - if (!first) - prt_printf(&p, ","); + prt_str(&p, first ? " opts=" : ","); first = false; bch2_opt_to_text(&p, c, c->disk_sb.sb, opt, v, OPT_SHOW_MOUNT_STYLE); } - if (!p.pos) - prt_printf(&p, "(null)"); - - bch_info(c, "mounted version=%s opts=%s", bch2_metadata_versions[c->sb.version], p.buf); + bch_info(c, "%s", p.buf); printbuf_exit(&p); } |