diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-03 21:01:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:33 -0400 |
commit | 401ec4db630802729f10d53ad995083ced98caca (patch) | |
tree | 245f07e5928f1414b6da71f14c417829e763fdde /fs/bcachefs/dirent.c | |
parent | 652018d66190412669a898c2dc3e75073eac8679 (diff) | |
download | linux-401ec4db630802729f10d53ad995083ced98caca.tar.gz linux-401ec4db630802729f10d53ad995083ced98caca.tar.bz2 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/dirent.c')
-rw-r--r-- | fs/bcachefs/dirent.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 716c85062cea..0cbb765cde54 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -90,47 +90,47 @@ int bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k, unsigned len; if (bkey_val_bytes(k.k) < sizeof(struct bch_dirent)) { - pr_buf(err, "incorrect value size (%zu < %zu)", + prt_printf(err, "incorrect value size (%zu < %zu)", bkey_val_bytes(k.k), sizeof(*d.v)); return -EINVAL; } len = bch2_dirent_name_bytes(d); if (!len) { - pr_buf(err, "empty name"); + prt_printf(err, "empty name"); return -EINVAL; } if (bkey_val_u64s(k.k) > dirent_val_u64s(len)) { - pr_buf(err, "value too big (%zu > %u)", + prt_printf(err, "value too big (%zu > %u)", bkey_val_u64s(k.k),dirent_val_u64s(len)); return -EINVAL; } if (len > BCH_NAME_MAX) { - pr_buf(err, "dirent name too big (%u > %u)", + prt_printf(err, "dirent name too big (%u > %u)", len, BCH_NAME_MAX); return -EINVAL; } if (len == 1 && !memcmp(d.v->d_name, ".", 1)) { - pr_buf(err, "invalid name"); + prt_printf(err, "invalid name"); return -EINVAL; } if (len == 2 && !memcmp(d.v->d_name, "..", 2)) { - pr_buf(err, "invalid name"); + prt_printf(err, "invalid name"); return -EINVAL; } if (memchr(d.v->d_name, '/', len)) { - pr_buf(err, "invalid name"); + prt_printf(err, "invalid name"); return -EINVAL; } if (d.v->d_type != DT_SUBVOL && le64_to_cpu(d.v->d_inum) == d.k->p.inode) { - pr_buf(err, "dirent points to own directory"); + prt_printf(err, "dirent points to own directory"); return -EINVAL; } @@ -142,7 +142,7 @@ void bch2_dirent_to_text(struct printbuf *out, struct bch_fs *c, { struct bkey_s_c_dirent d = bkey_s_c_to_dirent(k); - pr_buf(out, "%.*s -> %llu type %s", + prt_printf(out, "%.*s -> %llu type %s", bch2_dirent_name_bytes(d), d.v->d_name, d.v->d_type != DT_SUBVOL |