From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/crush/crush_compat.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/crush/crush_compat.h (limited to 'src/crush/crush_compat.h') diff --git a/src/crush/crush_compat.h b/src/crush/crush_compat.h new file mode 100644 index 00000000..08eb4eab --- /dev/null +++ b/src/crush/crush_compat.h @@ -0,0 +1,39 @@ +#ifndef CEPH_CRUSH_COMPAT_H +#define CEPH_CRUSH_COMPAT_H + +#include "include/int_types.h" + +#include +#include +#include +#include + +/* asm-generic/bug.h */ + +#define BUG_ON(x) assert(!(x)) + +/* linux/kernel.h */ + +#define U8_MAX ((__u8)~0U) +#define S8_MAX ((__s8)(U8_MAX>>1)) +#define S8_MIN ((__s8)(-S8_MAX - 1)) +#define U16_MAX ((__u16)~0U) +#define S16_MAX ((__s16)(U16_MAX>>1)) +#define S16_MIN ((__s16)(-S16_MAX - 1)) +#define U32_MAX ((__u32)~0U) +#define S32_MAX ((__s32)(U32_MAX>>1)) +#define S32_MIN ((__s32)(-S32_MAX - 1)) +#define U64_MAX ((__u64)~0ULL) +#define S64_MAX ((__s64)(U64_MAX>>1)) +#define S64_MIN ((__s64)(-S64_MAX - 1)) + +/* linux/math64.h */ + +#define div64_s64(dividend, divisor) ((dividend) / (divisor)) + +/* linux/slab.h */ + +#define kmalloc(size, flags) malloc(size) +#define kfree(x) do { if (x) free(x); } while (0) + +#endif /* CEPH_CRUSH_COMPAT_H */ -- cgit v1.2.3