diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-22 00:16:31 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-05-20 13:54:48 -0400 |
commit | f3cd24b05dfac667f183c0d12eac8890edb95f62 (patch) | |
tree | 8831dff58cc40359a085532071ed5df11bfa9c33 /fs/bcachefs/super.c | |
parent | a136245957317195bb1aa87040d5ceba05a916b4 (diff) |
bcachefs: Convert to lib/printbuf.cprintbuf_v2
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index bdac2b727233..b5f4611e9633 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -54,6 +54,7 @@ #include <linux/idr.h> #include <linux/module.h> #include <linux/percpu.h> +#include <linux/pretty-printers.h> #include <linux/random.h> #include <linux/sysfs.h> #include <crypto/hash.h> @@ -596,6 +597,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) { struct bch_sb_field_members *mi; struct bch_fs *c; + struct printbuf name = PRINTBUF; unsigned i, iter_size; int ret = 0; @@ -699,7 +701,13 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) if (ret) goto err; - uuid_unparse_lower(c->sb.user_uuid.b, c->name); + pr_uuid(&name, c->sb.user_uuid.b); + strlcpy(c->name, name.buf, sizeof(c->name)); + printbuf_exit(&name); + + ret = name.allocation_failure ? -ENOMEM : 0; + if (ret) + goto err; /* Compat: */ if (sb->version <= bcachefs_metadata_version_inode_v2 && @@ -1478,7 +1486,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags) if (data) { struct printbuf data_has = PRINTBUF; - bch2_flags_to_text(&data_has, bch2_data_types, data); + pr_bitflags(&data_has, bch2_data_types, data); bch_err(ca, "Remove failed, still has data (%s)", data_has.buf); printbuf_exit(&data_has); ret = -EBUSY; |