Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp402188pxb; Thu, 21 Oct 2021 01:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYSj1pS4zJqMxIWxgLTbgV+DAX/r0nIu4Uh8qTl21hdWaT/kBacnirmE1hB8qzNWzI7K/D X-Received: by 2002:a63:d806:: with SMTP id b6mr3379650pgh.395.1634805635832; Thu, 21 Oct 2021 01:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634805635; cv=none; d=google.com; s=arc-20160816; b=hlm199KzPZiMwM2U0i24eXWnan6PS311qFEqQq3dqx0hI9d0v4JqJFfhtg6SeTQNYS a2jfNDG27km7FLAIQXIRYSDnQzKCvrDn+7e+y3tV2EvKux3dGQOYqx6sx+LS0XnbvzVk DKZB+VREoWENPksVmIG61zTpuRZvLOA3v+rvLLCPQ3Cw/6iRFOQXh4/l4bthKrZqNpFe QYRBWqjp88rFdyAL3oNpkSTx6Ql71SMILOTD58vMcT7HvwoNklvfAAVk8CvCfez/cJuO x9NMNPow0NO5rO0E5yi/huFJ83ssR43kiUDhIQ/4zy58kGw7iyzHDIGAaZSEGbxxgcdX YnzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=S4QsdL80gWdN0oH1ddYGrW4a7AMy2kDsAslvCr6PQu8=; b=hkz/MApzoVAXqp2cwEsUqLC6QA7XDGJ2q8hM/1J5Ojad4BnOgGpJJxCrAGq6lR/EGL A5S685U3Yp0CsXmD87feM6uZdGHQLbdToTuJLpVGrhmQ6oTVsC/BKmA9ORZT/ZLQfgiy vaJseWHsJm2feKKuWdW6pL4Jy8BWZIJC9eXA9B7uREsFnFR1XFAho9xbtaNseJ5uVzwp QFupmVhddeEQxhOnmAaqwE+njPO+qPiwClrlCdZVFfNDWdLzkFfysiNxrUXsvhfLAwcK q+NSYPzB5KYmDihKs/gpvoC74TXqq9PPo66o5pb8J6UgkwreQ7csoiuxlXn2hxqYfqRj 3YfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si6320500pgv.520.2021.10.21.01.40.21; Thu, 21 Oct 2021 01:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhJUIlY (ORCPT + 99 others); Thu, 21 Oct 2021 04:41:24 -0400 Received: from mx22.baidu.com ([220.181.50.185]:43076 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231473AbhJUIlV (ORCPT ); Thu, 21 Oct 2021 04:41:21 -0400 Received: from BJHW-Mail-Ex12.internal.baidu.com (unknown [10.127.64.35]) by Forcepoint Email with ESMTPS id 7B66FF519D69360D465D; Thu, 21 Oct 2021 16:39:04 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex12.internal.baidu.com (10.127.64.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:39:04 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:39:03 +0800 From: Cai Huoqing To: CC: Alasdair Kergon , Mike Snitzer , , Subject: [PATCH] dm crypt: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 16:39:01 +0800 Message-ID: <20211021083902.1918-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-MAIL-EX04.internal.baidu.com (10.127.64.14) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex12_2021-10-21 16:39:04:526 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/md/dm-crypt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 1ee3da2bfd0b..d4ae31558826 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -3363,14 +3363,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; -- 2.25.1