diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-04 03:01:40 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:33 +0200 |
commit | 401ec4db630802729f10d53ad995083ced98caca (patch) | |
tree | 245f07e5928f1414b6da71f14c417829e763fdde /fs/bcachefs/xattr.c | |
parent | bcachefs: Fix btree node read error path (diff) | |
download | linux-401ec4db630802729f10d53ad995083ced98caca.tar.xz linux-401ec4db630802729f10d53ad995083ced98caca.zip |
bcachefs: Printbuf rework
This converts bcachefs to the modern printbuf interface/implementation,
synced with the version to be submitted upstream.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/xattr.c')
-rw-r--r-- | fs/bcachefs/xattr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c index b5e42ca35dea..5df61b6b4a3c 100644 --- a/fs/bcachefs/xattr.c +++ b/fs/bcachefs/xattr.c @@ -76,7 +76,7 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k, struct bkey_s_c_xattr xattr = bkey_s_c_to_xattr(k); if (bkey_val_bytes(k.k) < sizeof(struct bch_xattr)) { - pr_buf(err, "incorrect value size (%zu < %zu)", + prt_printf(err, "incorrect value size (%zu < %zu)", bkey_val_bytes(k.k), sizeof(*xattr.v)); return -EINVAL; } @@ -84,7 +84,7 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bkey_val_u64s(k.k) < xattr_val_u64s(xattr.v->x_name_len, le16_to_cpu(xattr.v->x_val_len))) { - pr_buf(err, "value too small (%zu < %u)", + prt_printf(err, "value too small (%zu < %u)", bkey_val_u64s(k.k), xattr_val_u64s(xattr.v->x_name_len, le16_to_cpu(xattr.v->x_val_len))); @@ -95,7 +95,7 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bkey_val_u64s(k.k) > xattr_val_u64s(xattr.v->x_name_len, le16_to_cpu(xattr.v->x_val_len) + 4)) { - pr_buf(err, "value too big (%zu > %u)", + prt_printf(err, "value too big (%zu > %u)", bkey_val_u64s(k.k), xattr_val_u64s(xattr.v->x_name_len, le16_to_cpu(xattr.v->x_val_len) + 4)); @@ -104,12 +104,12 @@ int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k, handler = bch2_xattr_type_to_handler(xattr.v->x_type); if (!handler) { - pr_buf(err, "invalid type (%u)", xattr.v->x_type); + prt_printf(err, "invalid type (%u)", xattr.v->x_type); return -EINVAL; } if (memchr(xattr.v->x_name, '\0', xattr.v->x_name_len)) { - pr_buf(err, "xattr name has invalid characters"); + prt_printf(err, "xattr name has invalid characters"); return -EINVAL; } @@ -124,13 +124,13 @@ void bch2_xattr_to_text(struct printbuf *out, struct bch_fs *c, handler = bch2_xattr_type_to_handler(xattr.v->x_type); if (handler && handler->prefix) - pr_buf(out, "%s", handler->prefix); + prt_printf(out, "%s", handler->prefix); else if (handler) - pr_buf(out, "(type %u)", xattr.v->x_type); + prt_printf(out, "(type %u)", xattr.v->x_type); else - pr_buf(out, "(unknown type %u)", xattr.v->x_type); + prt_printf(out, "(unknown type %u)", xattr.v->x_type); - pr_buf(out, "%.*s:%.*s", + prt_printf(out, "%.*s:%.*s", xattr.v->x_name_len, xattr.v->x_name, le16_to_cpu(xattr.v->x_val_len), |