linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/3] ubi: Add block interface
@ 2014-02-24 12:39 Ezequiel Garcia
  2014-02-24 12:39 ` [PATCH v7 1/3] ubi: Introduce read-only block devices on top of UBI volumes Ezequiel Garcia
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ezequiel Garcia @ 2014-02-24 12:39 UTC (permalink / raw)
  To: linux-mtd
  Cc: Thomas Petazzoni, Mike Frysinger, Artem Bityutskiy,
	Richard Weinberger, Michael Opdenacker, Ezequiel Garcia,
	Piergiorgio Beruto, Brian Norris, David Woodhouse, Willy Tarreau

This patch adds read-only block device access on top of UBI volumes, allowing
for a ligthweigth solution to mount block-oriented filesystems on top of
flash devices.

The main target of this patch is supporting lighter, read-only filesystem,
by putting a squashfs on top of ubiblock.

You can read this discussion if you are want more historical details:

  http://lkml.indiana.edu/hypermail/linux/kernel/1211.2/02556.html

In particular, it's important to note this already has users:

  1. http://permalink.gmane.org/gmane.linux.drivers.mtd/46221

  2. http://permalink.gmane.org/gmane.linux.drivers.mtd/49385

  3. Myself

(Artem: I hope I've addressed all your feedback on v5.)

More feedback, comments and testing welcome/needed.

* Changes from v6

  * Changed the user-space tool name: ubiblock.

  * Amended the website documentation and all the comments in code to
    remove any reference to write support or the lack of a cache.

  * Changed the type of the requested byte address to 'loff_t', removing
    the limitation on the UBI volume size. Accordingly, use do_div()
    to get the leb:offset address.

  * Changed thea ubiblock structure mutex name: s/vol_mutex/dev_mutex.

  * Changed the ubiblock_init() error handling so it returns an error
    if it fails to attach any user-requested block. Accordingly, ubi_init()
    has been changed to error (thus UBI fails to load, if compiled as module)
    if ubiblock_init() fails.

* Changes from v5

  * Remove stupid comment about code aesthetic.

  * Rework comments inside the driver and added user documentation to the
    mtd website.

  * Included the mtd-utils patch, adding the ubiblkvol user-space tool.

* Changes from v4

  * Dropped write-support

  * Dropped cached access

* Changes from v3

  * Replaced the 2-LEB (read and write) for a 1-LEB cache. This was done
    to prevent any cache-coherency issues and to avoid over-design.
    It's not clear having a separate read and write cache has a dramatical
    impact on wear leveling or performance.

  * Made the 1-LEB cache optional. Based on a suggestion by Piergiorgio
    Beruto, caching at the block level would be redundant and ineffective.
    The filesystem has a better chance of caching.

    Some very simple tests on squashfs (ubiblock's primary target) showed
    that squashfs does a great job on caching its file accesses.

    Given a LEB can be quite big on some devices O(~100KiB), it can be
    interesting to remove the cache altogether on memory-constrained platforms.

  * Make UBI_IOCVOLDETBLK return an error if the detaching wasn't successful,
    as suggested by Mike Frysinger.

  * Fixed a bunch of typos and suggestions made by Mike Frysinger.

* Changes from v2

  * On this 3rd version of the patch I've re-worked the patch considerably,
    mostly integrating it with UBI, instead of making it a separate module.

    Despite this integration, the ubiblock code is still completely independent
    of the UBI core and it can be completely compiled-out through configuration.

  * Making ubiblock part of UBI allows to add ioctl access to attach/detach
    block devices to/from UBI volumes in a very simple way.

  * A new tool 'ubiblkvol' is added to ubi-utils to access these two new ioctls.

  * To address the 'write or not to write' discussion, the write support is
    enabled with a kernel option and there's a big fat 'DANGEROUS' label on it
    to prevent misusage.

Ezequiel Garcia (1):
  ubi: Introduce block devices for UBI volumes

 drivers/mtd/ubi/Kconfig     |  19 ++
 drivers/mtd/ubi/Makefile    |   1 +
 drivers/mtd/ubi/block.c     | 660 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/ubi/build.c     |   5 +
 drivers/mtd/ubi/cdev.c      |  20 ++
 drivers/mtd/ubi/ubi.h       |  14 +
 include/uapi/mtd/ubi-user.h |  11 +
 7 files changed, 730 insertions(+)
 create mode 100644 drivers/mtd/ubi/block.c

--
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Richard Weinberger <richard.weinberger@gmail.com>

-- 
1.8.1.5

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-03-05 12:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 12:39 [PATCH v7 0/3] ubi: Add block interface Ezequiel Garcia
2014-02-24 12:39 ` [PATCH v7 1/3] ubi: Introduce read-only block devices on top of UBI volumes Ezequiel Garcia
2014-02-25 16:25   ` [PATCH v8] " Ezequiel Garcia
2014-02-28 14:29   ` [PATCH v7 1/3] " Artem Bityutskiy
2014-02-28 14:56     ` Ezequiel Garcia
2014-03-05 10:57   ` Artem Bityutskiy
2014-03-05 12:52     ` Ezequiel Garcia
2014-03-05 12:55       ` Artem Bityutskiy
2014-02-24 12:39 ` [PATCH v7 2/3] ubi-utils: Add ubiblock tool Ezequiel Garcia
2014-03-04 10:09   ` Artem Bityutskiy
2014-03-04 10:16     ` Ezequiel Garcia
2014-02-24 12:39 ` [PATCH v7 3/3] Add UBI block interface documentation Ezequiel Garcia
2014-03-04 10:05   ` Artem Bityutskiy

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).