Commit 39557680 authored by Brett Holman's avatar Brett Holman Committed by Kent Overstreet

bcachefs: Add a valgrind memcheck hint

Prevent false positives in bch2_varint_decode_fast()
Signed-off-by: default avatarBrett Holman <bholman.devel@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e8bde78a
......@@ -5,6 +5,10 @@
#include <linux/string.h>
#include <asm/unaligned.h>
#ifdef CONFIG_VALGRIND
#include <valgrind/memcheck.h>
#endif
#include "varint.h"
/**
......@@ -96,6 +100,9 @@ int bch2_varint_encode_fast(u8 *out, u64 v)
*/
int bch2_varint_decode_fast(const u8 *in, const u8 *end, u64 *out)
{
#ifdef CONFIG_VALGRIND
VALGRIND_MAKE_MEM_DEFINED(in, 8);
#endif
u64 v = get_unaligned_le64(in);
unsigned bytes = ffz(*in) + 1;
......
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