diff options
author | NeilBrown <neilb@suse.de> | 2014-12-14 20:56:58 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-02-03 16:35:52 -0500 |
commit | afa0f557cb15176570a18fb2a093e348a793afd4 (patch) | |
tree | 7ae3f6a37ae3e6bcfbea51faadad924df8020095 /drivers/md/multipath.c | |
parent | 5aa61f427e4979be733e4847b9199ff9cc48a47e (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/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 9fe34453835b..ac3ede2bd00e 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -399,7 +399,7 @@ static int multipath_run (struct mddev *mddev) | |||
399 | /* | 399 | /* |
400 | * copy the already verified devices into our private MULTIPATH | 400 | * copy the already verified devices into our private MULTIPATH |
401 | * bookkeeping area. [whatever we allocate in multipath_run(), | 401 | * bookkeeping area. [whatever we allocate in multipath_run(), |
402 | * should be freed in multipath_stop()] | 402 | * should be freed in multipath_free()] |
403 | */ | 403 | */ |
404 | 404 | ||
405 | conf = kzalloc(sizeof(struct mpconf), GFP_KERNEL); | 405 | conf = kzalloc(sizeof(struct mpconf), GFP_KERNEL); |
@@ -500,15 +500,13 @@ out: | |||
500 | return -EIO; | 500 | return -EIO; |
501 | } | 501 | } |
502 | 502 | ||
503 | static int multipath_stop (struct mddev *mddev) | 503 | static void multipath_free(struct mddev *mddev, void *priv) |
504 | { | 504 | { |
505 | struct mpconf *conf = mddev->private; | 505 | struct mpconf *conf = priv; |
506 | 506 | ||
507 | mempool_destroy(conf->pool); | 507 | mempool_destroy(conf->pool); |
508 | kfree(conf->multipaths); | 508 | kfree(conf->multipaths); |
509 | kfree(conf); | 509 | kfree(conf); |
510 | mddev->private = NULL; | ||
511 | return 0; | ||
512 | } | 510 | } |
513 | 511 | ||
514 | static struct md_personality multipath_personality = | 512 | static struct md_personality multipath_personality = |
@@ -518,7 +516,7 @@ static struct md_personality multipath_personality = | |||
518 | .owner = THIS_MODULE, | 516 | .owner = THIS_MODULE, |
519 | .make_request = multipath_make_request, | 517 | .make_request = multipath_make_request, |
520 | .run = multipath_run, | 518 | .run = multipath_run, |
521 | .stop = multipath_stop, | 519 | .free = multipath_free, |
522 | .status = multipath_status, | 520 | .status = multipath_status, |
523 | .error_handler = multipath_error, | 521 | .error_handler = multipath_error, |
524 | .hot_add_disk = multipath_add_disk, | 522 | .hot_add_disk = multipath_add_disk, |