mtd/fs/jffs2 nodelist.c,1.57,1.58 nodelist.h,1.80,1.81 readinode.c,1.85,1.86

David Woodhouse dwmw2 at infradead.org
Tue Sep 3 19:43:19 EDT 2002


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv2443

Modified Files:
	nodelist.c nodelist.h readinode.c 
Log Message:
Argh. replace_node needs to fix the root, too.


Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- nodelist.c	3 Sep 2002 23:06:53 -0000	1.57
+++ nodelist.c	3 Sep 2002 23:43:16 -0000	1.58
@@ -534,7 +534,7 @@
 	return node->rb_parent;
 }
 
-void rb_replace_node(rb_node_t *victim, rb_node_t *new)
+void rb_replace_node(rb_node_t *victim, rb_node_t *new, rb_root_t *root)
 {
 	rb_node_t *parent = victim->rb_parent;
 
@@ -549,6 +549,8 @@
 			       victim, parent, parent->rb_left, parent->rb_right);
 			BUG();
 		}
+	} else {
+		root->rb_node = new;
 	}
 	if (victim->rb_left)
 		victim->rb_left->rb_parent = new;

Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- nodelist.h	3 Sep 2002 21:43:17 -0000	1.80
+++ nodelist.h	3 Sep 2002 23:43:17 -0000	1.81
@@ -269,7 +269,7 @@
 void jffs2_kill_fragtree(rb_root_t *root, struct jffs2_sb_info *c_delete);
 void jffs2_fragtree_insert(struct jffs2_node_frag *newfrag, struct jffs2_node_frag *base);
 rb_node_t *rb_next(rb_node_t *);
-void rb_replace_node(rb_node_t *victim, rb_node_t *new);
+void rb_replace_node(rb_node_t *victim, rb_node_t *new, rb_root_t *root);
 
 /* nodemgmt.c */
 int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len, int prio);

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- readinode.c	3 Sep 2002 23:07:12 -0000	1.85
+++ readinode.c	3 Sep 2002 23:43:17 -0000	1.86
@@ -221,7 +221,7 @@
 			  newfrag, newfrag->ofs, newfrag->ofs+newfrag->size,
 			  this, this->ofs, this->ofs+this->size));
 	
-		rb_replace_node(&this->rb, &newfrag->rb);
+		rb_replace_node(&this->rb, &newfrag->rb, list);
 		printk("After rb_replace_node:\n");
 		jffs2_print_fragtree(list, 1);
 





More information about the linux-mtd-cvs mailing list