From patchwork Tue Apr 25 20:53:52 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: 9699757 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 0D00560245 for ; Tue, 25 Apr 2017 20:54:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F074628484 for ; Tue, 25 Apr 2017 20:54:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4EE52848F; Tue, 25 Apr 2017 20:54:15 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 4878028484 for ; Tue, 25 Apr 2017 20:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1954554AbdDYUyO (ORCPT ); Tue, 25 Apr 2017 16:54:14 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:38602 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1954552AbdDYUyL (ORCPT ); Tue, 25 Apr 2017 16:54:11 -0400 X-IronPort-AV: E=Sophos;i="5.37,251,1488816000"; d="scan'208";a="115585850" Received: from mail-co1nam03lp0016.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.16]) by ob1.hgst.iphmx.com with ESMTP; 26 Apr 2017 04:54:09 +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=LOg7endBNxm0ZyYESORNoShcqjJluqeFkqI48gbYHU0=; b=ecB1/9XMwusbT8iaJHn25jkGepcFfBIdCZ03EGxFsaGMsX+Da0mgWkptbKFfhDi1GS/olXd9PbE/2fzwxu7ogFNKtWYs1CvNxF6Z0rq012bzfht0FMQbvq/B483SUIjzvYk0TIvS0Br7vsBEld5+pOyqfAGsdGolOdXlvo6J8jk= Received: from CO2PR04CA0109.namprd04.prod.outlook.com (10.165.95.11) by BLUPR04MB884.namprd04.prod.outlook.com (10.141.204.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Tue, 25 Apr 2017 20:54:07 +0000 Received: from SN1NAM04FT005.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::203) by CO2PR04CA0109.outlook.office365.com (2603:10b6:104:7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12 via Frontend Transport; Tue, 25 Apr 2017 20:54:06 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; HansenPartnership.com; dkim=none (message not signed) header.d=none; HansenPartnership.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 SN1NAM04FT005.mail.protection.outlook.com (10.152.88.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Tue, 25 Apr 2017 20:54:00 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id ED.7F.29323.467BFF85; Tue, 25 Apr 2017 13:53:59 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 25 Apr 2017 13:53:56 -0700 X-AuditID: 0ac94369-1d7ff7000000728b-d8-58ffb764ae26 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id BB.8A.18148.467BFF85; Tue, 25 Apr 2017 13:53:56 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Bart Van Assche , Israel Rukshin , "Max Gurtovoy" , Hannes Reinecke , Song Liu Subject: [PATCH v5 2/4] Introduce scsi_execute_async() Date: Tue, 25 Apr 2017 13:53:52 -0700 Message-ID: <20170425205354.21181-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170425205354.21181-1-bart.vanassche@sandisk.com> References: <20170425205354.21181-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsXCddJ5kW769v8RBn+buSz2LJrEZHFj8VoW i439HBbd13ewWSw//o/J4vSjA+wWPw+fYXZg95jY/I7dY9qkU2wez6YfZvL4+PQWi8fm09Ue nzfJBbBFcdmkpOZklqUW6dslcGVc+HKRseClekXL82eMDYy3FLoYOTkkBEwkTu09xtrFyMUh JLCUSaLzcgMThLODUWJF21N2mKodWz+zQCQ2Mkp8aZnGCJJgEzCS+PZ+JguILSJQKHFpWwcj SBGzwH1GiePHLgGN4uAQFjCT6NvvA1LDIqAqMWvrdrB6XgF7iXPPXjFBLJCXOLtlJzOIzSng IHFuxjk2EFsIqObAjV1gF0kIrGKVuL9n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ME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39840400002)(39860400002)(39450400003)(39850400002)(39410400002)(2980300002)(438002)(199003)(189002)(9170700003)(47776003)(5660300001)(106466001)(8936002)(189998001)(86362001)(575784001)(305945005)(50226002)(1076002)(33646002)(5003940100001)(81166006)(54906002)(6666003)(53936002)(356003)(50466002)(48376002)(8676002)(2950100002)(2906002)(77096006)(76176999)(4326008)(38730400002)(36756003)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB884; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT005; 1:92EeIza5SQrdtmtY8iD368TNS9R4vJFCSW/h4xMsgEOJhsaWYJpJnC0GJIWPZetaZsehljKfguKK7DvXlEqSbqdUKZ5WFe1G7qdpbZnhSGeRegaiPISRJ7HNKzI0gGSNirm5UZNdxBwrWLnOxohRGdLtq6QIRLMSnsSoltQGAgk/fxA7LD0s8Zf5VuhFJqdMxL5wmpZQjITm8NkNMD4t2WFbPhM0x99VVGQ2CgJo1CgjrajwvK91fQl55EL5/BCKG/BP+i51CBJzdTobSxyxI6F9EJwqFt+ctBOmInMkexQCgvKeJ37t+MGpVkIunn+faoJ0aXeaEqB7p0s1k+wxzdZc2/kzMA7MBp//dKIj3lHm+lqsT9KcsPVjwxEMbfEIZjUZEe9IEWiUTF2D6XaUCdSSfDammUrmtLNjihhOJH0wdZeyFK3A5Qpp42SWWNVMiwdDHezZHLxfjv/ay7kad4Y1LnufjFUahDQdZ4KA/TKUoKaaPjbdjOImMR22pFbEbp6tcerBJCBdPn/MZpCHtlrxnFmRDJ9KCIPxzHP86eWnIA9Fx4im12lnMuccRQc7 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f8d12d4-99b0-46ec-9869-08d48c1d34a5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BLUPR04MB884; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB884; 3:v6+MOIQ1CgSQ2IPeIam72Tw6T9esVgxVcJtEJcZYdUQzvmlsDZ2O9mKEz8ZvCVnhjeddISCka14yR6gSQ7I7ny1qeAlv/SNvWHOOJF58LwSpBqV5T105E4AvaZl0ZNU+u4+XGSi67dfWJ7gj81SQyMXgeUAbbKOwJkvbjBYCVEZdF43noYRRG1Ridm9aWI+nRAqLgGHsHOXymEvh6Hc9xWTilR83wiKx5fcJf3+z3aUQhKATGETCW9MZmMjThFZ8zH6iTNJ1rVgfAYoeKgPyKQJ6ZTtMfVf3uyQjEPV0cwqWnoRhCudaW+bODRpETwlPNbYupAjjSwEYV0qtoooCNxzuIFWrleLgMw06xHL3bTO9QZy7Jgh1zoAdftm9cKYfyGYTR49kvNtoG7nsyIBvDBrSDmdfLsQHpNmnJA7J9rlESOj8PLzQVoi0uZAiTteLKBjxzvXNpU9LfeZfPLu/vP2ZUbYD0gJHANJETujVsphX+r1bSRAP0ZyKi8aeGJek X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB884; 25:7BjZfLDxcoeERDAQJVUOEsIitR0ACcPy97shoHVkt64LwuZdvwFFpH+yQuVB4BH9Kt6g7gtza1GgIXRMqhU/2oJ4Zy9QnK2aIOzkK4iOf3ydxmbiS+1Hw7Hnmy4GQZgDJX6GdAyHNsjmuvNKxQd2houe1ShOMOQrZFw7fLCZsasg4dRvUafZXV8Z4oSePwpqFzxEhknd0n8UuLQia8aLwxBe9D8Ja11bE8M68pw6qzwj8EmTSjweGSopykSdjiiPbOcr9c/6DZFhV2ULRkthIq6MFbgiwnIoRbs/CRrDo1bPOTrhUeDkYuhayxtdQNSk7DntbeVngrVMLpDd280UBMdEfBbqfwDEC3PKA43FHYMRpzmJoAELjmeCIhBPHq/UFchiTLwmepKl25apBNlqpWXuQWAteKlmkUNKHFro42q1aW3j5RoCxKJw709NwchF5x4AzWtn1AZwDXL4gYZpJA==; 31:QqXs4vhA0TTmcophYbe/8aGugyq93f4LLLIFVbro6ZhPw9hFZZUzxy9SEB9UcB9U0om0FeTUPsDRVatp8E4v/Cw9jL+XCaQ6+rCFl9F2on8/cN7bHCpywoLL22jNzkgjsgFTGm3xYDtKfvsS+jdFnBMlimHtNSoUHb2yyyvDYrItfu9S6oimJrWOjjLjV4ilKkKDxYOvs40CIqMZ9WOD1h6i2mXRfKv9pKUQLTzeJnv7A/EU+d9sW27Rxq+WNgAXHwQjmFpeG+W3WoGYjDn8QMsYWp6yZk71AugiTbOigdc= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB884; 20:F+HxCJMHN322GmTR2QuSTR1B/ITgVX0YtUUf4Wn3bngeJBsBuJJbWiAs5tF2wtqKqlZvmWazfGB9olDpl5mslMG08jqXUwRIY1TBfV6mL6KAwVdrOvvhdC0Pq5koKV13uGYG2XERD9Lw7oncKt1/TL0KEg7m4uAQMIj1NFg2Z44HUsTVOoiVV9eha8mcXjR8uiHWBcWha4HDuaHnJsd9kjUNyPxgeqobX1aqnaSrWf8VOHGR9spxiNEwr6MmqTylqJViRZUKs6D6zo4fcBXti+LIcpLDxWqZK3THxmj7bjE65keibGE/nXTpKBP5kMgIiA/KilyF6qO87sApTR2ohqawGShhKgLqltcNlhGDq9fWfqz13oE9cuygPA3ySikPojdV7Hh44jwZoUIDLBiIQPkr0jdmZR7ArA9kHRhI9dQMU4sujjvwuTC0iR7JyNModSTQ2xllg+9z+EqUv2xNkSxclMD9DkL6pGFMmvDcCy/jGgh3GLRZZV/giS4HLT3g X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:BLUPR04MB884; BCL:0; PCL:0; RULEID:; SRVR:BLUPR04MB884; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB884; 4:cQ6K6CpdgMk7m3+bDI0ixlvre86XrC5AuOyolYBGOD9gZRvXiDPCjP3+ozdwHnRNtzTteCdye4RCitjRy1n5IJgdDJwnK1FSlIGz00G7RdAOjNoNGlyj3WBMShItWRU1N4GK2hBoNvupUu+ys8ythrMj1veixgXgisS/v58qMrbLBRzfmL6Naoe6pdhC03tEuhBVaPA3X4iNZjA3fomATbrUEIGPMs8r0IVoQr0InngVs5JQGqy5odhsHQCnkE92ZO52raLc7C+u7kyxKnkgqRl3eU3OT31oy0UgLPME1yk01tDkd7JgvELvSFZMKBfHqBorzIix85Aqynqq+yfqUR7Wj7osgcUSugS3xkG0oFBQhCFmJCAbrRKh8qdIfzglYfQVDRT0TsRiRfEa2sfCGpYR9KNapByBTBOXNR6S80nr9MyPKxghOXUpMAnJQGyXMs4f2TMF7Tj6IENdAxS46rghxfRblkGWZwnNpcIogLkFa8/EnP6omskYGbhvNAaP1kdlyReEjJbzADuYFwJHR5DfndDEOmekM560jqZBB1ljvLLgZ4O6tmJ2nXVA+i7ytIXFhuxfmm9PeKrMwW7p0PUuEu4Swn2uWsa7l8YthYnuS38tR79LsrSQICI+UAqfiSm7p8IVmMPGoJpRyv/HNQZju8VorOPrHaIutRV53f8EMbsCNk4DbpQ9Zw7XPXwmAKZPnHaC0zqdo3SHqoUSuEaGjZkRTnUOHWRuR1Ukw/fOx7kRQwjNGK2YQgoQVAMVnA3i1dl5X74gwnzMKxb9DX2KI+9RWaajUjFkbL8O0FU9xTFk8lXdcajO4rziv/TEIj2I9Ykge2P7/NcEfNJG/rqD4tzbk/udgPYDeBPemrA=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QGX32EvCsbUM/weo8JRXSl3nCtci5eJIzn4/Yf8FXVfEZMPwUZONuPDnTn0op8KK1KxDajE4z9TcE8WgQuNdQSARId7Xc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB884; 7:s5TeWVzmPQWEeIrjG5LvC/AbHBFm8tGL+/l3iIQ13bHT1BWpVkoeRsAe3IeoVyRamzQOPnlwkGausGKAqGFBHwRBmdci8U75EopI0NjPsorfYFGDyNeDWj3IipiDFiBPO2dJZThL86FGKhvNoGAKltfktrDq2RTsH/F8TCSUdip1QYx2sfwls33AfXlXwJdX+cGiD/8jwT1q1/iBPV1E36JMy4OnIyNg/RiIAi0Dl7pquJ4uyfgJjPJuIuYud6MG9o5ILubo7T89vxHClEbUMpJ2UEyMEqt10Sz49Y9+3HoMoA7aJGy6yXY0LZ4HcB8uYxh/r/kaqy29/h/CSx1rNA==; 20:Umw/oiMjiRn8YWvsmogk6FzVShAnZca3UiTSzzGqYLlUiG0FYRUsAvJKVCi6sUdwVfZmdILHt9I81Onb4JK441T+N6HUh9xgJfu08hPLTWdMPrdohlfubM+DFpN97SSnEkdWpxx8eLiGEBxw7KeJiTWuufX9t0P+Y0TTmKx5TZo= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2017 20:54:00.2984 (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: BLUPR04MB884 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the code for submitting a SCSI command from scsi_execute() into scsi_build_rq(). Introduce scsi_execute_async(). This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Hannes Reinecke Cc: Song Liu --- drivers/scsi/scsi_lib.c | 89 +++++++++++++++++++++++++++++++++++++--------- include/scsi/scsi_device.h | 5 +++ 2 files changed, 77 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ffa6e61299a9..7f9c70fd0acd 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -213,6 +213,73 @@ void scsi_queue_insert(struct scsi_cmnd *cmd, int reason) __scsi_queue_insert(cmd, reason, 1); } +static struct request *scsi_build_rq(const struct scsi_device *sdev, + const unsigned char *cmd, int data_direction, void *buffer, + unsigned bufflen, int timeout, int retries, u64 flags, + req_flags_t rq_flags) +{ + struct request *req; + struct scsi_request *rq; + int ret; + + req = blk_get_request(sdev->request_queue, + data_direction == DMA_TO_DEVICE ? + REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, __GFP_RECLAIM); + if (IS_ERR(req)) + return req; + rq = scsi_req(req); + scsi_req_init(req); + + if (bufflen) { + ret = blk_rq_map_kern(sdev->request_queue, req, + buffer, bufflen, __GFP_RECLAIM); + if (ret) { + blk_put_request(req); + return ERR_PTR(ret); + } + } + + rq->cmd_len = COMMAND_SIZE(cmd[0]); + memcpy(rq->cmd, cmd, rq->cmd_len); + req->retries = retries; + req->timeout = timeout; + req->cmd_flags |= flags; + req->rq_flags |= rq_flags | RQF_QUIET | RQF_PREEMPT; + + return req; +} + +/** + * scsi_execute_async - insert a SCSI request + * @sdev: scsi device + * @disk: gendisk pointer that will be stored in the request structure + * @cmd: scsi command + * @data_direction: data direction + * @buffer: data buffer + * @bufflen: length of buffer + * @timeout: request timeout in seconds + * @retries: number of times to retry request + * @flags: flags for ->cmd_flags + * @rq_flags: flags for ->rq_flags + * @done: I/O completion function + */ +int scsi_execute_async(const struct scsi_device *sdev, struct gendisk *disk, + const unsigned char *cmd, int data_direction, void *buffer, + unsigned bufflen, int timeout, int retries, u64 flags, + req_flags_t rq_flags, rq_end_io_fn *done) +{ + struct request *req; + + req = scsi_build_rq(sdev, cmd, data_direction, buffer, bufflen, timeout, + retries, flags, rq_flags); + if (IS_ERR(req)) + return PTR_ERR(req); + /* head injection *required* here otherwise quiesce won't work */ + blk_execute_rq_nowait(req->q, disk, req, 1, done); + + return 0; +} +EXPORT_SYMBOL(scsi_execute_async); /** * scsi_execute - insert request and wait for the result @@ -242,24 +309,12 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, struct scsi_request *rq; int ret = DRIVER_ERROR << 24; - req = blk_get_request(sdev->request_queue, - data_direction == DMA_TO_DEVICE ? - REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, __GFP_RECLAIM); + req = scsi_build_rq(sdev, cmd, data_direction, buffer, bufflen, + timeout, retries, flags, rq_flags); if (IS_ERR(req)) - return ret; - rq = scsi_req(req); - scsi_req_init(req); + return PTR_ERR(req); - if (bufflen && blk_rq_map_kern(sdev->request_queue, req, - buffer, bufflen, __GFP_RECLAIM)) - goto out; - - rq->cmd_len = COMMAND_SIZE(cmd[0]); - memcpy(rq->cmd, cmd, rq->cmd_len); - req->retries = retries; - req->timeout = timeout; - req->cmd_flags |= flags; - req->rq_flags |= rq_flags | RQF_QUIET | RQF_PREEMPT; + rq = scsi_req(req); /* * head injection *required* here otherwise quiesce won't work @@ -282,7 +337,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, if (sshdr) scsi_normalize_sense(rq->sense, rq->sense_len, sshdr); ret = req->errors; - out: + blk_put_request(req); return ret; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 080c7ce9bae8..38c73ee0a929 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -408,6 +408,11 @@ extern const char *scsi_device_state_name(enum scsi_device_state); extern int scsi_is_sdev_device(const struct device *); extern int scsi_is_target_device(const struct device *); extern void scsi_sanitize_inquiry_string(unsigned char *s, int len); +extern int scsi_execute_async(const struct scsi_device *sdev, + struct gendisk *disk, const unsigned char *cmd, + int data_direction, void *buffer, unsigned bufflen, + int timeout, int retries, u64 flags, req_flags_t rq_flags, + rq_end_io_fn *done); extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, unsigned char *sense, struct scsi_sense_hdr *sshdr,