X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_rbtree.h;h=bcc88d7a5c8db20d9927ce6fc9ac986b22c0b308;hp=6b72d6d4dd6d58d1c537467b72523f2faa09da72;hb=9b4bfeefac09294a6f0ae12dbadf102eb547f5ec;hpb=266af4b5b19da7bee8e7445288c7c1cb3ee194c7 diff --git a/palacios/include/palacios/vmm_rbtree.h b/palacios/include/palacios/vmm_rbtree.h index 6b72d6d..bcc88d7 100644 --- a/palacios/include/palacios/vmm_rbtree.h +++ b/palacios/include/palacios/vmm_rbtree.h @@ -102,25 +102,25 @@ static inline struct page * rb_insert_page_cache(struct inode * inode, #undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) struct rb_node { - unsigned long rb_parent_color; + unsigned long rb_parent_color; #define RB_RED 0 #define RB_BLACK 1 - struct rb_node *rb_right; - struct rb_node *rb_left; + struct rb_node *rb_right; + struct rb_node *rb_left; } __attribute__((aligned(sizeof(long)))); - /* The alignment might seem pointless, but allegedly CRIS needs it */ +/* The alignment might seem pointless, but allegedly CRIS needs it */ struct rb_root { - struct rb_node *rb_node; + struct rb_node *rb_node; }; @@ -133,11 +133,11 @@ struct rb_root static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p) { - rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p; + rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p; } static inline void rb_set_color(struct rb_node *rb, int color) { - rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; + rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; } #define RB_ROOT (struct rb_root) { NULL, } @@ -163,10 +163,10 @@ extern void v3_rb_replace_node(struct rb_node *victim, struct rb_node *new, static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, struct rb_node ** rb_link) { - node->rb_parent_color = (unsigned long )parent; - node->rb_left = node->rb_right = NULL; + node->rb_parent_color = (unsigned long )parent; + node->rb_left = node->rb_right = NULL; - *rb_link = node; + *rb_link = node; }