ROMBLOCK: Readonly Block Device Layer Over MTD
PATCH 1/1 ROMBLOCK: Readonly Block Device Layer Over MTD
I send this mail again as my previous patch was mangled, I hope that now I fixed it.
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...
Quoted 1 line
From
9a06e0c1818e4b27a04a8adac7eee551c8aac115Mon Sep 17 00:00:00 2001
From: Gregory CLEMENT <[email protected]>
Date: Wed, 12 Dec 2007 17:41:23 +0100
Subject: [PATCH] [MTD] BLOCK_RO: 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
@@ -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 +1 -0
@@ -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
Quoted 35 lines · Gregory CLEMENT
I send this mail again as my previous patch was mangled, I hope that now I fixed it.
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...Quoted 1 line
From
9a06e0c1818e4b27a04a8adac7eee551c8aac115Mon Sep 17 00:00:00 2001From: Gregory CLEMENT <[email protected]>
Date: Wed, 12 Dec 2007 17:41:23 +0100
Subject: [PATCH] [MTD]BLOCK_RO: Readonly Block Device Layer Over MTDDescription:
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 drivermtdblock_ro.cand 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).
Quoted 1 line
Signed-off-by Gregory CLEMENT <[email protected]>
For me this amount of mtdblock drivers looks strange. We have 2 already, and this is the third.
If you really cannot modify mtdblock_ro, then I'd kindly ask you to also write a good explanation: what are all those mtdblock/rombolck, what is the difference, why we need so many of them. Then I would put your text to the MTD web site.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)