md: Unify mddev destruction paths
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 8 Jun 2018 00:52:54 +0000 (20:52 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 8 Jun 2018 14:41:17 +0000 (08:41 -0600)
commit28dec870aaf704af1421ac014f7f8abf4cac7c69
tree8eeb2a26a9b8276cbe966ff77aae106f48c21221
parent2a2a4c510b761e800098992cac61281c86527e5d
md: Unify mddev destruction paths

Previously, mddev_put() had a couple different paths for freeing a
mddev, due to the fact that the kobject wasn't initialized when the
mddev was first allocated. If we move the kobject_init() to when it's
first allocated and just use kobject_add() later, we can clean all this
up.

This also removes a hack in mddev_put() to avoid freeing biosets under a
spinlock, which involved copying biosets on the stack after the reset
bioset_init() changes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/md.c