x86/smpboot: Init apic mapping before usage
[cascardo/linux.git] / drivers / md / dm.c
index be35258..ef7bf1d 100644 (file)
@@ -1423,8 +1423,6 @@ static void cleanup_mapped_device(struct mapped_device *md)
        if (md->bs)
                bioset_free(md->bs);
 
-       cleanup_srcu_struct(&md->io_barrier);
-
        if (md->disk) {
                spin_lock(&_minor_lock);
                md->disk->private_data = NULL;
@@ -1436,6 +1434,8 @@ static void cleanup_mapped_device(struct mapped_device *md)
        if (md->queue)
                blk_cleanup_queue(md->queue);
 
+       cleanup_srcu_struct(&md->io_barrier);
+
        if (md->bdev) {
                bdput(md->bdev);
                md->bdev = NULL;
@@ -1891,7 +1891,7 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
        spin_unlock_irq(q->queue_lock);
 
        if (dm_request_based(md) && md->kworker_task)
-               flush_kthread_worker(&md->kworker);
+               kthread_flush_worker(&md->kworker);
 
        /*
         * Take suspend_lock so that presuspend and postsuspend methods
@@ -2147,7 +2147,7 @@ static int __dm_suspend(struct mapped_device *md, struct dm_table *map,
        if (dm_request_based(md)) {
                dm_stop_queue(md->queue);
                if (md->kworker_task)
-                       flush_kthread_worker(&md->kworker);
+                       kthread_flush_worker(&md->kworker);
        }
 
        flush_workqueue(md->wq);