mtd/fs/jffs2 build.c, 1.76, 1.77 fs.c, 1.62, 1.63 nodelist.h, 1.138, 1.139 super-v24.c, 1.84, 1.85 super.c, 1.107, 1.108

havasi at infradead.org havasi at infradead.org
Wed Aug 31 09:51:04 EDT 2005


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

Modified Files:
	build.c fs.c nodelist.h super-v24.c super.c 
Log Message:
[JFFS2] remove support for virtual blocks

For more information please read the mailing list thread
[PATCH] remove support for virtual blocks



Index: build.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/build.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- build.c	30 Jul 2005 15:29:27 -0000	1.76
+++ build.c	31 Aug 2005 13:51:00 -0000	1.77
@@ -318,7 +318,7 @@
 	c->free_size = c->flash_size;
 	c->nr_blocks = c->flash_size / c->sector_size;
 #ifndef __ECOS
- 	if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
+	if (jffs2_blocks_use_vmalloc(c))
 		c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks);
 	else
 #endif
@@ -356,7 +356,7 @@
 		jffs2_free_ino_caches(c);
 		jffs2_free_raw_node_refs(c);
 #ifndef __ECOS
-		if (c->mtd->flags & MTD_NO_VIRTBLOCKS) 
+		if (jffs2_blocks_use_vmalloc(c))
                     vfree(c->blocks);
 		else 
 #endif

Index: fs.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/fs.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- fs.c	6 Aug 2005 04:51:30 -0000	1.62
+++ fs.c	31 Aug 2005 13:51:00 -0000	1.63
@@ -457,19 +457,8 @@
 #endif
 
 	c->flash_size = c->mtd->size;
-
-	/* 
-	 * Check, if we have to concatenate physical blocks to larger virtual blocks
-	 * to reduce the memorysize for c->blocks. (kmalloc allows max. 128K allocation)
-	 */
 	c->sector_size = c->mtd->erasesize; 
 	blocks = c->flash_size / c->sector_size;
-	if (!(c->mtd->flags & MTD_NO_VIRTBLOCKS)) {
-		while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)) {
-			blocks >>= 1;
-			c->sector_size <<= 1;
-		}	
-	}
 
 	/*
 	 * Size alignment check

Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- nodelist.h	17 Aug 2005 13:46:23 -0000	1.138
+++ nodelist.h	31 Aug 2005 13:51:00 -0000	1.139
@@ -197,6 +197,11 @@
 	struct jffs2_raw_node_ref *gc_node;	/* Next node to be garbage collected */
 };
 
+static inline int jffs2_blocks_use_vmalloc(struct jffs2_sb_info *c)
+{
+	return ((c->flash_size / c->sector_size) * sizeof (struct jffs2_eraseblock)) > (128 * 1024);
+}
+
 /* Calculate totlen from surrounding nodes or eraseblock */
 static inline uint32_t __ref_totlen(struct jffs2_sb_info *c,
 				    struct jffs2_eraseblock *jeb,

Index: super-v24.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super-v24.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- super-v24.c	20 Jul 2005 14:21:40 -0000	1.84
+++ super-v24.c	31 Aug 2005 13:51:00 -0000	1.85
@@ -99,7 +99,7 @@
 	up(&c->alloc_sem);
 	jffs2_free_ino_caches(c);
 	jffs2_free_raw_node_refs(c);
-	if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
+	if (jffs2_blocks_use_vmalloc(c))
 		vfree(c->blocks);
 	else
 		kfree(c->blocks);

Index: super.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- super.c	12 Jul 2005 16:37:08 -0000	1.107
+++ super.c	31 Aug 2005 13:51:00 -0000	1.108
@@ -284,7 +284,7 @@
 	up(&c->alloc_sem);
 	jffs2_free_ino_caches(c);
 	jffs2_free_raw_node_refs(c);
-	if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
+	if (jffs2_blocks_use_vmalloc(c))
 		vfree(c->blocks);
 	else
 		kfree(c->blocks);





More information about the linux-mtd-cvs mailing list