Commit 6430a8de authored by Artem B. Bityuckiy's avatar Artem B. Bityuckiy Committed by Thomas Gleixner

[JFFS2] Simplify the tree insert code.

It isn't _normal_ that we allow key collision in rbtrees, 
but it does not matter as long as the two nodes with the same
version are together.
Signed-off-by: default avatarArtem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 265489f0
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: nodelist.c,v 1.95 2005/07/05 21:03:07 dwmw2 Exp $ * $Id: nodelist.c,v 1.97 2005/07/06 15:18:41 dwmw2 Exp $
* *
*/ */
...@@ -69,12 +69,11 @@ static void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct rb_root ...@@ -69,12 +69,11 @@ static void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct rb_root
parent = *p; parent = *p;
this = rb_entry(parent, struct jffs2_tmp_dnode_info, rb); this = rb_entry(parent, struct jffs2_tmp_dnode_info, rb);
/* There may actually be a collision here, but it doesn't
actually matter. As long as the two nodes with the same
version are together, it's all fine. */
if (tn->version < this->version) if (tn->version < this->version)
p = &(*p)->rb_left; p = &(*p)->rb_left;
else if (tn->version > this->version)
p = &(*p)->rb_right;
else if (tn < this)
p = &(*p)->rb_left;
else else
p = &(*p)->rb_right; p = &(*p)->rb_right;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment