path: root/btrfs-fragments.c
diff options
authorZach Brown <>2013-07-09 13:24:43 -0700
committerDavid Sterba <>2013-08-09 14:32:33 +0200
commit876e3f9380d373ba76f9b6d4c08ff84327956abf (patch)
treea5cf9f31f77249dadbd35b57f9a0025876db2e27 /btrfs-fragments.c
parent8e6b7ce746d668d7f2c2b6e0b2075dccf55df01a (diff)
btrfs-progs: per-thread, per-call pretty buffer
We don't need callers to manage string storage for each pretty_sizes() call. We can use a macro to have per-thread and per-call static storage so that pretty_sizes() can be used as many times as needed in printf() arguments without requiring a bunch of supporting variables. This lets us have a natural interface at the cost of requiring __thread and TLS from gcc and a small amount of static storage. This seems better than the current code or doing something with illegible format specifier macros. Signed-off-by: Zach Brown <> Acked-by: Wang Shilong <> Signed-off-by: David Sterba <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'btrfs-fragments.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-fragments.c b/btrfs-fragments.c
index a012fe1b..7ec77e78 100644
--- a/btrfs-fragments.c
+++ b/btrfs-fragments.c
@@ -87,7 +87,7 @@ print_bg(FILE *html, char *name, u64 start, u64 len, u64 used, u64 flags,
fprintf(html, "<p>%s chunk starts at %lld, size is %s, %.2f%% used, "
"%.2f%% fragmented</p>\n", chunk_type(flags), start,
- pretty_sizes(len), 100.0 * used / len, 100.0 * frag);
+ pretty_size(len), 100.0 * used / len, 100.0 * frag);
fprintf(html, "<img src=\"%s\" border=\"1\" />\n", name);