From: Kent Overstreet Date: Fri, 21 Mar 2025 21:03:12 +0000 (-0400) Subject: bcachefs: do_trace_key_cache_fill() X-Git-Tag: v6.15-rc1~31^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c8f4587d239837b2556a76a11706c987c43909a;p=thirdparty%2Flinux.git bcachefs: do_trace_key_cache_fill() Reducing stack frame usage; this moves the printbuf out of the main stack frame. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c index edce594333756..f4d2e2cc2d538 100644 --- a/fs/bcachefs/btree_key_cache.c +++ b/fs/bcachefs/btree_key_cache.c @@ -287,6 +287,19 @@ err: return ret; } +static noinline_for_stack void do_trace_key_cache_fill(struct btree_trans *trans, + struct btree_path *ck_path, + struct bkey_s_c k) +{ + struct printbuf buf = PRINTBUF; + + bch2_bpos_to_text(&buf, ck_path->pos); + prt_char(&buf, ' '); + bch2_bkey_val_to_text(&buf, trans->c, k); + trace_key_cache_fill(trans, buf.buf); + printbuf_exit(&buf); +} + static noinline int btree_key_cache_fill(struct btree_trans *trans, struct btree_path *ck_path, unsigned flags) @@ -320,15 +333,8 @@ static noinline int btree_key_cache_fill(struct btree_trans *trans, if (ret) goto err; - if (trace_key_cache_fill_enabled()) { - struct printbuf buf = PRINTBUF; - - bch2_bpos_to_text(&buf, ck_path->pos); - prt_char(&buf, ' '); - bch2_bkey_val_to_text(&buf, trans->c, k); - trace_key_cache_fill(trans, buf.buf); - printbuf_exit(&buf); - } + if (trace_key_cache_fill_enabled()) + do_trace_key_cache_fill(trans, ck_path, k); out: /* We're not likely to need this iterator again: */ bch2_set_btree_iter_dontneed(&iter);