From 307e3c13192002f684bdfc23865a57274e6bb4ad Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 17 Oct 2022 07:03:11 -0400 Subject: bcachefs: Optimize bch2_trans_init() Now we store the transaction's fn idx in a local variable, instead of redoing the lookup every time we call bch2_trans_init(). Signed-off-by: Kent Overstreet --- fs/bcachefs/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/bcachefs/debug.c') diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index 7abc707d2f38..a9e4180d6a80 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -638,11 +638,11 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf, if (!i->size) break; - if (i->iter == ARRAY_SIZE(c->btree_transaction_fns) || - !c->btree_transaction_fns[i->iter]) + if (i->iter == ARRAY_SIZE(bch2_btree_transaction_fns) || + !bch2_btree_transaction_fns[i->iter]) break; - prt_printf(&i->buf, "%s: ", c->btree_transaction_fns[i->iter]); + prt_printf(&i->buf, "%s: ", bch2_btree_transaction_fns[i->iter]); prt_newline(&i->buf); printbuf_indent_add(&i->buf, 2); -- cgit v1.2.3