mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-18 06:15:12 +00:00
bcachefs: Dont't call bch2_trans_begin_updates() in bch2_extent_update()
Prep work for reflink - for reflink, we're going to be using bch2_extent_update() with other updates in the same transaction. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
8627f674bc
commit
b17657d0cf
@ -276,16 +276,16 @@ static int sum_sector_overwrites(struct btree_trans *trans,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bch2_extent_update(struct btree_trans *trans,
|
||||
struct bch_inode_info *inode,
|
||||
struct disk_reservation *disk_res,
|
||||
struct quota_res *quota_res,
|
||||
struct btree_iter *extent_iter,
|
||||
struct bkey_i *k,
|
||||
u64 new_i_size,
|
||||
bool may_allocate,
|
||||
bool direct,
|
||||
s64 *total_delta)
|
||||
int bch2_extent_update(struct btree_trans *trans,
|
||||
struct bch_inode_info *inode,
|
||||
struct disk_reservation *disk_res,
|
||||
struct quota_res *quota_res,
|
||||
struct btree_iter *extent_iter,
|
||||
struct bkey_i *k,
|
||||
u64 new_i_size,
|
||||
bool may_allocate,
|
||||
bool direct,
|
||||
s64 *total_delta)
|
||||
{
|
||||
struct bch_fs *c = trans->c;
|
||||
struct btree_iter *inode_iter = NULL;
|
||||
@ -297,8 +297,6 @@ static int bch2_extent_update(struct btree_trans *trans,
|
||||
s64 i_sectors_delta;
|
||||
int ret;
|
||||
|
||||
bch2_trans_begin_updates(trans);
|
||||
|
||||
ret = bch2_btree_iter_traverse(extent_iter);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -447,6 +445,8 @@ static int bchfs_write_index_update(struct bch_write_op *wop)
|
||||
|
||||
bkey_copy(&tmp.k, bch2_keylist_front(keys));
|
||||
|
||||
bch2_trans_begin_updates(&trans);
|
||||
|
||||
ret = bch2_extent_update(&trans, inode,
|
||||
&wop->res, quota_res,
|
||||
iter, &tmp.k,
|
||||
@ -2198,6 +2198,8 @@ static int __bch2_fpunch(struct bch_fs *c, struct bch_inode_info *inode,
|
||||
bch2_key_resize(&delete.k, max_sectors);
|
||||
bch2_cut_back(end, &delete.k);
|
||||
|
||||
bch2_trans_begin_updates(&trans);
|
||||
|
||||
ret = bch2_extent_update(&trans, inode,
|
||||
&disk_res, NULL, iter, &delete,
|
||||
0, true, true, NULL);
|
||||
@ -2546,6 +2548,8 @@ static long bch2_fcollapse(struct bch_inode_info *inode,
|
||||
BCH_DISK_RESERVATION_NOFAIL);
|
||||
BUG_ON(ret);
|
||||
|
||||
bch2_trans_begin_updates(&trans);
|
||||
|
||||
ret = bch2_extent_update(&trans, inode,
|
||||
&disk_res, NULL,
|
||||
dst, ©.k,
|
||||
@ -2689,6 +2693,8 @@ static long bch2_fallocate(struct bch_inode_info *inode, int mode,
|
||||
reservation.v.nr_replicas = disk_res.nr_replicas;
|
||||
}
|
||||
|
||||
bch2_trans_begin_updates(&trans);
|
||||
|
||||
ret = bch2_extent_update(&trans, inode,
|
||||
&disk_res, "a_res,
|
||||
iter, &reservation.k_i,
|
||||
|
Loading…
x
Reference in New Issue
Block a user