[PATCH/RFC] MTD: Striping layer core

Jörn Engel joern at wohnheim.fh-wedel.de
Fri Mar 31 04:27:15 EST 2006


On Fri, 31 March 2006 12:05:48 +0400, Artem B. Bityutskiy wrote:
> Artem B. Bityutskiy wrote:
> >Good question. I think you could report this is a striped device 
> >(introducing an MTD_STRIPED option). Also you may provide a 
> >stripe_get_info(struct mtd_info *mtd) function which will return a 
> >struct stripe_info object describing this striped device, including the 
> >components it consists of.
> Err, and I believe you *have to* report mtd type as MTD_STRIPED.

URGH!

The current mess that makes up mtd->type and mtd->flags needs to be
sanitized anyway.  Instead of being MTD_NAND, MTD_NOR or MTD_STRIPED,
it should tell the user _how_ to treat the device, not _what_ it is.
Basically, whereever a user (jffs2 basically) has
	if (mtd->type == MTD_FOO)
		setup_bar;
it should actually do
	if (mtd->flags == MTD_NEEDS_BAR)
		setup_bar;

Quite likely there won't be many flags left after the cleanup is done.
Most of them should simple be erase_size and write_size (page_size or
ecc_size currently), not flags.

Jörn

-- 
You can't tell where a program is going to spend its time. Bottlenecks
occur in surprising places, so don't try to second guess and put in a
speed hack until you've proven that's where the bottleneck is.
-- Rob Pike




More information about the linux-mtd mailing list