mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 07:51:16 -04:00
bcachefs: Don't use rep movsq for small memcopies
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
7f9473d171
commit
b8098f36dd
@@ -95,8 +95,8 @@ do { \
|
||||
(u64 *) (_dst) < (u64 *) (_src) + \
|
||||
((struct bkey *) (_src))->u64s); \
|
||||
\
|
||||
__memmove_u64s_down((_dst), (_src), \
|
||||
((struct bkey *) (_src))->u64s); \
|
||||
memcpy_u64s_small((_dst), (_src), \
|
||||
((struct bkey *) (_src))->u64s); \
|
||||
} while (0)
|
||||
|
||||
struct btree;
|
||||
|
||||
@@ -1457,8 +1457,8 @@ static inline void __extent_entry_insert(struct bkey_i *k,
|
||||
{
|
||||
union bch_extent_entry *end = bkey_val_end(bkey_i_to_s(k));
|
||||
|
||||
memmove_u64s_up((u64 *) dst + extent_entry_u64s(new),
|
||||
dst, (u64 *) end - (u64 *) dst);
|
||||
memmove_u64s_up_small((u64 *) dst + extent_entry_u64s(new),
|
||||
dst, (u64 *) end - (u64 *) dst);
|
||||
k->k.u64s += extent_entry_u64s(new);
|
||||
memcpy_u64s_small(dst, new, extent_entry_u64s(new));
|
||||
}
|
||||
|
||||
@@ -593,6 +593,24 @@ static inline void memmove_u64s_down(void *dst, const void *src,
|
||||
__memmove_u64s_down(dst, src, u64s);
|
||||
}
|
||||
|
||||
static inline void __memmove_u64s_up_small(void *_dst, const void *_src,
|
||||
unsigned u64s)
|
||||
{
|
||||
u64 *dst = (u64 *) _dst + u64s;
|
||||
u64 *src = (u64 *) _src + u64s;
|
||||
|
||||
while (u64s--)
|
||||
*--dst = *--src;
|
||||
}
|
||||
|
||||
static inline void memmove_u64s_up_small(void *dst, const void *src,
|
||||
unsigned u64s)
|
||||
{
|
||||
EBUG_ON(dst < src);
|
||||
|
||||
__memmove_u64s_up_small(dst, src, u64s);
|
||||
}
|
||||
|
||||
static inline void __memmove_u64s_up(void *_dst, const void *_src,
|
||||
unsigned u64s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user