From: David Woodhouse <dwmw2@infradead.org>
To: Studying MTD <studying_mtd@yahoo.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: why MTD model ?
Date: Fri, 14 Jun 2002 08:54:59 +0100 [thread overview]
Message-ID: <18178.1024041299@redhat.com> (raw)
In-Reply-To: <20020614042945.11949.qmail@web21504.mail.yahoo.com>
studying_mtd@yahoo.com said:
> you mean, it is possible.
> > but that is not a true representation of the
> > capabilities of the underlying
> > device.
>
> what you mean by "true representation of the capabilities" ?
> what i will miss, if i use memory flash device as block device and
> merge memory flash device with other block devices ?
Flash devices have large erase blocks. You cannot just treat them as a block
device with a sector size of 64KiB, etc. A flash device can have sectors
erased independently of write operations, can have write operations
performed independently of erases (e.g. JFFS2 does so just to clear one
extra 'valid' bit in existing nodes', can support writes to arbitrary byte
ranges, etc. The MTD API allows you to make use of those features.
The block device model does not offer a way to handle any of that. It only
allows you to make atomic updates of fixed-size sectors, which is not
something that flash devices are naturally capable of. To use flash as a
block device, you have to have some kind of 'translation layer' hack.
The simplest we have is the 'mtdblock' one, which on receiving a write
request simply reads the whole of the erase block which it landed in,
erases that block, then writes it all back out again with the offending
sector modified. That's obviously very unsafe, but it's OK for setting up
file systems which are going to be read-only in production.
Others are more complicated and safe w.r.t. power failure, essentially a
complete journalling file system in themselves just to emulate a block
device with small sectors. On top of which people put 'normal' journalling
file systems.
Having a journalling file system atop a journalling file system sucks. We
do far better by exposing an API which represents the true functionality of
the underlying devices and designing a file system to make use of that
directly.
--
dwmw2
next prev parent reply other threads:[~2002-06-14 7:55 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-12 23:53 why MTD model ? Studying MTD
2002-06-13 10:34 ` David Woodhouse
2002-06-13 16:19 ` Studying MTD
2002-06-13 16:39 ` Gregg C Levine
2002-06-13 17:13 ` Howto create a new jffs2 Krypton
2002-06-14 2:22 ` Steve Tsai
2002-06-14 3:20 ` Problem putting JFFS on MTD Clifford Loo
2002-06-14 7:33 ` David Woodhouse
2002-06-14 8:46 ` Clifford Loo
2002-06-14 8:50 ` David Woodhouse
2002-06-14 9:18 ` Clifford Loo
2002-06-14 9:17 ` David Woodhouse
2002-06-14 9:39 ` Clifford Loo
2002-06-14 6:22 ` Howto create a new jffs2 Krypton
2002-06-14 6:55 ` Studying MTD
2002-06-14 7:46 ` Krypton
2002-06-14 7:47 ` David Woodhouse
2002-06-14 9:52 ` Krypton
2002-06-13 21:34 ` why MTD model ? David Woodhouse
2002-06-14 4:29 ` Studying MTD
2002-06-14 7:54 ` David Woodhouse [this message]
2002-06-14 9:01 ` Studying MTD
2002-06-14 9:23 ` David Woodhouse
2002-06-14 9:59 ` Studying MTD
2002-06-14 12:21 ` David Woodhouse
2002-06-14 12:36 ` Gregg C Levine
2002-06-19 14:28 ` Eric W. Biederman
[not found] <4611.1024058858@redhat.com>
2002-06-14 23:39 ` Gregg C Levine
2002-06-15 7:34 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18178.1024041299@redhat.com \
--to=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=studying_mtd@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox