summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorCai Huoqing <caihuoqing@baidu.com>2021-10-21 16:39:01 +0800
committerMike Snitzer <snitzer@redhat.com>2021-11-01 13:28:49 -0400
commita5217c11058cc56cdfa1523facd8a4e6d7e88795 (patch)
tree2729fe28bc7fa3ed5e22cdad4e2fe439995d548b /drivers/md/dm-crypt.c
parent30495e688d9dc757bae4cfc7dc3e15a79b48917f (diff)
downloadlinux-a5217c11058cc56cdfa1523facd8a4e6d7e88795.tar.gz
linux-a5217c11058cc56cdfa1523facd8a4e6d7e88795.tar.bz2
linux-a5217c11058cc56cdfa1523facd8a4e6d7e88795.zip
dm crypt: Make use of the helper macro kthread_run()
Replace kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 5c56d2b66d52..39946ebbd9d6 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -3362,14 +3362,13 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
spin_lock_init(&cc->write_thread_lock);
cc->write_tree = RB_ROOT;
- cc->write_thread = kthread_create(dmcrypt_write, cc, "dmcrypt_write/%s", devname);
+ cc->write_thread = kthread_run(dmcrypt_write, cc, "dmcrypt_write/%s", devname);
if (IS_ERR(cc->write_thread)) {
ret = PTR_ERR(cc->write_thread);
cc->write_thread = NULL;
ti->error = "Couldn't spawn write thread";
goto bad;
}
- wake_up_process(cc->write_thread);
ti->num_flush_bios = 1;
ti->limit_swap_bios = true;