summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-04 05:01:40 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:33 +0300
commit401ec4db630802729f10d53ad995083ced98caca (patch)
tree245f07e5928f1414b6da71f14c417829e763fdde /fs/bcachefs/alloc_foreground.c
parent652018d66190412669a898c2dc3e75073eac8679 (diff)
downloadlinux-401ec4db630802729f10d53ad995083ced98caca.tar.xz
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/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index d871e1f11f29..ef8f10a51489 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -299,7 +299,7 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc
int ret;
if (b < ca->mi.first_bucket || b >= ca->mi.nbuckets) {
- pr_buf(&buf, "freespace btree has bucket outside allowed range %u-%llu\n"
+ prt_printf(&buf, "freespace btree has bucket outside allowed range %u-%llu\n"
" freespace key ",
ca->mi.first_bucket, ca->mi.nbuckets);
bch2_bkey_val_to_text(&buf, c, freespace_k);
@@ -319,11 +319,11 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc
bch2_alloc_to_v4(k, &a);
if (genbits != (alloc_freespace_genbits(a) >> 56)) {
- pr_buf(&buf, "bucket in freespace btree with wrong genbits (got %u should be %llu)\n"
+ prt_printf(&buf, "bucket in freespace btree with wrong genbits (got %u should be %llu)\n"
" freespace key ",
genbits, alloc_freespace_genbits(a) >> 56);
bch2_bkey_val_to_text(&buf, c, freespace_k);
- pr_buf(&buf, "\n ");
+ prt_printf(&buf, "\n ");
bch2_bkey_val_to_text(&buf, c, k);
bch2_trans_inconsistent(trans, "%s", buf.buf);
ob = ERR_PTR(-EIO);
@@ -332,10 +332,10 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc
}
if (a.data_type != BCH_DATA_free) {
- pr_buf(&buf, "non free bucket in freespace btree\n"
+ prt_printf(&buf, "non free bucket in freespace btree\n"
" freespace key ");
bch2_bkey_val_to_text(&buf, c, freespace_k);
- pr_buf(&buf, "\n ");
+ prt_printf(&buf, "\n ");
bch2_bkey_val_to_text(&buf, c, k);
bch2_trans_inconsistent(trans, "%s", buf.buf);
ob = ERR_PTR(-EIO);
@@ -1381,7 +1381,7 @@ void bch2_open_buckets_to_text(struct printbuf *out, struct bch_fs *c)
ob++) {
spin_lock(&ob->lock);
if (ob->valid && !ob->on_partial_list) {
- pr_buf(out, "%zu ref %u type %s %u:%llu:%u\n",
+ prt_printf(out, "%zu ref %u type %s %u:%llu:%u\n",
ob - c->open_buckets,
atomic_read(&ob->pin),
bch2_data_types[ob->data_type],
@@ -1406,17 +1406,17 @@ void bch2_write_points_to_text(struct printbuf *out, struct bch_fs *c)
for (wp = c->write_points;
wp < c->write_points + ARRAY_SIZE(c->write_points);
wp++) {
- pr_buf(out, "%lu: ", wp->write_point);
- bch2_hprint(out, wp->sectors_allocated);
+ prt_printf(out, "%lu: ", wp->write_point);
+ prt_human_readable_u64(out, wp->sectors_allocated);
- pr_buf(out, " last wrote: ");
+ prt_printf(out, " last wrote: ");
bch2_pr_time_units(out, sched_clock() - wp->last_used);
for (i = 0; i < WRITE_POINT_STATE_NR; i++) {
- pr_buf(out, " %s: ", bch2_write_point_states[i]);
+ prt_printf(out, " %s: ", bch2_write_point_states[i]);
bch2_pr_time_units(out, wp->time[i]);
}
- pr_newline(out);
+ prt_newline(out);
}
}