summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-22 12:53:48 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:24 +0300
commit702a4ef07774fbc565f3e567073d2f83f9602667 (patch)
tree2a3075cca3b847265a4c5d345b40e53cf9f684e8 /fs/bcachefs/util.c
parentf61816d0fc6091e14b3f4ffce962dc5084a1b6cd (diff)
downloadlinux-702a4ef07774fbc565f3e567073d2f83f9602667.tar.xz
bcachefs: Add tabstops to printbufs
Now, when outputting to printbufs, we can set tabstops and left or right justify text to them - this is to be used by the userspace 'bcachefs fs usage' command. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r--fs/bcachefs/util.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index f170cf9d5052..a330fa30cd79 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -117,17 +117,11 @@ void bch2_hprint(struct printbuf *buf, s64 v)
if (u && t && v < 100 && v > -100)
pr_buf(buf, ".%i", t / 103);
if (u)
- pr_buf(buf, "%c", si_units[u]);
+ pr_char(buf, si_units[u]);
}
void bch2_pr_units(struct printbuf *out, s64 raw, s64 bytes)
{
- if (raw < 0) {
- pr_buf(out, "-");
- raw = -raw;
- bytes = -bytes;
- }
-
switch (out->units) {
case PRINTBUF_UNITS_RAW:
pr_buf(out, "%llu", raw);