Commit 005def8f authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Optimize __bch2_btree_node_iter_advance()

This replaces an expensive memmove() call with an open-coded version.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent c81f5836
......@@ -1429,7 +1429,10 @@ static inline void __bch2_btree_node_iter_advance(struct btree_node_iter *iter,
EBUG_ON(iter->data->k > iter->data->end);
if (unlikely(__btree_node_iter_set_end(iter, 0))) {
bch2_btree_node_iter_set_drop(iter, iter->data);
/* avoid an expensive memmove call: */
iter->data[0] = iter->data[1];
iter->data[1] = iter->data[2];
iter->data[2] = (struct btree_node_iter_set) { 0, 0 };
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment