scoutfs: add endian_swap.h

Add a helper header for conversions between little and big endian.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-07-26 13:56:20 -07:00
parent b98f97e143
commit 74a80b772e

10
kmod/src/endian_swap.h Normal file
View File

@@ -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