rounddown() was not available in older kenrel, such as kernel 2.6.32.61.
Add it to the compatibility code.

Signed-off-by: Andy Zhou <az...@nicira.com>
---
 datapath/linux/compat/include/linux/kernel.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/datapath/linux/compat/include/linux/kernel.h 
b/datapath/linux/compat/include/linux/kernel.h
index fdd2005..6e248c5 100644
--- a/datapath/linux/compat/include/linux/kernel.h
+++ b/datapath/linux/compat/include/linux/kernel.h
@@ -87,4 +87,13 @@
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 #endif
 
+#ifndef rounddown
+#define rounddown(x, y) (                              \
+{                                                      \
+       typeof(x) __x = (x);                            \
+       __x - (__x % (y));                              \
+}                                                      \
+)
+#endif
+
 #endif /* linux/kernel.h */
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to