LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Stephane Chazelas <stephane.chazelas@emerson.com>
Cc: "Jörn Engel" <joern@logfs.org>, "Arnd Bergmann" <arnd@arndb.de>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes
Date: Sat, 23 Feb 2008 16:33:21 +0100 [thread overview]
Message-ID: <20080223153321.GC29143@lazybastard.org> (raw)
In-Reply-To: <chaz20080220173053.GX4539@artesyncp.com>
On Wed, 20 February 2008 17:30:53 +0000, Stephane Chazelas wrote:
> >
> > Actually, there is /dev/mtd<x>. Enable CONFIG_MTD_CHAR.
>
> Yes, my point ;). "block2mtd" creates a "mtd" out of a block
> device and "mtdchar" and "mtdblock" create the "char" and
> "block" devices out of the "mtd". This is a different concept
> from "loop". With "loop", you make a block device out of a file,
> but you do the ioctl on the target loop block device itself.
> With block2mtd, you can't do that.
The fact is that there is _no_ interface to manage mtd. Part of the
reason is this tradition to have seperate modules every couple of lines
of code. In other subsystems, CONFIG_MTD_CHAR would not exist and the
code always be compiled in. Simply to get _some_ interface to handle
the device that is always there.
Without going much deeper into that discussion, I consider it acceptable
to depend on CONFIG_MTD_CHAR for things like device removal. If you
want device removal and explicitly don't want the extra code from
mtdchar.c, send a patch or go find 500 bytes to save elsewhere. ;)
With that out of the way, the question remains which interface we should
have. Independently of mimicking loop, I would like to have a generic
interface for all mtd, not just block2mtd. Whether it is "echo 1 >
/sys/.../mtd/mtdN/remove" or an ioctl(), I don't care much about.
> Actually, that's what I use block2mtd for, in combination with
> "loop" to mount jffs2 filesystem images (always wondered if
> there wasn't a simpler way, BTW (other than mtdram))
Logfs can use a block device directly, which still leaves loop.
Enhancing block2mtd to work with files shouldn't be too hard. If anyone
want a fun project to hack on...
Jörn
--
Data dominates. If you've chosen the right data structures and organized
things well, the algorithms will almost always be self-evident. Data
structures, not algorithms, are central to programming.
-- Rob Pike
next prev parent reply other threads:[~2008-02-23 15:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-12 13:47 Stephane Chazelas
2008-02-12 15:21 ` Jörn Engel
2008-02-12 16:10 ` Stephane Chazelas
2008-02-19 15:08 ` Jörn Engel
2008-02-19 22:33 ` Arnd Bergmann
2008-02-20 6:43 ` Jörn Engel
2008-02-20 14:43 ` Stephane Chazelas
2008-02-20 16:30 ` Jörn Engel
2008-02-20 17:02 ` Stephane Chazelas
2008-02-20 17:22 ` Jörn Engel
2008-02-20 17:30 ` Stephane Chazelas
2008-02-23 15:33 ` Jörn Engel [this message]
2008-02-20 14:36 ` Stephane Chazelas
2008-02-20 16:42 ` Jörn Engel
2008-02-20 16:55 ` Stephane Chazelas
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=20080223153321.GC29143@lazybastard.org \
--to=joern@logfs.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=stephane.chazelas@emerson.com \
--subject='Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).