nbd: Replace kthread_create with kthread_run
authorMarkus Pargmann <mpa@pengutronix.de>
Thu, 2 Apr 2015 08:11:36 +0000 (10:11 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:39:19 +0000 (12:39 -0600)
kthread_run includes the wake_up_process() call, so instead of
kthread_create() followed by wake_up_process() we can use this macro.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c

index 1aaabcc2af9218a3cffe53ef7c4320b93434777b..5bc221693304c56630b0b8e837776509326988bc 100644 (file)
@@ -728,13 +728,13 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
                else
                        blk_queue_flush(nbd->disk->queue, 0);
 
-               thread = kthread_create(nbd_thread, nbd, "%s",
-                                       nbd->disk->disk_name);
+               thread = kthread_run(nbd_thread, nbd, "%s",
+                                    nbd->disk->disk_name);
                if (IS_ERR(thread)) {
                        mutex_lock(&nbd->tx_lock);
                        return PTR_ERR(thread);
                }
-               wake_up_process(thread);
+
                error = nbd_do_it(nbd);
                kthread_stop(thread);