[PATCH] 1/4: Support multiple raid_devs per physical device

Darrick J. Wong djwong at us.ibm.com
Fri Jun 2 00:21:22 UTC 2006

Hi again,

These are preliminary patches to modify dmraid so that we can have
multiple raid_dev structures per physical device.  The DDF1
specification allows for a disk to participate in multiple RAID arrays,
which is what is gained from these patches.  They've been tested against + dmraid45 on Ubuntu 6.06, and seem to be pretty stable.  At
this stage, I'm looking for comments about the code because it touches
core dmraid code and could (but shouldn't) break support for hardware
that I don't have.

This next patch modifies the dmraid core code.  More specifically:

- setup_rd takes a new parameter "num", which is the number of raid_devs
that have already been initialized by setup_rd for the given device.
Or, it's a zero-based index of the current raid_dev that we're
processing for a given dev_info.

- read_raid_dev now takes a new parameter "f_num_disks".  This function
returns the number of raid_devs that should be created given a chunk of
metadata.  If this parameter is NULL then 1 is assumed.  The function
creates an n-element headless list of raid_devs for the device and calls
 setup_rd on each element.

- Adds a flag is_clone to raid_dev.  If this flag is 1, the structs
pointed to by this raid_dev are owned by another raid_dev.  If 0 (the
default), then this raid_dev owns them and can delete them.

- Modifies free_raid_dev to not free pointers of cloned devices.

- Adds a function clone_raid_dev to copy data from one raid_dev to
another and set the is_clone flag.

- Adds a function find_raid_dev_in_chain that finds a raid_dev that
points to a given dev_info.  This is useful in setup_rd when one wants
to find the first raid_dev for this device for cloning purposes.

- Modifies discover_raid_devices and dmraid_read to do the right thing
with a headless list of raid_devs.


Signed-off-by: Darrick J. Wong <djwong at us.ibm.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: core.patch
Type: text/x-patch
Size: 7093 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ataraid-list/attachments/20060601/f673d345/attachment.bin>

More information about the Ataraid-list mailing list