diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-25 19:18:19 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:25 +0200 |
commit | fa8e94faeece12c20b541f647059f29867e98bc0 (patch) | |
tree | 43c5542168a6324d69c8671724e62c46e6265b8c /fs/bcachefs/clock.c | |
parent | bcachefs: Convert bch2_pd_controller_print_debug() to a printbuf (diff) | |
download | linux-fa8e94faeece12c20b541f647059f29867e98bc0.tar.xz linux-fa8e94faeece12c20b541f647059f29867e98bc0.zip |
bcachefs: Heap allocate printbufs
This patch changes printbufs dynamically allocate and reallocate a
buffer as needed. Stack usage has become a bit of a problem, and a major
cause of that has been static size string buffers on the stack.
The most involved part of this refactoring is that printbufs must now be
exited with printbuf_exit().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/clock.c')
-rw-r--r-- | fs/bcachefs/clock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/clock.c b/fs/bcachefs/clock.c index da91c95e3ffc..342797303415 100644 --- a/fs/bcachefs/clock.c +++ b/fs/bcachefs/clock.c @@ -157,6 +157,7 @@ void bch2_io_timers_to_text(struct printbuf *out, struct io_clock *clock) unsigned long now; unsigned i; + out->atomic++; spin_lock(&clock->timer_lock); now = atomic64_read(&clock->now); @@ -165,6 +166,7 @@ void bch2_io_timers_to_text(struct printbuf *out, struct io_clock *clock) clock->timers.data[i]->fn, clock->timers.data[i]->expire - now); spin_unlock(&clock->timer_lock); + --out->atomic; } void bch2_io_clock_exit(struct io_clock *clock) |