diff options
author | NeilBrown <neilb@suse.de> | 2009-06-18 00:47:42 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-18 00:47:42 +0200 |
commit | 597a711b69cfff95c4b8f6069037e7ad3fc71f56 (patch) | |
tree | 8c2cfa4c1223827a560de2f14da426d4822151c4 /drivers/md/md.c | |
parent | md: raid5: check stripe cache is large enough in start_reshape (diff) | |
download | linux-597a711b69cfff95c4b8f6069037e7ad3fc71f56.tar.xz linux-597a711b69cfff95c4b8f6069037e7ad3fc71f56.zip |
md: remove unnecessary arguments from ->reconfig method.
Passing the new layout and chunksize as args is not necessary as
the mddev has fields for new_check and new_layout.
This is preparation for combining the check_reshape and reconfig
methods
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f996d8342a85..5caa421c2367 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2809,9 +2809,12 @@ layout_store(mddev_t *mddev, const char *buf, size_t len) int err; if (mddev->pers->reconfig == NULL) return -EBUSY; - err = mddev->pers->reconfig(mddev, n, -1); - if (err) + mddev->new_layout = n; + err = mddev->pers->reconfig(mddev); + if (err) { + mddev->new_layout = mddev->layout; return err; + } } else { mddev->new_layout = n; if (mddev->reshape_position == MaxSector) @@ -2884,9 +2887,12 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len) int err; if (mddev->pers->reconfig == NULL) return -EBUSY; - err = mddev->pers->reconfig(mddev, -1, n); - if (err) + mddev->new_chunk_sectors = n >> 9; + err = mddev->pers->reconfig(mddev); + if (err) { + mddev->new_chunk_sectors = mddev->chunk_sectors; return err; + } } else { mddev->new_chunk_sectors = n >> 9; if (mddev->reshape_position == MaxSector) @@ -5220,8 +5226,13 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info) */ if (mddev->pers->reconfig == NULL) return -EINVAL; - else - return mddev->pers->reconfig(mddev, info->layout, -1); + else { + mddev->new_layout = info->layout; + rv = mddev->pers->reconfig(mddev); + if (rv) + mddev->new_layout = mddev->layout; + return rv; + } } if (info->size >= 0 && mddev->dev_sectors / 2 != info->size) rv = update_size(mddev, (sector_t)info->size * 2); |