aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-12-14 20:56:58 -0500
committerNeilBrown <neilb@suse.de>2015-02-03 16:35:52 -0500
commitafa0f557cb15176570a18fb2a093e348a793afd4 (patch)
tree7ae3f6a37ae3e6bcfbea51faadad924df8020095 /drivers/md/raid10.c
parent5aa61f427e4979be733e4847b9199ff9cc48a47e (diff)
md: rename ->stop to ->free
Now that the ->stop function only frees the private data, rename is accordingly. Also pass in the private pointer as an arg rather than using mddev->private. This flexibility will be useful in level_store(). Finally, don't clear ->private. It doesn't make sense to clear it seeing that isn't what we free, and it is no longer necessary to clear ->private (it was some time ago before ->to_remove was introduced). Setting ->to_remove in ->free() is a bit of a wart, but not a big problem at the moment. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 654fdae906aa..d1203cddb024 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3798,9 +3798,9 @@ out:
3798 return -EIO; 3798 return -EIO;
3799} 3799}
3800 3800
3801static int stop(struct mddev *mddev) 3801static void raid10_free(struct mddev *mddev, void *priv)
3802{ 3802{
3803 struct r10conf *conf = mddev->private; 3803 struct r10conf *conf = priv;
3804 3804
3805 if (conf->r10bio_pool) 3805 if (conf->r10bio_pool)
3806 mempool_destroy(conf->r10bio_pool); 3806 mempool_destroy(conf->r10bio_pool);
@@ -3809,8 +3809,6 @@ static int stop(struct mddev *mddev)
3809 kfree(conf->mirrors_old); 3809 kfree(conf->mirrors_old);
3810 kfree(conf->mirrors_new); 3810 kfree(conf->mirrors_new);
3811 kfree(conf); 3811 kfree(conf);
3812 mddev->private = NULL;
3813 return 0;
3814} 3812}
3815 3813
3816static void raid10_quiesce(struct mddev *mddev, int state) 3814static void raid10_quiesce(struct mddev *mddev, int state)
@@ -4692,7 +4690,7 @@ static struct md_personality raid10_personality =
4692 .owner = THIS_MODULE, 4690 .owner = THIS_MODULE,
4693 .make_request = make_request, 4691 .make_request = make_request,
4694 .run = run, 4692 .run = run,
4695 .stop = stop, 4693 .free = raid10_free,
4696 .status = status, 4694 .status = status,
4697 .error_handler = error, 4695 .error_handler = error,
4698 .hot_add_disk = raid10_add_disk, 4696 .hot_add_disk = raid10_add_disk,