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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
73da30e8e0
commit
d598a9b7e2
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user