bcachefs: Don't use peek_filter() unnecessarily

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-03-16 15:49:23 -04:00 committed by Kent Overstreet
parent 286d8ad040
commit 19f24758ef
2 changed files with 5 additions and 10 deletions

View File

@ -1335,8 +1335,7 @@ int bch2_mark_update(struct btree_trans *trans,
!bkey_deleted(&insert->k))
return 0;
while ((_k = bch2_btree_node_iter_peek_filter(&node_iter, b,
KEY_TYPE_discard))) {
while ((_k = bch2_btree_node_iter_peek(&node_iter, b))) {
struct bkey unpacked;
struct bkey_s_c k = bkey_disassemble(b, _k, &unpacked);
@ -1382,8 +1381,7 @@ void bch2_trans_fs_usage_apply(struct btree_trans *trans,
pr_err("overlapping with");
node_iter = iter->l[0].iter;
while ((_k = bch2_btree_node_iter_peek_filter(&node_iter, b,
KEY_TYPE_discard))) {
while ((_k = bch2_btree_node_iter_peek(&node_iter, b))) {
struct bkey unpacked;
struct bkey_s_c k;
@ -1795,8 +1793,7 @@ int bch2_trans_mark_update(struct btree_trans *trans,
if (unlikely(flags & BTREE_TRIGGER_NOOVERWRITES))
return 0;
while ((_k = bch2_btree_node_iter_peek_filter(&node_iter, b,
KEY_TYPE_discard))) {
while ((_k = bch2_btree_node_iter_peek(&node_iter, b))) {
struct bkey unpacked;
struct bkey_s_c k;
unsigned offset = 0;

View File

@ -120,8 +120,7 @@ int bch2_extent_atomic_end(struct btree_iter *iter,
if (ret < 0)
return ret;
while ((_k = bch2_btree_node_iter_peek_filter(&node_iter, b,
KEY_TYPE_discard))) {
while ((_k = bch2_btree_node_iter_peek(&node_iter, b))) {
struct bkey unpacked;
struct bkey_s_c k = bkey_disassemble(b, _k, &unpacked);
unsigned offset = 0;
@ -182,8 +181,7 @@ bch2_extent_can_insert(struct btree_trans *trans,
struct bkey unpacked;
int sectors;
_k = bch2_btree_node_iter_peek_filter(&node_iter, l->b,
KEY_TYPE_discard);
_k = bch2_btree_node_iter_peek(&node_iter, l->b);
if (!_k)
return BTREE_INSERT_OK;