From 19f24758ef17f4a73c84a507e6433777c0726c3e Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 16 Mar 2020 15:49:23 -0400 Subject: [PATCH] bcachefs: Don't use peek_filter() unnecessarily Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/buckets.c | 9 +++------ fs/bcachefs/extent_update.c | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index cd54c2b1eff2..22e30ed716c4 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -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; diff --git a/fs/bcachefs/extent_update.c b/fs/bcachefs/extent_update.c index fa6c0698f385..beb3b694e33c 100644 --- a/fs/bcachefs/extent_update.c +++ b/fs/bcachefs/extent_update.c @@ -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;