Skip to content

UBI: make UBI devices dynamic

Artem Bityutskiy linux-mtd 2 versions – New

Get series with b4
b4 am 20071220142251.30834.86791.sendpatchset@golum

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesNew
  2. v15 patches 15 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6UBI: add UBI control devicedrivers/mtd/ubi/build.c drivers/mtd/ubi/cdev.c drivers/mtd/ubi/ubi.h+71 -110 replies
2/6UBI: add UBI devices reference countingdrivers/mtd/ubi/build.c drivers/mtd/ubi/cdev.c drivers/mtd/ubi/eba.c +4 more+201 -630 replies
3/6UBI: prepare attach and detach functionsdrivers/mtd/ubi/build.c drivers/mtd/ubi/ubi.h drivers/mtd/ubi/wl.c+169 -870 replies
4/6UBI: UBI: remove data_offsetdrivers/mtd/ubi/build.c drivers/mtd/ubi/ubi.h+16 -290 replies
5/6UBI: introduce attach ioctlsinclude/mtd/ubi-user.h+64 -50 replies
5/6UBI: handle attach ioctldrivers/mtd/ubi/cdev.c+69 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] UBI: make UBI devices dynamic

Hi,

here is the second iteration of the patch-set. Changes (were requested by Arnd):

* data_offset is removed as it makes no sens to set it to anything but the default value
* UBI control device is now registered as "misc" device, so we do not waste Linux major/minor numbers
* More commentaries in the ubi-user.h file

The ltree slab cache is not removed, it will be done separately.

The original message
~~~~~~~~~~~~~~~~~~~~

here is a patch-set which makes UBI devices dynamic. This means, that you may attach/detach MTD devices run-time, not just when UBI module is loaded/unloaded. This is very convenient - you do may compile UBI into the kernel and attach/detach needed MTD devices later, when your init scripts (loaded from initrd) decide which exactly MTD device(s) to attach. This also makes testing a lot easier.

The idea is similar to what the device mapper has: UBI creates an UBI control device, which registers itself in UBI sysfs hierarchy (/sys/class/ubi/ubi_ctrl) with dynamically allocated major and minor numbers. The control device has 2 ioctls - attach MTD device and detach MTD device.

This patch-set applies on top of my other UBI changes and fixes, which you may find in the UBI git.

I CC Frank and Andreas, as one of the main UBI users. I CC Arnd as an ioctl expert.

--
Best regards,
Artem Bityutskiy (Битюцкий Артём)