From afa0f557cb15176570a18fb2a093e348a793afd4 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 15 Dec 2014 12:56:58 +1100 Subject: 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 --- drivers/md/md.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/md/md.c') diff --git a/drivers/md/md.c b/drivers/md/md.c index 58f140bef999..2920fd004865 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -293,8 +293,8 @@ static void md_make_request(struct request_queue *q, struct bio *bio) /* mddev_suspend makes sure no new requests are submitted * to the device, and that any requests that have been submitted * are completely handled. - * Once ->stop is called and completes, the module will be completely - * unused. + * Once mddev_detach() is called and completes, the module will be + * completely unused. */ void mddev_suspend(struct mddev *mddev) { @@ -3374,7 +3374,7 @@ level_store(struct mddev *mddev, const char *buf, size_t len) /* Looks like we have a winner */ mddev_suspend(mddev); mddev_detach(mddev); - mddev->pers->stop(mddev); + mddev->pers->free(mddev, mddev->private); if (mddev->pers->sync_request == NULL && pers->sync_request != NULL) { @@ -4940,7 +4940,7 @@ int md_run(struct mddev *mddev) } if (err) { mddev_detach(mddev); - mddev->pers->stop(mddev); + mddev->pers->free(mddev, mddev->private); module_put(mddev->pers->owner); mddev->pers = NULL; bitmap_destroy(mddev); @@ -5137,7 +5137,7 @@ static void __md_stop(struct mddev *mddev) { mddev->ready = 0; mddev_detach(mddev); - mddev->pers->stop(mddev); + mddev->pers->free(mddev, mddev->private); if (mddev->pers->sync_request && mddev->to_remove == NULL) mddev->to_remove = &md_redundancy_group; module_put(mddev->pers->owner); -- cgit v1.2.3-73-gaa49b