bcachefs: Preallocate transaction mem

This helps avoid transaction restarts.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2021-06-02 23:31:42 -04:00 committed by Kent Overstreet
parent bc3f8b25f3
commit f7beb4ca04
3 changed files with 4 additions and 4 deletions

View File

@ -2531,7 +2531,7 @@ static long bchfs_fcollapse_finsert(struct bch_inode_info *inode,
}
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,
POS(inode->v.i_ino, src_start >> 9),
BTREE_ITER_INTENT);
@ -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;
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,
POS(inode->v.i_ino, start_sector),

View File

@ -146,7 +146,7 @@ int __must_check bch2_write_inode(struct bch_fs *c,
struct bch_inode_unpacked inode_u;
int ret;
bch2_trans_init(&trans, c, 0, 256);
bch2_trans_init(&trans, c, 0, 512);
retry:
bch2_trans_begin(&trans);

View File

@ -579,7 +579,7 @@ int bch2_inode_rm(struct bch_fs *c, u64 inode_nr, bool cached)
struct bkey_s_c k;
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 -