[Nbd] [PATCH v2 4/9] nbd: Replace kthread_create with kthread_run
- To: nbd-general@lists.sourceforge.net
- Cc: Joe Perches <joe@...1529...>, Wouter Verhelst <w@...112...>, linux-kernel@...25...
- Subject: [Nbd] [PATCH v2 4/9] nbd: Replace kthread_create with kthread_run
- From: Markus Pargmann <mpa@...1897...>
- Date: Thu, 12 Mar 2015 14:36:02 +0100
- Message-id: <1426167367-32214-5-git-send-email-mpa@...1897...>
- In-reply-to: <1426167367-32214-1-git-send-email-mpa@...1897...>
- References: <1426167367-32214-1-git-send-email-mpa@...1897...>
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@...1897...>
---
drivers/block/nbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 58c2b20ad17b..c07160c25a94 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,
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);
--
2.1.4
Reply to: