diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2015-04-02 04:11:36 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-04-02 14:39:19 -0400 |
commit | d06df60b9460838553d37d01049d04c43a36f396 (patch) | |
tree | c2d32308b3c315f36e1da70c486fd547ad740eb9 /drivers/block | |
parent | 13e71d69cc7444b7d840bab581dbe831e440fb62 (diff) |
nbd: Replace kthread_create with kthread_run
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 1aaabcc2af92..5bc221693304 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -728,13 +728,13 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, | |||
728 | else | 728 | else |
729 | blk_queue_flush(nbd->disk->queue, 0); | 729 | blk_queue_flush(nbd->disk->queue, 0); |
730 | 730 | ||
731 | thread = kthread_create(nbd_thread, nbd, "%s", | 731 | thread = kthread_run(nbd_thread, nbd, "%s", |
732 | nbd->disk->disk_name); | 732 | nbd->disk->disk_name); |
733 | if (IS_ERR(thread)) { | 733 | if (IS_ERR(thread)) { |
734 | mutex_lock(&nbd->tx_lock); | 734 | mutex_lock(&nbd->tx_lock); |
735 | return PTR_ERR(thread); | 735 | return PTR_ERR(thread); |
736 | } | 736 | } |
737 | wake_up_process(thread); | 737 | |
738 | error = nbd_do_it(nbd); | 738 | error = nbd_do_it(nbd); |
739 | kthread_stop(thread); | 739 | kthread_stop(thread); |
740 | 740 | ||