[PATCH/RFC] MTD: Striping layer core

Jörn Engel joern at wohnheim.fh-wedel.de
Fri Mar 31 06:40:49 EST 2006


On Fri, 31 March 2006 14:18:44 +0400, Artem B. Bityutskiy wrote:
> 
> It looks at mtd->type, finds out the type, and it knows what features
> must be there. No flash-specific features are available in mtd_info. It
> only contains generic stuff. For example, mtd_info should not even
> contain the OOB-handling stuff. If you want to work with OOB then your
> application is NAND-bound. Then you look at mtd->type, see this is NAND,
> and happily start working with NAND subsystem of MTD.
> 
> Note, what I'm saying is far from the current things, again, I'm saying
> how things should look like in my oppinion.

Right now, we have code like

#define jffs2_can_mark_obsolete(c) ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & MTD_ECC)) || c->mtd->type == MTD_RAM)

I guess we can both agree that it is far from optimal.  And my take
would be to replace it with

#define jffs2_can_mark_obsolete(c) (c->mtd->flags & MTD_CAN_MARK_OBSOLETE)

Note that mtd->type has gone.

Jörn

-- 
A surrounded army must be given a way out.
-- Sun Tzu




More information about the linux-mtd mailing list