From 74a80b772efc8f2533a1e236b62c253d2df39d83 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 26 Jul 2017 13:56:20 -0700 Subject: [PATCH] scoutfs: add endian_swap.h Add a helper header for conversions between little and big endian. Signed-off-by: Zach Brown --- kmod/src/endian_swap.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 kmod/src/endian_swap.h diff --git a/kmod/src/endian_swap.h b/kmod/src/endian_swap.h new file mode 100644 index 00000000..5693584b --- /dev/null +++ b/kmod/src/endian_swap.h @@ -0,0 +1,10 @@ +#ifndef _SCOUTFS_ENDIAN_SWAP_H_ +#define _SCOUTFS_ENDIAN_SWAP_H_ + +#define le32_to_be32(x) cpu_to_be32(le32_to_cpu(x)) +#define le16_to_be16(x) cpu_to_be16(le16_to_cpu(x)) + +#define be32_to_le32(x) cpu_to_le32(be32_to_cpu(x)) +#define be16_to_le16(x) cpu_to_le16(be16_to_cpu(x)) + +#endif