diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-03-17 18:10:40 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-03-31 14:57:49 +1100 |
commit | 80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03 (patch) | |
tree | de88622f05a7e681ac7bff7714e8f2d8953b66ac /drivers/md/multipath.c | |
parent | 93ed05e2a56b5ee06c0100a169433b11c4aa5d0b (diff) | |
download | kernel-crypto-80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03.tar.gz kernel-crypto-80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03.tar.xz kernel-crypto-80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03.zip |
md: add 'size' as a personality method
In preparation for giving userspace control over ->array_sectors we need
to be able to retrieve the 'default' size, and the 'anticipated' size
when a reshape is requested. For personalities that do not reshape emit
a warning if anything but the default size is requested.
In the raid5 case we need to update ->previous_raid_disks to make the
new 'default' size available.
Reviewed-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 87accf74e4b..a3f6d8668bb 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -406,6 +406,14 @@ static void multipathd (mddev_t *mddev) spin_unlock_irqrestore(&conf->device_lock, flags); } +static sector_t multipath_size(mddev_t *mddev, sector_t sectors, int raid_disks) +{ + WARN_ONCE(sectors || raid_disks, + "%s does not support generic reshape\n", __func__); + + return mddev->dev_sectors; +} + static int multipath_run (mddev_t *mddev) { multipath_conf_t *conf; @@ -502,7 +510,7 @@ static int multipath_run (mddev_t *mddev) /* * Ok, everything is just fine now */ - mddev->array_sectors = mddev->dev_sectors; + mddev->array_sectors = multipath_size(mddev, 0, 0); mddev->queue->unplug_fn = multipath_unplug; mddev->queue->backing_dev_info.congested_fn = multipath_congested; @@ -547,6 +555,7 @@ static struct mdk_personality multipath_personality = .error_handler = multipath_error, .hot_add_disk = multipath_add_disk, .hot_remove_disk= multipath_remove_disk, + .size = multipath_size, }; static int __init multipath_init (void) |