diff options
Diffstat (limited to 'libbcachefs/fs-io.c')
-rw-r--r-- | libbcachefs/fs-io.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libbcachefs/fs-io.c b/libbcachefs/fs-io.c index 1bffddf6..00475b99 100644 --- a/libbcachefs/fs-io.c +++ b/libbcachefs/fs-io.c @@ -452,14 +452,18 @@ static int bchfs_write_index_update(struct bch_write_op *wop) ret = bch2_btree_insert_at(wop->c, &wop->res, &hook.hook, op_journal_seq(wop), - BTREE_INSERT_NOFAIL|BTREE_INSERT_ATOMIC, + BTREE_INSERT_NOFAIL| + BTREE_INSERT_ATOMIC| + BTREE_INSERT_USE_RESERVE, BTREE_INSERT_ENTRY(&extent_iter, k), BTREE_INSERT_ENTRY_EXTRA_RES(&inode_iter, &hook.inode_p.inode.k_i, 2)); } else { ret = bch2_btree_insert_at(wop->c, &wop->res, &hook.hook, op_journal_seq(wop), - BTREE_INSERT_NOFAIL|BTREE_INSERT_ATOMIC, + BTREE_INSERT_NOFAIL| + BTREE_INSERT_ATOMIC| + BTREE_INSERT_USE_RESERVE, BTREE_INSERT_ENTRY(&extent_iter, k)); } @@ -502,7 +506,7 @@ static inline void bch2_fswrite_op_init(struct bchfs_write_op *op, bch2_write_op_init(&op->op, c); op->op.csum_type = bch2_data_checksum_type(c, opts.data_checksum); - op->op.compression_type = bch2_compression_opt_to_type(opts.compression); + op->op.compression_type = bch2_compression_opt_to_type[opts.compression]; op->op.devs = c->fastest_devs; op->op.index_update_fn = bchfs_write_index_update; op_journal_seq_set(&op->op, &inode->ei_journal_seq); @@ -2692,6 +2696,10 @@ void bch2_fs_fsio_exit(struct bch_fs *c) int bch2_fs_fsio_init(struct bch_fs *c) { + int ret = 0; + + pr_verbose_init(c->opts, ""); + if (bioset_init(&c->writepage_bioset, 4, offsetof(struct bch_writepage_io, op.op.wbio.bio), BIOSET_NEED_BVECS) || @@ -2701,9 +2709,10 @@ int bch2_fs_fsio_init(struct bch_fs *c) bioset_init(&c->dio_write_bioset, 4, offsetof(struct dio_write, iop.op.wbio.bio), BIOSET_NEED_BVECS)) - return -ENOMEM; + ret = -ENOMEM; - return 0; + pr_verbose_init(c->opts, "ret %i", ret); + return ret; } #endif /* NO_BCACHEFS_FS */ |