Commit d598a9b7 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Use memcpy_u64s_small() for copying keys

Small performance optimization; an open coded loop is better than rep ;
movsq for small copies.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 73da30e8
......@@ -360,7 +360,7 @@ bool bch2_bkey_pack(struct bkey_packed *out, const struct bkey_i *in,
memmove_u64s((u64 *) out + format->key_u64s,
&in->v,
bkey_val_u64s(&in->k));
memcpy_u64s(out, &tmp, format->key_u64s);
memcpy_u64s_small(out, &tmp, format->key_u64s);
return true;
}
......
......@@ -188,7 +188,7 @@ unsigned bch2_sort_keys(struct bkey_packed *dst,
}
if (bkey_deleted(in)) {
memcpy_u64s(out, in, bkeyp_key_u64s(f, in));
memcpy_u64s_small(out, in, bkeyp_key_u64s(f, in));
set_bkeyp_val_u64s(f, out, 0);
} else {
bkey_copy(out, in);
......
......@@ -1022,7 +1022,7 @@ void bch2_bset_insert(struct btree *b,
set_btree_bset_end(b, t);
}
memcpy_u64s(where, src,
memcpy_u64s_small(where, src,
bkeyp_key_u64s(f, src));
memcpy_u64s(bkeyp_val(f, where), &insert->v,
bkeyp_val_u64s(f, src));
......
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