summaryrefslogtreecommitdiff
path: root/fs/bcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-09 01:24:07 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:11 -0400
commit319f9ac38eaba628d69b6ddbf402b35487315fc1 (patch)
tree01daddd4881b1f09bb4d50087e8b8803e59fea35 /fs/bcachefs/debug.c
parent75369d4ec3d2dfc52af18a2d20cd0af14c935ac9 (diff)
downloadlinux-319f9ac38eaba628d69b6ddbf402b35487315fc1.tar.gz
linux-319f9ac38eaba628d69b6ddbf402b35487315fc1.tar.bz2
linux-319f9ac38eaba628d69b6ddbf402b35487315fc1.zip
bcachefs: revamp to_text methods
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r--fs/bcachefs/debug.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index 550bb10bbb7b..0a9efe57d5a9 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -223,8 +223,8 @@ static ssize_t bch2_read_btree(struct file *file, char __user *buf,
k = bch2_btree_iter_peek(&iter);
while (k.k && !(err = btree_iter_err(k))) {
- bch2_bkey_val_to_text(i->c, bkey_type(0, i->id),
- i->buf, sizeof(i->buf), k);
+ bch2_bkey_val_to_text(&PBUF(i->buf), i->c,
+ bkey_type(0, i->id), k);
i->bytes = strlen(i->buf);
BUG_ON(i->bytes >= PAGE_SIZE);
i->buf[i->bytes] = '\n';
@@ -272,8 +272,8 @@ static ssize_t bch2_read_btree_formats(struct file *file, char __user *buf,
return i->ret;
for_each_btree_node(&iter, i->c, i->id, i->from, 0, b) {
- i->bytes = bch2_print_btree_node(i->c, b, i->buf,
- sizeof(i->buf));
+ bch2_btree_node_to_text(&PBUF(i->buf), i->c, b);
+ i->bytes = strlen(i->buf);
err = flush_buf(i);
if (err)
break;
@@ -330,17 +330,16 @@ static ssize_t bch2_read_bfloat_failed(struct file *file, char __user *buf,
bch2_btree_node_iter_peek(&l->iter, l->b);
if (l->b != prev_node) {
- i->bytes = bch2_print_btree_node(i->c, l->b, i->buf,
- sizeof(i->buf));
+ bch2_btree_node_to_text(&PBUF(i->buf), i->c, l->b);
+ i->bytes = strlen(i->buf);
err = flush_buf(i);
if (err)
break;
}
prev_node = l->b;
- i->bytes = bch2_bkey_print_bfloat(l->b, _k, i->buf,
- sizeof(i->buf));
-
+ bch2_bfloat_to_text(&PBUF(i->buf), l->b, _k);
+ i->bytes = strlen(i->buf);
err = flush_buf(i);
if (err)
break;