aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-06-17 18:47:42 -0400
committerNeilBrown <neilb@suse.de>2009-06-17 18:47:42 -0400
commit597a711b69cfff95c4b8f6069037e7ad3fc71f56 (patch)
tree8c2cfa4c1223827a560de2f14da426d4822151c4 /drivers/md/md.c
parent01ee22b496c41384eaa6dcae983c86d8bc32fbb8 (diff)
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.c23
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)
2809 int err; 2809 int err;
2810 if (mddev->pers->reconfig == NULL) 2810 if (mddev->pers->reconfig == NULL)
2811 return -EBUSY; 2811 return -EBUSY;
2812 err = mddev->pers->reconfig(mddev, n, -1); 2812 mddev->new_layout = n;
2813 if (err) 2813 err = mddev->pers->reconfig(mddev);
2814 if (err) {
2815 mddev->new_layout = mddev->layout;
2814 return err; 2816 return err;
2817 }
2815 } else { 2818 } else {
2816 mddev->new_layout = n; 2819 mddev->new_layout = n;
2817 if (mddev->reshape_position == MaxSector) 2820 if (mddev->reshape_position == MaxSector)
@@ -2884,9 +2887,12 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len)
2884 int err; 2887 int err;
2885 if (mddev->pers->reconfig == NULL) 2888 if (mddev->pers->reconfig == NULL)
2886 return -EBUSY; 2889 return -EBUSY;
2887 err = mddev->pers->reconfig(mddev, -1, n); 2890 mddev->new_chunk_sectors = n >> 9;
2888 if (err) 2891 err = mddev->pers->reconfig(mddev);
2892 if (err) {
2893 mddev->new_chunk_sectors = mddev->chunk_sectors;
2889 return err; 2894 return err;
2895 }
2890 } else { 2896 } else {
2891 mddev->new_chunk_sectors = n >> 9; 2897 mddev->new_chunk_sectors = n >> 9;
2892 if (mddev->reshape_position == MaxSector) 2898 if (mddev->reshape_position == MaxSector)
@@ -5220,8 +5226,13 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
5220 */ 5226 */
5221 if (mddev->pers->reconfig == NULL) 5227 if (mddev->pers->reconfig == NULL)
5222 return -EINVAL; 5228 return -EINVAL;
5223 else 5229 else {
5224 return mddev->pers->reconfig(mddev, info->layout, -1); 5230 mddev->new_layout = info->layout;
5231 rv = mddev->pers->reconfig(mddev);
5232 if (rv)
5233 mddev->new_layout = mddev->layout;
5234 return rv;
5235 }
5225 } 5236 }
5226 if (info->size >= 0 && mddev->dev_sectors / 2 != info->size) 5237 if (info->size >= 0 && mddev->dev_sectors / 2 != info->size)
5227 rv = update_size(mddev, (sector_t)info->size * 2); 5238 rv = update_size(mddev, (sector_t)info->size * 2);