diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-27 01:31:51 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:34 +0300 |
commit | 22add2ec6705cd66977717c49105e0910b2ef144 (patch) | |
tree | 0dbf14f99869d14727f465198ccd2a536ce63e63 /fs/bcachefs/alloc_background.c | |
parent | 38585367442f09606d7a529be3290f2fd4cbcf84 (diff) | |
download | linux-22add2ec6705cd66977717c49105e0910b2ef144.tar.xz |
bcachefs: Use BTREE_INSERT_LAZY_RW in bch2_check_alloc_info()
This runs before we go rw for journal replay, but after we're allowed to
go rw. It might be time to consider killing BTREE_INSERT_LAZY_RW,
though.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r-- | fs/bcachefs/alloc_background.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index b784fe7c5b81..caaf2ab702e6 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -784,7 +784,9 @@ int bch2_check_alloc_info(struct bch_fs *c) for_each_btree_key(&trans, iter, BTREE_ID_alloc, POS_MIN, BTREE_ITER_PREFETCH, k, ret) { - ret = __bch2_trans_do(&trans, NULL, NULL, 0, + ret = __bch2_trans_do(&trans, NULL, NULL, + BTREE_INSERT_NOFAIL| + BTREE_INSERT_LAZY_RW, bch2_check_alloc_key(&trans, &iter)); if (ret) break; @@ -797,7 +799,9 @@ int bch2_check_alloc_info(struct bch_fs *c) bch2_trans_iter_init(&trans, &iter, BTREE_ID_need_discard, POS_MIN, BTREE_ITER_PREFETCH); while (1) { - ret = __bch2_trans_do(&trans, NULL, NULL, 0, + ret = __bch2_trans_do(&trans, NULL, NULL, + BTREE_INSERT_NOFAIL| + BTREE_INSERT_LAZY_RW, bch2_check_discard_freespace_key(&trans, &iter)); if (ret) break; @@ -812,7 +816,9 @@ int bch2_check_alloc_info(struct bch_fs *c) bch2_trans_iter_init(&trans, &iter, BTREE_ID_freespace, POS_MIN, BTREE_ITER_PREFETCH); while (1) { - ret = __bch2_trans_do(&trans, NULL, NULL, 0, + ret = __bch2_trans_do(&trans, NULL, NULL, + BTREE_INSERT_NOFAIL| + BTREE_INSERT_LAZY_RW, bch2_check_discard_freespace_key(&trans, &iter)); if (ret) break; |