diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-20 17:51:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-20 17:51:22 -0400 |
commit | 2edc322d420a4cec8dbc184a1220ecd7fa9f8ae6 (patch) | |
tree | e7be2cf442626316b6b6fb212960fe1f77ff2725 /fs | |
parent | be967b7e2f7747a5ebf2a07ee627d9338491e784 (diff) | |
parent | 2f3243aebd8df4d9eecaeca04bbff6c7dbfb2142 (diff) |
Merge git://git.infradead.org/~dwmw2/rbtree-2.6
* git://git.infradead.org/~dwmw2/rbtree-2.6:
[RBTREE] Switch rb_colour() et al to en_US spelling of 'color' for consistency
Update UML kernel/physmem.c to use rb_parent() accessor macro
[RBTREE] Update hrtimers to use rb_parent() accessor macro.
[RBTREE] Add explicit alignment to sizeof(long) for struct rb_node.
[RBTREE] Merge colour and parent fields of struct rb_node.
[RBTREE] Remove dead code in rb_erase()
[RBTREE] Update JFFS2 to use rb_parent() accessor macro.
[RBTREE] Update eventpoll.c to use rb_parent() accessor macro.
[RBTREE] Update key.c to use rb_parent() accessor macro.
[RBTREE] Update ext3 to use rb_parent() accessor macro.
[RBTREE] Change rbtree off-tree marking in I/O schedulers.
[RBTREE] Add accessor macros for colour and parent fields of rb_node
Diffstat (limited to 'fs')
-rw-r--r-- | fs/eventpoll.c | 6 | ||||
-rw-r--r-- | fs/ext3/dir.c | 2 | ||||
-rw-r--r-- | fs/jffs2/nodelist.h | 1 | ||||
-rw-r--r-- | fs/jffs2/readinode.c | 18 |
4 files changed, 13 insertions, 14 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 1b4491cdd115..2695337d4d64 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -337,20 +337,20 @@ static inline int ep_cmp_ffd(struct epoll_filefd *p1, | |||
337 | /* Special initialization for the rb-tree node to detect linkage */ | 337 | /* Special initialization for the rb-tree node to detect linkage */ |
338 | static inline void ep_rb_initnode(struct rb_node *n) | 338 | static inline void ep_rb_initnode(struct rb_node *n) |
339 | { | 339 | { |
340 | n->rb_parent = n; | 340 | rb_set_parent(n, n); |
341 | } | 341 | } |
342 | 342 | ||
343 | /* Removes a node from the rb-tree and marks it for a fast is-linked check */ | 343 | /* Removes a node from the rb-tree and marks it for a fast is-linked check */ |
344 | static inline void ep_rb_erase(struct rb_node *n, struct rb_root *r) | 344 | static inline void ep_rb_erase(struct rb_node *n, struct rb_root *r) |
345 | { | 345 | { |
346 | rb_erase(n, r); | 346 | rb_erase(n, r); |
347 | n->rb_parent = n; | 347 | rb_set_parent(n, n); |
348 | } | 348 | } |
349 | 349 | ||
350 | /* Fast check to verify that the item is linked to the main rb-tree */ | 350 | /* Fast check to verify that the item is linked to the main rb-tree */ |
351 | static inline int ep_rb_linked(struct rb_node *n) | 351 | static inline int ep_rb_linked(struct rb_node *n) |
352 | { | 352 | { |
353 | return n->rb_parent != n; | 353 | return rb_parent(n) != n; |
354 | } | 354 | } |
355 | 355 | ||
356 | /* | 356 | /* |
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index f37528ed222e..fbb0d4ed07d4 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -284,7 +284,7 @@ static void free_rb_tree_fname(struct rb_root *root) | |||
284 | * beginning of the loop and try to free the parent | 284 | * beginning of the loop and try to free the parent |
285 | * node. | 285 | * node. |
286 | */ | 286 | */ |
287 | parent = n->rb_parent; | 287 | parent = rb_parent(n); |
288 | fname = rb_entry(n, struct fname, rb_hash); | 288 | fname = rb_entry(n, struct fname, rb_hash); |
289 | while (fname) { | 289 | while (fname) { |
290 | struct fname * old = fname; | 290 | struct fname * old = fname; |
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index 7ad8ee043880..b16c60bbcf6e 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h | |||
@@ -315,7 +315,6 @@ static inline struct jffs2_node_frag *frag_last(struct rb_root *root) | |||
315 | return rb_entry(node, struct jffs2_node_frag, rb); | 315 | return rb_entry(node, struct jffs2_node_frag, rb); |
316 | } | 316 | } |
317 | 317 | ||
318 | #define rb_parent(rb) ((rb)->rb_parent) | ||
319 | #define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb) | 318 | #define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb) |
320 | #define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb) | 319 | #define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb) |
321 | #define frag_parent(frag) rb_entry(rb_parent(&(frag)->rb), struct jffs2_node_frag, rb) | 320 | #define frag_parent(frag) rb_entry(rb_parent(&(frag)->rb), struct jffs2_node_frag, rb) |
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 5ea4faafa2d3..5fec012b02ed 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -66,7 +66,7 @@ static void jffs2_free_tmp_dnode_info_list(struct rb_root *list) | |||
66 | jffs2_free_full_dnode(tn->fn); | 66 | jffs2_free_full_dnode(tn->fn); |
67 | jffs2_free_tmp_dnode_info(tn); | 67 | jffs2_free_tmp_dnode_info(tn); |
68 | 68 | ||
69 | this = this->rb_parent; | 69 | this = rb_parent(this); |
70 | if (!this) | 70 | if (!this) |
71 | break; | 71 | break; |
72 | 72 | ||
@@ -708,12 +708,12 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
708 | jffs2_mark_node_obsolete(c, fn->raw); | 708 | jffs2_mark_node_obsolete(c, fn->raw); |
709 | 709 | ||
710 | BUG_ON(rb->rb_left); | 710 | BUG_ON(rb->rb_left); |
711 | if (rb->rb_parent && rb->rb_parent->rb_left == rb) { | 711 | if (rb_parent(rb) && rb_parent(rb)->rb_left == rb) { |
712 | /* We were then left-hand child of our parent. We need | 712 | /* We were then left-hand child of our parent. We need |
713 | * to move our own right-hand child into our place. */ | 713 | * to move our own right-hand child into our place. */ |
714 | repl_rb = rb->rb_right; | 714 | repl_rb = rb->rb_right; |
715 | if (repl_rb) | 715 | if (repl_rb) |
716 | repl_rb->rb_parent = rb->rb_parent; | 716 | rb_set_parent(repl_rb, rb_parent(rb)); |
717 | } else | 717 | } else |
718 | repl_rb = NULL; | 718 | repl_rb = NULL; |
719 | 719 | ||
@@ -721,14 +721,14 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
721 | 721 | ||
722 | /* Remove the spent tn from the tree; don't bother rebalancing | 722 | /* Remove the spent tn from the tree; don't bother rebalancing |
723 | * but put our right-hand child in our own place. */ | 723 | * but put our right-hand child in our own place. */ |
724 | if (tn->rb.rb_parent) { | 724 | if (rb_parent(&tn->rb)) { |
725 | if (tn->rb.rb_parent->rb_left == &tn->rb) | 725 | if (rb_parent(&tn->rb)->rb_left == &tn->rb) |
726 | tn->rb.rb_parent->rb_left = repl_rb; | 726 | rb_parent(&tn->rb)->rb_left = repl_rb; |
727 | else if (tn->rb.rb_parent->rb_right == &tn->rb) | 727 | else if (rb_parent(&tn->rb)->rb_right == &tn->rb) |
728 | tn->rb.rb_parent->rb_right = repl_rb; | 728 | rb_parent(&tn->rb)->rb_right = repl_rb; |
729 | else BUG(); | 729 | else BUG(); |
730 | } else if (tn->rb.rb_right) | 730 | } else if (tn->rb.rb_right) |
731 | tn->rb.rb_right->rb_parent = NULL; | 731 | rb_set_parent(tn->rb.rb_right, NULL); |
732 | 732 | ||
733 | jffs2_free_tmp_dnode_info(tn); | 733 | jffs2_free_tmp_dnode_info(tn); |
734 | if (ret) { | 734 | if (ret) { |