From 6bd68ec266ad71827ef940151067b67b62fb8fed Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 12 Sep 2023 17:16:02 -0400 Subject: bcachefs: Heap allocate btree_trans We're using more stack than we'd like in a number of functions, and btree_trans is the biggest object that we stack allocate. But we have to do a heap allocatation to initialize it anyways, so there's no real downside to heap allocating the entire thing. Signed-off-by: Kent Overstreet --- fs/bcachefs/subvolume.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/bcachefs/subvolume.c') diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index ca03d585a2fa..caf2dd7dafff 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -86,10 +86,10 @@ int bch2_check_subvols(struct bch_fs *c) int ret; ret = bch2_trans_run(c, - for_each_btree_key_commit(&trans, iter, + for_each_btree_key_commit(trans, iter, BTREE_ID_subvolumes, POS_MIN, BTREE_ITER_PREFETCH, k, NULL, NULL, BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL, - check_subvol(&trans, &iter, k))); + check_subvol(trans, &iter, k))); if (ret) bch_err_fn(c, ret); return ret; @@ -293,7 +293,7 @@ static void bch2_subvolume_wait_for_pagecache_and_delete(struct work_struct *wor bch2_evict_subvolume_inodes(c, &s); for (id = s.data; id < s.data + s.nr; id++) { - ret = bch2_trans_run(c, bch2_subvolume_delete(&trans, *id)); + ret = bch2_trans_run(c, bch2_subvolume_delete(trans, *id)); if (ret) { bch_err_msg(c, ret, "deleting subvolume %u", *id); break; -- cgit v1.2.3