]> git.baikalelectronics.ru Git - kernel.git/commit
md: Allow md devices to be created by name.
authorNeilBrown <neilb@suse.de>
Thu, 8 Jan 2009 21:31:10 +0000 (08:31 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 8 Jan 2009 21:31:10 +0000 (08:31 +1100)
commit1f4a505645666d52a0978f0eda668535f3ee9506
treeef580effd8809fb0bc5d6ffa6f3b8abaa9180539
parent90f7741cba85ba2b7e8bb552f0b1efd942c10979
md: Allow md devices to be created by name.

Using sequential numbers to identify md devices is somewhat artificial.
Using names can be a lot more user-friendly.

Also, creating md devices by opening the device special file is a bit
awkward.

So this patch provides a new option for creating and naming devices.

Writing a name such as "md_home" to
    /sys/modules/md_mod/parameters/new_array
will cause an array with that name to be created.  It will appear in
/sys/block/ /proc/partitions and /proc/mdstat as 'md_home'.
It will have an arbitrary minor number allocated.

md devices that a created by an open are destroyed on the last
close when the device is inactive.
For named md devices, they will not be destroyed until the array
is explicitly stopped, either with the STOP_ARRAY ioctl or by
writing 'clear' to /sys/block/md_XXXX/md/array_state.

The name of the array must start 'md_' to avoid conflict with
other devices.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c
include/linux/raid/md_k.h