[sheepdog] [PATCH v3 1/4] sheep: modify sheepdog_proto.h to make it usable in linux kernel module

levin li levin108 at gmail.com
Tue Jan 22 04:16:24 CET 2013


From: levin li <xingke.lwp at taobao.com>


Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 include/sheepdog_proto.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/sheepdog_proto.h b/include/sheepdog_proto.h
index 865f451..fb35f3a 100644
--- a/include/sheepdog_proto.h
+++ b/include/sheepdog_proto.h
@@ -11,9 +11,14 @@
 #ifndef __SHEEPDOG_PROTO_H__
 #define __SHEEPDOG_PROTO_H__
 
-#include <inttypes.h>
-#include <stdint.h>
-#include "util.h"
+#ifdef __KERNEL__
+#  define UINT64_MAX (18446744073709551615ULL)
+#  define UINT64_C(x)        ((x) + (UINT64_MAX - UINT64_MAX))
+#else
+#  include <inttypes.h>
+#  include <stdint.h>
+#  include "util.h"
+#endif
 
 #define SD_PROTO_VER 0x02
 
-- 
1.7.11.7




More information about the sheepdog mailing list