mtd/fs/jffs2 nodelist.c, 1.102, 1.103 nodelist.h, 1.135, 1.136 readinode.c, 1.133, 1.134

Artem Bityuckiy dedekind at infradead.org
Sun Jul 31 04:20:48 EDT 2005


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

Modified Files:
	nodelist.c nodelist.h readinode.c 
Log Message:
[JFFS2] move one more fragtree-related func to nodelist.c



Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- nodelist.c	28 Jul 2005 12:45:10 -0000	1.102
+++ nodelist.c	31 Jul 2005 08:20:44 -0000	1.103
@@ -51,6 +51,30 @@
 	*prev = new;
 }
 
+void jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, uint32_t size)
+{
+	struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size);
+
+	JFFS2_DBG_FRAGTREE("truncating fragtree to 0x%08x bytes\n", size);
+
+	/* We know frag->ofs <= size. That's what lookup does for us */
+	if (frag && frag->ofs != size) {
+		if (frag->ofs+frag->size >= size) {
+			JFFS2_DBG_FRAGTREE2("truncating frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size);
+			frag->size = size - frag->ofs;
+		}
+		frag = frag_next(frag);
+	}
+	while (frag && frag->ofs >= size) {
+		struct jffs2_node_frag *next = frag_next(frag);
+
+		JFFS2_DBG_FRAGTREE("removing frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size);
+		frag_erase(frag, list);
+		jffs2_obsolete_node_frag(c, frag);
+		frag = next;
+	}
+}
+
 void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this)
 {
 	if (this->node) {

Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -r1.135 -r1.136
--- nodelist.h	27 Jul 2005 14:46:11 -0000	1.135
+++ nodelist.h	31 Jul 2005 08:20:44 -0000	1.136
@@ -310,6 +310,7 @@
 void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root);
 void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this);
 int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn);
+void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size);
 
 /* nodemgmt.c */
 int jffs2_thread_should_wake(struct jffs2_sb_info *c);
@@ -333,7 +334,6 @@
 
 
 /* readinode.c */
-void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size);
 int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 
 			uint32_t ino, struct jffs2_raw_inode *latest_node);
 int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- readinode.c	30 Jul 2005 15:28:24 -0000	1.133
+++ readinode.c	31 Jul 2005 08:20:44 -0000	1.134
@@ -21,30 +21,6 @@
 #include <linux/compiler.h>
 #include "nodelist.h"
 
-void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size)
-{
-	struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size);
-
-	JFFS2_DBG_FRAGTREE("truncating fragtree to 0x%08x bytes\n", size);
-
-	/* We know frag->ofs <= size. That's what lookup does for us */
-	if (frag && frag->ofs != size) {
-		if (frag->ofs+frag->size >= size) {
-			JFFS2_DBG_FRAGTREE2("truncating frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size);
-			frag->size = size - frag->ofs;
-		}
-		frag = frag_next(frag);
-	}
-	while (frag && frag->ofs >= size) {
-		struct jffs2_node_frag *next = frag_next(frag);
-
-		JFFS2_DBG_FRAGTREE("removing frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size);
-		frag_erase(frag, list);
-		jffs2_obsolete_node_frag(c, frag);
-		frag = next;
-	}
-}
-
 /* 
  * Put a new tmp_dnode_info into the temporaty RB-tree, keeping the list in 
  * order of increasing version.





More information about the linux-mtd-cvs mailing list