[PATCH/RFC] MTD: Striping layer core

Artem B. Bityutskiy dedekind at infradead.org
Fri Mar 31 05:18:44 EST 2006


On Fri, 2006-03-31 at 12:07 +0200, Jörn Engel wrote:
> I take it that mtd->type is not exported to userspace yet.  Which is
> good, because imho it shouldn't be.  Flash should me a step towards a
> standard interface, something that hard disk have had for years.
> Knowing every little detail about every single flash chip bears more
> harm than good.

Again, imagine mtd->type is the only flash-specific field in mtd_info.
You work with any flash the same way. But if you still want to do some
flash-specific things, you look at mtd->type, determine which kind of
flash is this, then work with the flash-specific subsystem.

> And as far as in-kernel users are concerned, JFFS2 is the only one
> that really matters.  For JFFS2, my previous statement still stand
> that it should base decisions on the existence of a feature, not a
> type.

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.


> You could still have flash types, but merely as aggregates of
> features, nothing else.  For example, NAND flash could have
> FEATURE_OOB, FEATURE_WBUF, FEATURE_ECC etc.  Which of these feature
> make sense and are really needed is another matter, but you should get
> the idea.

Decomposition on features is not very nice IMO. It is better to specify
type. Each type has its own set of features. It is too difficult to
recognize all features, classify them nicely and put into mtd_info.
Features go and come, the change.

There may be some feature-bound decomposition, but in parallel to the
decomposition by type, which is the main and more natural decomposition.


-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.





More information about the linux-mtd mailing list