diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-21 03:27:02 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:48 +0300 |
commit | 60573ff5d0de3f54a8af397f5ba9d3ab443f274e (patch) | |
tree | dacfa82a9569347109205cc3dcdc2a4bd9a132d1 /fs/bcachefs/super.c | |
parent | 5bbe3f2d0e1e52c03f32cb40cc749e1ace6453d0 (diff) | |
download | linux-60573ff5d0de3f54a8af397f5ba9d3ab443f274e.tar.xz |
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>
Diffstat (limited to 'fs/bcachefs/super.c')
-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 37dce3e3cccb..c911a07f8e8e 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -846,9 +846,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++) { @@ -861,16 +864,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); } |