diff options
author | NeilBrown <neilb@suse.de> | 2014-12-15 12:56:58 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-02-04 08:35:52 +1100 |
commit | afa0f557cb15176570a18fb2a093e348a793afd4 (patch) | |
tree | 7ae3f6a37ae3e6bcfbea51faadad924df8020095 /drivers/md/raid0.c | |
parent | 5aa61f427e4979be733e4847b9199ff9cc48a47e (diff) | |
download | linux-stable-afa0f557cb15176570a18fb2a093e348a793afd4.tar.gz linux-stable-afa0f557cb15176570a18fb2a093e348a793afd4.tar.bz2 linux-stable-afa0f557cb15176570a18fb2a093e348a793afd4.zip |
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/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 01dfca94b663..a13f738a7b39 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -415,7 +415,7 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks return array_sectors; } -static int raid0_stop(struct mddev *mddev); +static void raid0_free(struct mddev *mddev, void *priv); static int raid0_run(struct mddev *mddev) { @@ -468,20 +468,18 @@ static int raid0_run(struct mddev *mddev) ret = md_integrity_register(mddev); if (ret) - raid0_stop(mddev); + raid0_free(mddev, conf); return ret; } -static int raid0_stop(struct mddev *mddev) +static void raid0_free(struct mddev *mddev, void *priv) { - struct r0conf *conf = mddev->private; + struct r0conf *conf = priv; kfree(conf->strip_zone); kfree(conf->devlist); kfree(conf); - mddev->private = NULL; - return 0; } /* @@ -715,7 +713,7 @@ static struct md_personality raid0_personality= .owner = THIS_MODULE, .make_request = raid0_make_request, .run = raid0_run, - .stop = raid0_stop, + .free = raid0_free, .status = raid0_status, .size = raid0_size, .takeover = raid0_takeover, |