[sheepdog-users] [PATCH stable-0.7 5/5] sheep: fix some compile errors

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Feb 24 07:06:26 CET 2014


From: Liu Yuan <namei.unix at gmail.com>

Both MIN/MAX and roundup are provided by glibc and would cause compile error
when we #include <sys/param.h>. Just use GNU version.

Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>

Conflicts:
	include/util.h

Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 include/util.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/util.h b/include/util.h
index 7528a5d..ef642b1 100644
--- a/include/util.h
+++ b/include/util.h
@@ -13,6 +13,7 @@
 #include <sys/eventfd.h>
 #include <pthread.h>
 #include <errno.h>
+#include <sys/param.h>
 
 #include "logger.h"
 #include "list.h"
@@ -22,7 +23,7 @@
 #define BLOCK_SIZE (1U << 12)
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define round_up(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define round_up(x, y) roundup(x, y)
 #define round_down(x, y) (((x) / (y)) * (y))
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-- 
1.7.10.4




More information about the sheepdog-users mailing list