Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27937
b: refs/heads/master
c: 21f1d5f
h: refs/heads/master
i:
  27935: 958d2e6
v: v3
  • Loading branch information
David Woodhouse committed Apr 21, 2006
1 parent 3ebc66c commit ecbcea8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c569882b2e70a0c4eac99acdb39b493549041ba1
refs/heads/master: 21f1d5fc592e145574dede8debe9603334d08fde
1 change: 0 additions & 1 deletion trunk/fs/jffs2/nodelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ static inline struct jffs2_node_frag *frag_last(struct rb_root *root)
return rb_entry(node, struct jffs2_node_frag, rb);
}

#define rb_parent(rb) ((rb)->rb_parent)
#define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb)
#define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb)
#define frag_parent(frag) rb_entry(rb_parent(&(frag)->rb), struct jffs2_node_frag, rb)
Expand Down
18 changes: 9 additions & 9 deletions trunk/fs/jffs2/readinode.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void jffs2_free_tmp_dnode_info_list(struct rb_root *list)
jffs2_free_full_dnode(tn->fn);
jffs2_free_tmp_dnode_info(tn);

this = this->rb_parent;
this = rb_parent(this);
if (!this)
break;

Expand Down Expand Up @@ -679,27 +679,27 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c,
jffs2_mark_node_obsolete(c, fn->raw);

BUG_ON(rb->rb_left);
if (rb->rb_parent && rb->rb_parent->rb_left == rb) {
if (rb_parent(rb) && rb_parent(rb)->rb_left == rb) {
/* We were then left-hand child of our parent. We need
* to move our own right-hand child into our place. */
repl_rb = rb->rb_right;
if (repl_rb)
repl_rb->rb_parent = rb->rb_parent;
rb_set_parent(repl_rb, rb_parent(rb));
} else
repl_rb = NULL;

rb = rb_next(rb);

/* Remove the spent tn from the tree; don't bother rebalancing
* but put our right-hand child in our own place. */
if (tn->rb.rb_parent) {
if (tn->rb.rb_parent->rb_left == &tn->rb)
tn->rb.rb_parent->rb_left = repl_rb;
else if (tn->rb.rb_parent->rb_right == &tn->rb)
tn->rb.rb_parent->rb_right = repl_rb;
if (rb_parent(&tn->rb)) {
if (rb_parent(&tn->rb)->rb_left == &tn->rb)
rb_parent(&tn->rb)->rb_left = repl_rb;
else if (rb_parent(&tn->rb)->rb_right == &tn->rb)
rb_parent(&tn->rb)->rb_right = repl_rb;
else BUG();
} else if (tn->rb.rb_right)
tn->rb.rb_right->rb_parent = NULL;
rb_set_parent(tn->rb.rb_right, NULL);

jffs2_free_tmp_dnode_info(tn);
if (ret) {
Expand Down

0 comments on commit ecbcea8

Please sign in to comment.