[PATCH 21/22] Default erase size

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Dec 21 09:11:46 EST 2004


For block devices, an erase size of 0 makes little sense.  PAGE_SIZE
should be a sane default.

Signed-off-by: Jörn Engel <joern at wohnheim.fh-wedel.de>
---

 blockmtd.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

--- linux-2.6.9cow/drivers/mtd/devices/blockmtd.c~blockmtd_erasesize	2004-12-21 02:19:58.000000000 +0100
+++ linux-2.6.9cow/drivers/mtd/devices/blockmtd.c	2004-12-21 02:23:25.000000000 +0100
@@ -38,7 +38,6 @@
 
 
 /* Default erase size in K, always make it a multiple of PAGE_SIZE */
-#define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10)	/* 128KiB */
 #define VERSION "$Revision: 1.23 $"
 
 /* Info for the block device */
@@ -290,7 +289,6 @@
 	if (!dev)
 		return;
 
-	kfree(dev->mtd.eraseregions);
 	kfree(dev->mtd.name);
 
 	if (dev->blkdev) {
@@ -432,7 +430,7 @@
 	char buf[80+12], *str=buf; /* 80 for device, 12 for erase size */
 	char *token[2];
 	char *name;
-	size_t erase_size = 0;
+	size_t erase_size = PAGE_SIZE;
 	int i, ret;
 
 	if (strnlen(val, sizeof(buf)) >= sizeof(buf))




More information about the linux-mtd mailing list