From patchwork Tue May 23 23:48:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B5386037F for ; Tue, 23 May 2017 23:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA1228854 for ; Tue, 23 May 2017 23:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 433E42885E; Tue, 23 May 2017 23:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B87C28854 for ; Tue, 23 May 2017 23:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968832AbdEWXtc (ORCPT ); Tue, 23 May 2017 19:49:32 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:5730 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765540AbdEWXtJ (ORCPT ); Tue, 23 May 2017 19:49:09 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19876930" Received: from mail-bn3nam01lp0178.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.178]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:07 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PR7xsKFvYPL4HjNomtq6zJSfGPDliifsEr3igL6mmzg=; b=OeRAev/NlPY2ZZC/Bj9FhjlH/23xuV2NNTShXfD172rBLmGPuf6+MndA0TR+J+wTk08+AlQtGazJckuzZ2a9Q9jMl7PQFU+Kj3vNynMIuF5YI8ZnVqFVdwhUKSBTQPYL6LW2p0I/Va6AqXEoxxNWhctvNp3/FzTHcMepkOixgtc= Received: from CY4PR04CA0031.namprd04.prod.outlook.com (10.172.133.17) by CY4PR04MB0359.namprd04.prod.outlook.com (10.173.188.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Tue, 23 May 2017 23:49:06 +0000 Received: from BN3NAM04FT006.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::208) by CY4PR04CA0031.outlook.office365.com (2603:10b6:903:c6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Tue, 23 May 2017 23:49:06 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN3NAM04FT006.mail.protection.outlook.com (10.152.92.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 23:49:04 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) by (Symantec Messaging Gateway) with SMTP id A9.D1.45291.E6AC4295; Tue, 23 May 2017 16:49:03 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:59 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-fe-5924ca6e1ec0 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 9D.F2.18148.A6AC4295; Tue, 23 May 2017 16:48:58 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Juergen Gross , "Christoph Hellwig" , Hannes Reinecke , David Disseldorp , Subject: [PATCH 16/33] xen/scsiback: Replace a waitqueue and a counter by a completion Date: Tue, 23 May 2017 16:48:37 -0700 Message-ID: <20170523234854.21452-17-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523234854.21452-1-bart.vanassche@sandisk.com> References: <20170523234854.21452-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsXCddJ5kW7+KZVIgz1zeS2+/p/OYrHgzV42 i5WrjzJZzLlpZNG2+gyjRevSt0wW37dMZnJg97i//QiTx+EPV1g8dt9sYPNYv+Uqi8fm09Ue nzfJBbBFcdmkpOZklqUW6dslcGW8fXyOvaCbv2LF6XmsDYwPeLoYOTkkBEwk2iZ/Ze1i5OIQ EjjAKPF2yjsmCGcbo8SqN6sZYarOnelggUhsZJS4s/gdWIJNwEji2/uZLCC2iICOxKy7L9hB ipgF/jBKHHnXAVYkLBAmsfHwOaCxHBwsAqoSj49pgIR5BRwkPuy7wAqxQF7i7JadzCA2J1B8 5Z5tzCDlQgL2Epe/K4OMlBBYxSqxpnUjE0SvoMTJmU/A9jILSEgcfPECrFdIQF3i5JL5TBMY hWYhKZ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efront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39850400002)(39860400002)(39400400002)(39450400003)(39840400002)(2980300002)(438002)(189002)(199003)(9170700003)(36756003)(77096006)(106466001)(305945005)(2906002)(189998001)(356003)(86362001)(53936002)(33646002)(50986999)(1076002)(76176999)(54906002)(110136004)(4326008)(38730400002)(47776003)(8676002)(81166006)(5003940100001)(478600001)(2950100002)(6666003)(6916009)(72206003)(48376002)(8936002)(50466002)(5660300001)(50226002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR04MB0359; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT006; 1:jSL3eSkOa7NX75xA+7tk7tgedI5CVfljOMIIam2Snt6zJPkhYS/LeUPKE40rzJgBKcmYWoVASJ05WUdZEcfK6yNKu525em24QaYMNteUJ7iCBoVRj93eMLYV8SEn1zO7fccRCOUCXRcSoC2pQWwN08dHG4Cy+0H86HlKMjIIeKd7T1ElxrKkvFnE7+i7GnDtbW06KbAWHAiZr8HuA0pvhCHVZG4XiAQL1RhZPExSVq82vZGnMcfHGz328lUYJRV1jvz5t8PCDk7O++zh0CQgAEt3K/pPE8yh/g9mChT+BO923myV+C9QLse47AUxb/5IJGbR503cMl8bWQa2OjXl8jeELFGAy+3rezSZo9aFLvloDb5o+mJVMfT7mbi1MSuXanFU6TaahQAwbgX7jGFpxYe5gXzlgsI6HEfZb/Y7WkGCz5afgbmZ/udMMhXv7nf9X4gMxfai+Mghj+yp9oIe4InxXR4kDM/0hrA+YB9h9dPZftuWw8oc4joTeWns3L6LhePpiOe1n5Zji94ooJLFCjgvaOgbaXocBYYEqEoAZXU= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR04MB0359: X-MS-Office365-Filtering-Correlation-Id: b5b4f0b1-a668-4e64-5d40-08d4a2364c0a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:CY4PR04MB0359; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0359; 3:48IS/mBbo/mtaJeGYOuj54SGblA3X1yILnCVhGRIV0j70/zDHGrbvjH27r1PzJMU/1kIxVr+GP88DSPRTAb62YTFwkT735d2gcU7lmn1g6amcnaNRg2jq8cY3X4aOnfetadzFRtY2HJ7HPYnMrrrD1Joq8LYHV19Yboo9Ji7wqFfkJCBVWKrW83VuhdTfspg6EvNPehEUtmza/++n9WIb8Vm38wm1QYxfDHRvyRl8yHIs1nZalUxFSitcdTQ4pZgPo67DrkxlX8FRu9JHzA937PL7qsVJsCavfIPhF+wWiWtUx1lhddLbK5/zG5/SG5vrIlLNSBOQAAu7N09uWQ6te401H+s7rAfkgnp8dJgVummPOgDVhcHj2Vc3txB4+eQ3wVUbxJaaWzewxc6dpzoSx77si5dL5NhPLrMq//kGaJzkfKNcDM4Ny2CFsiHFXzV47r/uRwOgeESMyPBUsIrcS0QI2anohMQCfvcr1qi2LGiSg9TLhNrDZ893PEQpIb8 X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0359; 25:AYQTEvM0Tm6e6npn24hjYYFvhFwduF+Y+PgZ9gISYPYtbK2NoCVxBBY3vG6+jtmXp6AzJMa7z/zBEDtwgYt4Q23mG89cZULKwVJKfESDa3bcLfqdVztzSDQtEg6sXoe6fX7Px/PJ9PZkWiKq8zwZpP6ElNM0FEYwBBtKH7aFD+K4hfhgQ3lIyGWqwLf6tPa4oJtmITcHs6cky5XazWowFKqcQP1M5H0sJY9YJcY7MrmwugfGlFdsGiaZkp4WC6gmvEloH2rfzXRscVtQOSXo4nwhKyhm48ufl63KyyWKlkYPwuiV8raQLKPNtWQP4DifgJQ7qDGRu0InEDwWytW5w9b7v+oLHqyCm3/gJ/k0t1k+kW3KkRTG2b+aM1QCc8/xYPHxqcBvBlZq6hSXSgyMW2SfwdegDc+7bpWM/p/nEi1pCkpeBKusSQVEbY7Qco8j5weNmfvFCYDl0Oy3JOJe4mwb1mKtIlT8xPBgsxEWbcQ=; 31:i5uzTEK+rH6o6GLi0DKTeOpDsFX4cb3ApvzbRxVq1+Z3TYFlC927/j9XCzVduabLHqNHpt43wL653ZEHwAZ3onwX+JRO7K9c/eKwTT/CyflpVW4uP+5U1UVTc0wP2Uk4TpFgpJeKeC5uVmK+tNebUxRTJ/Lpq5LvQpbc07vdTXxxdiQ+jwdM6tMvLgF9W/7Y38eNR5Wj+u8uaU23tmWy47ZKB10ZTW6h+U5HBXO9wj7dVmD304SqbowKOdARCDOxFXn9cVUNMqMLw+LxlletErHYIfr1VbxosrU334BiBH0= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0359; 20:g+oNSLckncLiKAVVPJBqkRDzUZZVt3qSvlS7SRCGuyBGI/rQlHyt/91opHOvYZ69VMQAOYDrLR5n7uowlWPG7GS48GXAyCtluGXrdHOI7IYFliUWY3HL2131iFyKYLxHTCCNGMvyNevdf1sFYC7HfM+bMdsaZumT7AE0jPi81BIeciWAa8PPrDYvDHwdA9FJJvNfbs50HbskOhv3/Tf7lJVjTOxIbHcT2Re/ozsnkIljBI0Xb8I2NgrK/NG2CwsKT/SvkU8srPrDWIig1MFg3ANaI59MBMJPb2Oxpvax58kLaFzTA8J3+RwWMNjjZQXCLYPJxwRvjNtnQAiwGXh2s7Mdz6lX6sawM6o7dBqSqapjY4OwWLb+CWYxexP68mn4oLTzPTWW97JP8+0Lks46hluV2Qei5LdW1LkxQsbmt7hleKWvEUagXPh1D04gkw2EMGTU3RCO0fuAVKlj4zx7cXMSwDvPO58dK7ra6DQCqvWDmf9sOrlwrhm9A7W5ByIl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13018025)(5005006)(13016025)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(6072148); SRVR:CY4PR04MB0359; BCL:0; PCL:0; RULEID:; SRVR:CY4PR04MB0359; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0359; 4:QUYGeBCuChAu77XCjsccdR+0fvYnBjWHqSJHH9fbJn/dbXBrVFfiqLFpzSifHe+3rmhtSIHYtWef6Uy7MPBbh6kASrpUuZ/7t4llwEmpzElJzB3RKKivAlQL3NFbkhWNj4+CC9uehKUU0abC0FOURUHO/KfsQTSRK6fEH27oou9GUrv4zCIS+6ZevAW0H71XqEEzEnKgCzG2Q5zMBTMGt3evHLQjsmkhTBS+EcbuQDkOJ5+T39pBZulHa+4K1xYtbHoObRsRWe6JmmV5KwRp/H7/4USM4NAOnvxgeD8kI1BIigDVuokV1ah1pEjAA7tMbeRhaGsijNch4jWaDBi5X+MndKsbM4hAerYTUUgUZbsGMZZYGeNQctp9amzfweihR7OiYFcmJi8vsRhcK/T7CFuFjD+dD2ehdc1PCB/puFFc1wJQ4bB7AKXr1anGNWZ+2h2f9Dhxx+l8Jxdd6MyEK6iuIjdhM3tiSVm5p61ptO1Ws7tMjKXwmbR7I+uG5vW4PnpDYNtCtuZFzI8vJ40d1hMHuxJAv1DY6lMelUXdLu4jp6qLC9Khxub0ryzUDgMsu5fbdYAE9XCIaq3Jn1aQCiq8J9VhBFwtOXlq5lrOnuQtJhaDvQyj1aXCtQ2Q/P1NkHt1bRSlq42NUNNs475+qA1zFoLJFdTSVZC+UG0UFiGgE3e5tssf+DvlNXI4yLO9yf0UDwXe/Gf4V/lza1otqUYaaB1kWg8E3oWL6X57tRq/0v7urBKzZg9l3w4gFbJuTwhgliuLxH3sqxW/755I6ELVRs51l82k6n1cbb77YQSJb3qbysXQ/KJbuB3/r87bsUM7yq8pQ0AguK9N64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T6l8zJvLj8GxxQttXKAkruD0Wh+7LpwfizWWHBUtX5Z6klgVIrZ5sdg/p8ZuyaBSkyG9TkVvQIonJ4yKWnG/SBgjPJY/yHhdFt0sUDDrwwOC4olcwlWQUHbtE3GRfDoxmJjPL4uw==; 24:sSZv5pQyAT77+euKxQrKkvn92r4rdAvjMv5FNcFVbHK+f6B7jSPRUKNq0qtubiVz++RE4cPfYrGzCT9OEhGvJENeHjIy1dtUUk2MQ7REKEw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0359; 7:JaujOvkrxdDYTWiAl0gKtBunnooheNoOpBxD5LQZTR6W+eIglZ6g+5N6miTpX4FdrKTD10GyNYJTpldGWTGfDnDm7QEG7CcrTPSlUQkYycSInSt9D0GbWiFAn+zudrtEdPLWIpB1yXTg/+uKi1UQia+3dPg6ZQkOuX+Eby4hSNcRAUKlpS90ZnvFqDi1iY8u5StPu/GWCTL35B/YVgOarfUsv+aScx0Ocv+gCRukHaX6jJvMxVqJzmFFKufuFXxrIdZmKQBoM7rRivnLtA16srrciimz2GXVH5SzIzeeAqAZgwAJqn38b4npdJAr5MXPt71VbZXwLtmKLCU9qqGABg==; 20:md9n3/NNFroIqZPUANDwIF4buX/Q2QxgJAZVlw40qwLWzXIQkJxVM3yxJ7fzcUKr5sysbMz7w+qsS/E+tvDuiCMIM19S070TKoUsyIGumtHvM8h+SwnBtMMXxwlvWP9BE4Fg15mCW8MEa/uk4lXnlPvK0w8t84aZb/8LwOoQSHk= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:04.7357 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0359 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch simplifies the implementation of the scsiback driver but does not change its behavior. Signed-off-by: Bart Van Assche Cc: Juergen Gross Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: David Disseldorp Cc: xen-devel@lists.xenproject.org Reviewed-by: Juergen Gross --- drivers/xen/xen-scsiback.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 980f32817305..4cb33a0916a8 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -135,8 +135,7 @@ struct vscsibk_pend { struct se_cmd se_cmd; - atomic_t tmr_complete; - wait_queue_head_t tmr_wait; + struct completion tmr_done; }; #define VSCSI_DEFAULT_SESSION_TAGS 128 @@ -600,7 +599,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, u64 unpacked_lun = pending_req->v2p->lun; int rc, err = FAILED; - init_waitqueue_head(&pending_req->tmr_wait); + init_completion(&pending_req->tmr_done); rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess, &pending_req->sense_buffer[0], @@ -609,8 +608,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, if (rc) goto err; - wait_event(pending_req->tmr_wait, - atomic_read(&pending_req->tmr_complete)); + wait_for_completion(&pending_req->tmr_done); err = (se_cmd->se_tmr_req->response == TMR_FUNCTION_COMPLETE) ? SUCCESS : FAILED; @@ -1443,8 +1441,7 @@ static void scsiback_queue_tm_rsp(struct se_cmd *se_cmd) struct vscsibk_pend *pending_req = container_of(se_cmd, struct vscsibk_pend, se_cmd); - atomic_set(&pending_req->tmr_complete, 1); - wake_up(&pending_req->tmr_wait); + complete(&pending_req->tmr_done); } static void scsiback_aborted_task(struct se_cmd *se_cmd)