diff options
Diffstat (limited to 'fs/bcachefs/quota.c')
-rw-r--r-- | fs/bcachefs/quota.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c index 79a7f82868d6..8127f4454dac 100644 --- a/fs/bcachefs/quota.c +++ b/fs/bcachefs/quota.c @@ -46,10 +46,9 @@ static const char * const bch2_quota_counters[] = { "inodes", }; -int bch2_quota_to_text(struct bch_fs *c, char *buf, - size_t size, struct bkey_s_c k) +void bch2_quota_to_text(struct printbuf *out, struct bch_fs *c, + struct bkey_s_c k) { - char *out = buf, *end = buf + size; struct bkey_s_c_quota dq; unsigned i; @@ -58,14 +57,12 @@ int bch2_quota_to_text(struct bch_fs *c, char *buf, dq = bkey_s_c_to_quota(k); for (i = 0; i < Q_COUNTERS; i++) - out += scnprintf(out, end - out, "%s hardlimit %llu softlimit %llu", - bch2_quota_counters[i], - le64_to_cpu(dq.v->c[i].hardlimit), - le64_to_cpu(dq.v->c[i].softlimit)); + pr_buf(out, "%s hardlimit %llu softlimit %llu", + bch2_quota_counters[i], + le64_to_cpu(dq.v->c[i].hardlimit), + le64_to_cpu(dq.v->c[i].softlimit)); break; } - - return out - buf; } #ifdef CONFIG_BCACHEFS_QUOTA |