Skip to content

Commit a5217c1

Browse files
caihuoqing1990snitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 30495e6 commit a5217c1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/dm-crypt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,14 +3362,13 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
33623362
spin_lock_init(&cc->write_thread_lock);
33633363
cc->write_tree = RB_ROOT;
33643364

3365-
cc->write_thread = kthread_create(dmcrypt_write, cc, "dmcrypt_write/%s", devname);
3365+
cc->write_thread = kthread_run(dmcrypt_write, cc, "dmcrypt_write/%s", devname);
33663366
if (IS_ERR(cc->write_thread)) {
33673367
ret = PTR_ERR(cc->write_thread);
33683368
cc->write_thread = NULL;
33693369
ti->error = "Couldn't spawn write thread";
33703370
goto bad;
33713371
}
3372-
wake_up_process(cc->write_thread);
33733372

33743373
ti->num_flush_bios = 1;
33753374
ti->limit_swap_bios = true;

0 commit comments

Comments
 (0)