Commit f7beb4ca authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Preallocate transaction mem

This helps avoid transaction restarts.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent bc3f8b25
...@@ -2531,7 +2531,7 @@ static long bchfs_fcollapse_finsert(struct bch_inode_info *inode, ...@@ -2531,7 +2531,7 @@ static long bchfs_fcollapse_finsert(struct bch_inode_info *inode,
} }
bch2_bkey_buf_init(&copy); bch2_bkey_buf_init(&copy);
bch2_trans_init(&trans, c, BTREE_ITER_MAX, 256); bch2_trans_init(&trans, c, BTREE_ITER_MAX, 1024);
src = bch2_trans_get_iter(&trans, BTREE_ID_extents, src = bch2_trans_get_iter(&trans, BTREE_ID_extents,
POS(inode->v.i_ino, src_start >> 9), POS(inode->v.i_ino, src_start >> 9),
BTREE_ITER_INTENT); BTREE_ITER_INTENT);
...@@ -2651,7 +2651,7 @@ static int __bchfs_fallocate(struct bch_inode_info *inode, int mode, ...@@ -2651,7 +2651,7 @@ static int __bchfs_fallocate(struct bch_inode_info *inode, int mode,
unsigned replicas = io_opts(c, &inode->ei_inode).data_replicas; unsigned replicas = io_opts(c, &inode->ei_inode).data_replicas;
int ret = 0; int ret = 0;
bch2_trans_init(&trans, c, BTREE_ITER_MAX, 0); bch2_trans_init(&trans, c, BTREE_ITER_MAX, 512);
iter = bch2_trans_get_iter(&trans, BTREE_ID_extents, iter = bch2_trans_get_iter(&trans, BTREE_ID_extents,
POS(inode->v.i_ino, start_sector), POS(inode->v.i_ino, start_sector),
......
...@@ -146,7 +146,7 @@ int __must_check bch2_write_inode(struct bch_fs *c, ...@@ -146,7 +146,7 @@ int __must_check bch2_write_inode(struct bch_fs *c,
struct bch_inode_unpacked inode_u; struct bch_inode_unpacked inode_u;
int ret; int ret;
bch2_trans_init(&trans, c, 0, 256); bch2_trans_init(&trans, c, 0, 512);
retry: retry:
bch2_trans_begin(&trans); bch2_trans_begin(&trans);
......
...@@ -579,7 +579,7 @@ int bch2_inode_rm(struct bch_fs *c, u64 inode_nr, bool cached) ...@@ -579,7 +579,7 @@ int bch2_inode_rm(struct bch_fs *c, u64 inode_nr, bool cached)
struct bkey_s_c k; struct bkey_s_c k;
int ret; int ret;
bch2_trans_init(&trans, c, 0, 0); bch2_trans_init(&trans, c, 0, 1024);
/* /*
* If this was a directory, there shouldn't be any real dirents left - * If this was a directory, there shouldn't be any real dirents left -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment