• Kent Overstreet's avatar
    md: Unify mddev destruction paths · 28dec870
    Kent Overstreet authored
    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: default avatarKent Overstreet <kent.overstreet@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    28dec870
md.c 244 KB