Skip to contentSkip to conversation

ROMBLOCK: Readonly Block Device Layer Over MTD

PATCH New Gregory CLEMENT 1 participant 1 message Dec 13, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ROMBLOCK: Readonly Block Device Layer Over MTD

Hi,
I generated this patch for linux 2.6.24.rc5 and tested it with cramfs and squashfs file systems.
As Konstantin Baydarov submit this patch first maybe it would be better than he sign this patch, but if he can't or don't want it, I don't mind sign it...

From: Gregory CLEMENT <[email protected]>
Date: Wed, 12 Dec 2007 17:41:23 +0100
Subject: [PATCH] [MTD] ROMBLOCK: Readonly Block Device Layer Over MTD

Description:
The following patch adds readonly block device layer over mtd that allows to use any filesystem on this device in RO mode and thus gain faster mount times and better throughput rates.
It allows to put one RO filesystem into NAND using a bad-block aware program initially, and mount it. But be aware, it doesn't handle run- time bit flips or errors (even if this event seems pretty rare).

How it works:
Blocks translation routine was added to read sector function. Assuming that bad block won't appear during MTD reading and BBT is correct, bad block is skipped and requested block is lazily mapped to good one. Block driver based on the mtd readonly device driver mtdblock_ro.c and translation routine was taken from the patch of Pantelis Antoniou (which can be found at
http://lists.infradead.org/pipermail/linux-mtd/2004-May/009672.html).
This patch was originally submit by Konstantin Baydarov, but never included nor rejected ( see
http://lists.infradead.org/pipermail/linux-mtd/2006-November/016835.html).

---

drivers/mtd/Kconfig    |    7 ++
drivers/mtd/Makefile   |    1 +
drivers/mtd/romblock.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 181 insertions(+), 0 deletions(-)

create mode 100644 drivers/mtd/romblock.c

drivers/mtd/Kconfig +7 -0
index 8848e8a..dd6ae3a 100644
@@ -200,6 +200,13 @@ config MTD_BLOCK_RO
      You do not need this option for use with the DiskOnChip devices. For
      those, enable NFTL support (CONFIG_NFTL) instead.
 
+config MTD_BLOCK_ROMBLOCK
+       tristate "Readonly Block Device Layer Over MTD"
+       depends on MTD
+       help
+         Same as readonly block driver, but this allow you to mount read-only file
+         systems from an MTD device, containing bad blocks.
+

config FTL
tristate "FTL (Flash Translation Layer) support" depends on BLOCK

drivers/mtd/Makefile +0 -0
index 7f0b04b..9cb4683 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_MTD_CHAR)        += mtdchar.o

obj-$(CONFIG_MTD_BLKDEVS) += mtd_blkdevs.o
obj-$(CONFIG_MTD_BLOCK) += mtdblock.o
obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o
+obj-$(CONFIG_MTD_BLOCK_ROMBLOCK) += romblock.o mtd_blkdevs.o
obj-$(CONFIG_FTL) += ftl.o
obj-$(CONFIG_NFTL) += nftl.o
obj-$(CONFIG_INFTL) += inftl.o

drivers/mtd/romblock.c new file +173 -0

173 lines not on this page · raw message

Signature · 12 lines
1.5.3.7


-- 
Gregory CLEMENT
Adeneo
Adetel Group
2, chemin du Ruisseau
69134 ECULLY - FRANCE
Tél. : +33 (0)4 72 18 08 40 - Fax : +33 (0)4 72 18 08 41

www.adetelgroup.com