All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linux-mtd@lists.infradead.org
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Ezequiel Garcia <elezegarcia@gmail.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	richard.weinberger@gmail.com,
	Michael Opdenacker <michael.opdenacker@free-electrons.com>,
	Ezequiel Garcia <ezequiel@free-electrons.com>,
	Tim Bird <tim.bird@am.sony.com>
Subject: Re: [RFC/PATCH v2] ubi: Add ubiblock read-write driver
Date: Thu, 18 Apr 2013 16:30:55 -0400	[thread overview]
Message-ID: <201304181630.58886.vapier@gentoo.org> (raw)
In-Reply-To: <1355314912-9321-1-git-send-email-elezegarcia@gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 2251 bytes --]

On Wednesday 12 December 2012 07:21:52 Ezequiel Garcia wrote:
> Block device emulation on top of ubi volumes with read/write support.
> Block devices are created upon user request through the
> 'vol' module parameter.
> 
> For instance,
> 
>   $ modprobe ubiblock vol=/dev/ubi0_0
>   $ modprobe ubiblock vol=0,rootfs

i played around with ubiblk before finding this newer version.  one thing i 
think this is missing that ubiblk had is an ioctl interface for adding new 
block volumes on the fly.  you can attach ubi volumes at runtime, but the only 
way to attach ubiblocks is by loading/unloading the module, or by rebooting 
and tweaking the command line.

imo, that support needs to be re-added.  it'd be great if we could do it via 
the existing /dev/ubi_ctrl knob, but maybe that'll only work if ubi+ubiblock 
are built into the kernel, or if ubiblock is merged with ubi ?

> Read/write access is expected to work fairly well because the
> request queue at block elevator orders block transfers to achieve
> space-locality.
> In other words, it's expected that reads and writes gets ordered
> to address the same LEB.

i wonder if the write support should be put behind a CONFIG option.  
personally, the write support is kind of neat and semi-useful for development, 
but i don't plan on shipping anything on that :).  i just want read-only 
support to load an ext2 fs on top of UBI.

> +static int ubiblock_open(struct block_device *bdev, fmode_t mode)
> +{
> +	struct ubiblock *dev = bdev->bd_disk->private_data;
> +	int ubi_mode = UBI_READONLY;
> +	int ret;
> +
> +	mutex_lock(&dev->vol_mutex);
> +	if (dev->refcnt > 0) {
> +		/*
> +		 * The volume is already opened,
> +		 * just increase the reference counter
> +		 */
> +		dev->refcnt++;
> +		mutex_unlock(&dev->vol_mutex);
> +		return 0;
> +	}
> +
> +	if (mode & FMODE_WRITE)
> +		ubi_mode = UBI_READWRITE;

hmm, you handle ro vs rw here ...

> +	ret = ubiblock_alloc_cache(&dev->read_cache, dev->leb_size);
> +	if (ret)
> +		goto out_free;
> +
> +	ret = ubiblock_alloc_cache(&dev->write_cache, dev->leb_size);
> +	if (ret)
> +		goto out_free_cache;

... but you always alloc a write cache even when it's mounted ro ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-04-18 20:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 12:21 [RFC/PATCH v2] ubi: Add ubiblock read-write driver Ezequiel Garcia
2012-12-12 15:21 ` richard -rw- weinberger
2012-12-12 15:50   ` Gregory CLEMENT
2012-12-12 16:14     ` richard -rw- weinberger
2012-12-12 16:30       ` Greg KH
2012-12-12 16:32         ` richard -rw- weinberger
2012-12-12 16:18   ` Ezequiel Garcia
2012-12-12 16:35     ` Ezequiel Garcia
2012-12-12 17:26       ` Michael Opdenacker
2012-12-12 19:50         ` Tim Bird
2013-04-18 20:30 ` Mike Frysinger [this message]
2013-04-18 20:58   ` Peter Korsgaard
2013-04-19  0:13   ` Ezequiel Garcia
2013-04-19  1:28     ` Mike Frysinger
2013-04-19  7:10       ` Gupta, Pekon
2013-04-19 11:57         ` Mike Frysinger
2013-04-19 12:31           ` Artem Bityutskiy
2013-04-19 12:31             ` Bityutskiy, Artem
2013-04-19 12:53             ` Mike Frysinger
2013-04-19 12:55               ` Matthieu CASTET
2013-04-24 16:27                 ` Mike Frysinger
2013-04-19 12:56               ` Artem Bityutskiy
2013-04-19 15:02             ` Ezequiel Garcia
2013-04-19 17:05             ` Tim Bird
2013-04-20 18:12               ` Brian Norris
2013-05-13  7:44               ` Artem Bityutskiy
2013-04-20  7:50             ` richard -rw- weinberger
2013-05-13  7:49               ` Artem Bityutskiy
2013-05-13  9:23                 ` richard -rw- weinberger
2013-04-19 12:27       ` Ezequiel Garcia
2013-05-13  7:28   ` Artem Bityutskiy

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=201304181630.58886.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=dedekind1@gmail.com \
    --cc=elezegarcia@gmail.com \
    --cc=ezequiel@free-electrons.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael.opdenacker@free-electrons.com \
    --cc=richard.weinberger@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tim.bird@am.sony.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.