summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-22 04:53:48 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2022-02-22 04:53:48 -0500
commit9b3aa5ec6cb7a3f12b9c683b4d28be2df0faa95c (patch)
tree8d6002062328f899d5f9e549e99d4171dfdbd69e /fs/bcachefs/util.c
parentf71016da4433db47b738088c401c3b5e023b3d82 (diff)
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 ab808fe4d64d..26d0ae304cb2 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);