[sheepdog] [PATCH v3 06/11] rbtree: make rb_node aligned to 64 bytes

Liu Yuan namei.unix at gmail.com
Sat Sep 21 18:12:23 CEST 2013


Because sd_node has it.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 include/rbtree.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/rbtree.h b/include/rbtree.h
index 7dbc39e..09e6d6b 100644
--- a/include/rbtree.h
+++ b/include/rbtree.h
@@ -1,12 +1,13 @@
 #ifndef __RBTREE_H_
 #define __RBTREE_H_
 
+/* We have to be 64-bytes aligned to get 32/64 bits compatibility */
 struct rb_node {
-	unsigned long  rb_parent_color;
+	unsigned long  rb_parent_color __attribute__ ((aligned (8)));
 #define RB_RED          0
 #define RB_BLACK        1
-	struct rb_node *rb_right;
-	struct rb_node *rb_left;
+	struct rb_node *rb_right __attribute__ ((aligned (8)));
+	struct rb_node *rb_left __attribute__ ((aligned (8)));
 };
 
 struct rb_root {
-- 
1.7.9.5




More information about the sheepdog mailing list