]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Preallocate transaction mem
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 3 Jun 2021 03:31:42 +0000 (23:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:05 +0000 (17:09 -0400)
This helps avoid transaction restarts.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/fs-io.c
fs/bcachefs/fs.c
fs/bcachefs/inode.c

index 08746a6cbc31a4d6bc8e5db886d8fabf37dd6c10..132ff0497b3992ef3de9712a10296289198f39d9 100644 (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),
index b1b7ee722f2ca61df647da9ead4ecb110ef228c9..99885fb97aa2aa2c641b18dee471d4cd141076f5 100644 (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);
 
index 18b568887144550e5532f790087eb5ac389a049c..c65bfee1897ecda087b4df6c3e2e4c3cf2db7a04 100644 (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 -