aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-06-17 18:47:55 -0400
committerNeilBrown <neilb@suse.de>2009-06-17 18:47:55 -0400
commit50ac168a6e0a061bf5346d53aa9e7beb94c97527 (patch)
tree4f1eff67793bd8349a1995c921a63e9512be7818 /drivers/md/md.c
parent597a711b69cfff95c4b8f6069037e7ad3fc71f56 (diff)
md: merge reconfig and check_reshape methods.
The difference between these two methods is artificial. Both check that a pending reshape is valid, and perform any aspect of it that can be done immediately. 'reconfig' handles chunk size and layout. 'check_reshape' handles raid_disks. So make them just one method. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5caa421c2367..80f039ec3ac2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2807,10 +2807,10 @@ layout_store(mddev_t *mddev, const char *buf, size_t len)
2807 2807
2808 if (mddev->pers) { 2808 if (mddev->pers) {
2809 int err; 2809 int err;
2810 if (mddev->pers->reconfig == NULL) 2810 if (mddev->pers->check_reshape == NULL)
2811 return -EBUSY; 2811 return -EBUSY;
2812 mddev->new_layout = n; 2812 mddev->new_layout = n;
2813 err = mddev->pers->reconfig(mddev); 2813 err = mddev->pers->check_reshape(mddev);
2814 if (err) { 2814 if (err) {
2815 mddev->new_layout = mddev->layout; 2815 mddev->new_layout = mddev->layout;
2816 return err; 2816 return err;
@@ -2885,10 +2885,10 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len)
2885 2885
2886 if (mddev->pers) { 2886 if (mddev->pers) {
2887 int err; 2887 int err;
2888 if (mddev->pers->reconfig == NULL) 2888 if (mddev->pers->check_reshape == NULL)
2889 return -EBUSY; 2889 return -EBUSY;
2890 mddev->new_chunk_sectors = n >> 9; 2890 mddev->new_chunk_sectors = n >> 9;
2891 err = mddev->pers->reconfig(mddev); 2891 err = mddev->pers->check_reshape(mddev);
2892 if (err) { 2892 if (err) {
2893 mddev->new_chunk_sectors = mddev->chunk_sectors; 2893 mddev->new_chunk_sectors = mddev->chunk_sectors;
2894 return err; 2894 return err;
@@ -5224,11 +5224,11 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
5224 * we don't need to do anything at the md level, the 5224 * we don't need to do anything at the md level, the
5225 * personality will take care of it all. 5225 * personality will take care of it all.
5226 */ 5226 */
5227 if (mddev->pers->reconfig == NULL) 5227 if (mddev->pers->check_reshape == NULL)
5228 return -EINVAL; 5228 return -EINVAL;
5229 else { 5229 else {
5230 mddev->new_layout = info->layout; 5230 mddev->new_layout = info->layout;
5231 rv = mddev->pers->reconfig(mddev); 5231 rv = mddev->pers->check_reshape(mddev);
5232 if (rv) 5232 if (rv)
5233 mddev->new_layout = mddev->layout; 5233 mddev->new_layout = mddev->layout;
5234 return rv; 5234 return rv;
@@ -6731,7 +6731,8 @@ void md_check_recovery(mddev_t *mddev)
6731 */ 6731 */
6732 6732
6733 if (mddev->reshape_position != MaxSector) { 6733 if (mddev->reshape_position != MaxSector) {
6734 if (mddev->pers->check_reshape(mddev) != 0) 6734 if (mddev->pers->check_reshape == NULL ||
6735 mddev->pers->check_reshape(mddev) != 0)
6735 /* Cannot proceed */ 6736 /* Cannot proceed */
6736 goto unlock; 6737 goto unlock;
6737 set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); 6738 set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);