aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorArtem B. Bityuckiy <dedekind@infradead.org>2005-07-06 10:43:18 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-07-06 12:30:00 -0400
commit6430a8def12edebc1c9c7c2621d33ca0e8653c33 (patch)
treed3c12091e821b7a98da9a58d9d11f648699d207c /fs/jffs2
parent265489f01d8c05f7aae174651a98854af090efc0 (diff)
[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: Artem B. Bityuckiy <dedekind@infradead.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/nodelist.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index be38cc5c35cd..c7bbdeec93a6 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: nodelist.c,v 1.95 2005/07/05 21:03:07 dwmw2 Exp $ 10 * $Id: nodelist.c,v 1.97 2005/07/06 15:18:41 dwmw2 Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -69,12 +69,11 @@ static void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct rb_root
69 parent = *p; 69 parent = *p;
70 this = rb_entry(parent, struct jffs2_tmp_dnode_info, rb); 70 this = rb_entry(parent, struct jffs2_tmp_dnode_info, rb);
71 71
72 /* There may actually be a collision here, but it doesn't
73 actually matter. As long as the two nodes with the same
74 version are together, it's all fine. */
72 if (tn->version < this->version) 75 if (tn->version < this->version)
73 p = &(*p)->rb_left; 76 p = &(*p)->rb_left;
74 else if (tn->version > this->version)
75 p = &(*p)->rb_right;
76 else if (tn < this)
77 p = &(*p)->rb_left;
78 else 77 else
79 p = &(*p)->rb_right; 78 p = &(*p)->rb_right;
80 } 79 }