From patchwork Tue May 23 23:48:44 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: 9744455 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 5950F6037F for ; Tue, 23 May 2017 23:49:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BB4828818 for ; Tue, 23 May 2017 23:49:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4052F28854; Tue, 23 May 2017 23:49:42 +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 81F2828818 for ; Tue, 23 May 2017 23:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936643AbdEWXtk (ORCPT ); Tue, 23 May 2017 19:49:40 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:56777 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966425AbdEWXtT (ORCPT ); Tue, 23 May 2017 19:49:19 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19876952" Received: from mail-cys01nam02lp0049.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.49]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:08 +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=pIIrig9LPMf9Zai3gAYzfi5G3ygtrmHdlQsFHtvoMwc=; b=EF5dTEs6242FmiQRJXKX1objQz3e3dccWaCowpAU8SGsYhsAvFYLWxBFPKHCKrRWH7Q1K7cmacnzEp3/R9RXLzBYAG48CC9J/PBi1ipc8KojnNI8mqyhzCEkNDxeAg601pCd2IfJ+m7hRKoLb3LoweePbCFFJlpgKzFBqpUhVds= Received: from MWHPR04CA0035.namprd04.prod.outlook.com (10.172.163.21) by DM5PR04MB0363.namprd04.prod.outlook.com (10.173.169.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 23 May 2017 23:49:07 +0000 Received: from BN3NAM04FT036.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::204) by MWHPR04CA0035.outlook.office365.com (2603:10b6:300:ee::21) 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.225) smtp.mailfrom=sandisk.com; linux-iscsi.org; dkim=none (message not signed) header.d=none;linux-iscsi.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN3NAM04FT036.mail.protection.outlook.com (10.152.93.184) 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:05 +0000 Received: from MILHUBIP03.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 40.74.19026.07AC4295; Tue, 23 May 2017 16:49:04 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:58 -0700 X-AuditID: 0ac94371-41ba798000004a52-11-5924ca70b1a8 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 61.03.18148.A6AC4295; Tue, 23 May 2017 16:48:58 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Hannes Reinecke , "Christoph Hellwig" , Andy Grover , David Disseldorp Subject: [PATCH 23/33] target/iscsi: Simplify iscsit_free_cmd() Date: Tue, 23 May 2017 16:48:44 -0700 Message-ID: <20170523234854.21452-24-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+NgFnrBLMWRmVeSWpSXmKPExsXCddJ5kW7BKZVIg9sXVSz2z3rGZPH1/3QW iwVv9rJZrFx9lMmibfUZRovWpW+ZHNg87m8/wuSx+2YDm8f7fVfZPNZvucrisfl0tcfnTXIB bFFcNimpOZllqUX6dglcGfePyBR8FKpoWjCbsYFxG38XIweHhICJxJG/KV2MXBxCAkuZJJbf n80E4exglHjXu4G9i5ETrOjY8ZdQiY2MEh1/V7GAJNgEjCS+vZ8JZosI6EjMuvuCHaSIWeA2 o8Sax6vZQBLCAvYSvZ/3MYHYLAKqEtuanzCD2LwCDhJ7Xj5jgdggL3F2y06wOCdQfOWebcwg 5wkB9V7+rgwyU0JgEavE+/ZTjBC9ghInZz4B62UWkJA4+OIFWK+QgLrEySXzmSYwCs1CUjYL SdkCRqZVjGK5mTnFuempBYYmesWJeSmZxdl6yfm5mxgh4V+4g/H1be9DjAIcjEo8vAkOKpFC rIllxZW5hxglOJiVRHiXbwAK8aYkVlalFuXHF5XmpBYfYpTmYFES582SnRohJJCeWJKanZpa kFoEk2Xi4JRqYGyaaDptxowjU5baREyfekT7OdNr9x1b+P2YP3+fZO2mUb3i4kvBL2GVH7xN jm6/Ei00+57SWveOIxImJlWlDRcPHU4q7JLL+8BpnftMbsEqA0bxYBebsMlcX4o/SC+XFPbM ivnVt/qnqNAi5+mrF9ts0877vn2zz++fayIVg+zuq93VPniu7qASS3FGoqEWc1FxIgC5aA4u ewIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJMWRmVeSWpSXmKPExsXCtZGTTTfrlEqkwb9Xxhb7Zz1jsjj4s43R 4uv/6SwWC97sZbNYufook0Xb6jOMFq1L3zI5sHvc336EyWP3zQY2j/f7rrJ5TFtznslj/Zar LB6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJVx/4hMwUehiqYFsxkbGLfxdzFyckgImEgcO/6S qYuRi0NIYD2jxPZTDewgCTYBI4lv72eygNgiAjoSs+6+YAcpYha4yyhxpvsTG0hCWMBeovfz PiYQm0VAVWJb8xNmEJtXwEFib+sRZogN8hJnt+wEszmB4iv3bAOyOYC22Utc/q48gZF7ASPD Kkax3Myc4tz0zAJDI73ixLyUzOJsveT83E2MkLCJ2sF4faL5IUYmDk6pBsZq2az72ovuOcX9 O7X90uNtqzqFzh4pbfzv82pBa9DXqU8XqusXZOTxeHOFuP1TrDvK1uO+cePdvzYnv4ixs8t+ N+DmbdpT4nXOpiHkSPH9vYxfGZ5/e7e9YvYT3ayLxuILDOTYSlqdHi48ysUz/fmU0HNFsjX2 nqE+R8p8pvHPX2Nm9+Tx9D4lluKMREMt5qLiRAB5EOWXywEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39840400002)(39860400002)(39400400002)(39450400003)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(1076002)(106466001)(110136004)(33646002)(86362001)(38730400002)(76176999)(50986999)(47776003)(81166006)(2950100002)(50466002)(8676002)(4326008)(5660300001)(5003940100001)(356003)(6916009)(6666003)(77096006)(48376002)(50226002)(8936002)(305945005)(53936002)(72206003)(478600001)(189998001)(2906002)(36756003)(54906002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0363; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT036; 1:0N67N9Re71lQ7mLmiMkXu1e7VviI/VO/ahbDR+TPU0IHo2Oyq/HQ322v+kM3kpgeK2APcb0yy7XgED/6gc6HJ6k2AfGEVxyzXNr77J9ZhghExazmwD7HI5C9l+/QGmDn3jfwtAvCP20Mp49jTlZ60u/elQ1uGsiE3xzbhAAUjhRbDA/ZxdpAOXdAt4sTtisZYY3jkFBoympRlHcfURX309BqoFZ+uUg5RkY6x++JzTgMkjoP+1XWMDdmcR48ftz3yN6hkeHAjJ74itXLJ11E0HdAV/A357dSEz41hP/7l3grWZRmymxOwHVbzkkD5hljUk3BCfRJ8mKHNEtIwKc+WdQImljMvuWt+qRGWQTTrtWxllLErghYUSATDvzJwJRm9I8Z4yT4KceKfW47QtNLMKxx4FgAGlqwvuin6No9M9qa84hcsSS0+ok2SdB+4bunaxExb46WB2ChgGnbYiJEkC7yOS0850J4UDi+3/+T0gVSM4V55WjuNWPZWgevSUTc X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0363: X-MS-Office365-Filtering-Correlation-Id: b01a6855-a3a4-4882-70c9-08d4a2364c55 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM5PR04MB0363; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 3:ExySWnBq4pLX9S/jWpxeZ1lcQcb15GjuwPtm6YqYTCVmH6xU8HYfUFuU3ImF8rRKmwWPqTiJhZQC7Uhdzrgo+DuYyghlixeD03qwn7ZChaK0d6ThHGioEZzkMAUNuhLekhNPr6IE1YnjFBIyUO23IeqtAJawpDiq4WhVzs9Bvrozcyh7qKWZoaFow+s8J+GLNPmesw9BeszNcdK6/GGiZI9fi1o3uelYPTK0MFwcJpfr2b3dPhquiOClGjrnf8fCaWFFuhzvvnGScX/UZF6DGxILKavfDPn1XrlRlPjMUvYAdclzSJShjGpHeIxLnS5KVinQOE0PhVFDYcBhFfOhSAvzvSC67nC0M1cIaWBx5f20lAkAdAmMoo18jQC9YZJTPcsKx0LqfMIaszP8xcu4Iz9qFu7DZ5FA0f9RqLEImL4LH5HEboIMrAofqQJo1Ru9yT5R1/p7bgLYMusSs3yFMmTtk1b4HiuJKY7p0MdEFNKHoyjgoWyeiftDGd6Pj4Y/ X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 25:qF1faDYQwGuf2/ypxfwH5zkSk0jbDeV8pE/PqI6uiwWWQqsm6JlhkqdbB295ferFnZX+dViWYQ+1HeLa0hW5WQq0tnO2/EcqxTV5kEE50jt4nl7sEOg4/VDPiqPbusD8vo4FY/AojbYNi6yFhxJe6mjRWYgQq/zmspVOLIBvl5WuQh6fcEcBlHY1XADo+Nro+2QoirunfgibVuLY/0LsNFVJsjA47hQiFtjKME07QRdCMcQ0gU6GaydxNny/ZfPtMzUJ++feySHQw3PaxGUhROjaTpinf3V6SDxZjBpRofxzI/vsdxKVyJvmtmKz9v9esY6HOzi0GQlHnDyRyOtCjbHey6ZsSuscEXmCF10lbEVmrC1twPZ1FsNd/vHq3GFV3xkvSjUXpE/9w/SchZ68S2o2Dt2doKCYrnms8QNIuRQwnS4bhI42oj4qZ8vp3BB7kxDF8pwWwYlwGeYqdx9CkRaJ1tbbVuSysOAQNQK7guY=; 31:12rmMDnFjX0MRtytrAIFJr/DpTbCgfkPA+TWw2J9+wj2jdqSKbcAlneFSWgm5d8TgYaZA9A9nDvLPdfCqi2MFz77UH+mAQz7JqH+57G8a5y3lOY1dfqckkhMgM/d8Qj+s+jnzG0+S06lbnsXczanEB8MEDmqNRosDYW3TaD8dG1IFMZmStdHjEeQskFK4KVOO/Rbfia0jpjbBy4kL7nyEuE594i7cmNNbXZofa0pBq6tZfXtcSiNLN4VUu6JMxM7dUDICoUbOC/4AIxkyq9K0Q== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 20:hKa/r8K8JZnuNLHwf6yeAZfbIviQpT4o03NWJSidpdSisJUV6fTECsKfXOq5ln+ZbPsDXYPEYVcey8pKMPE8GfE7tnvfUeZwyd/dhzO2gcYo63aLjuDQlBFNuBQ/6EnunXYtkBqjYACMShyyWasRSaYsJnUeZHhxS0W4+IQXkQFKWaDkTGSQoF9LvUFcXn3tMDQUXJVazlPbN5xRTulGINi5aJbcfSM6xsftd0TzZA5ZLTxY3jvjhD3L3N8o3dDRT2/1zeRpbTLkShaKaG/65S5EfOS0+/eCZQYboEakL3EEtRSpXFTknOzGBOmS/1r8n4pDy3Sp1bq642XAA04QwEmlghaH6pKnMIueTrxgvwBhk38hCHknS/+f5ZXhHNhbLYojmCx/OnNN63ha6rDDgOsgGCUWiJ6SyWEDX+rR8t/rmtRP2+YEteoEPAQZt3iZFQ+jlPw0a9vl5y7esuwXoLMPqxxHUewBXLTwpq5o+TKY280MCQYIbiChJ9gh4nYN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(10201501046)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:DM5PR04MB0363; BCL:0; PCL:0; RULEID:; SRVR:DM5PR04MB0363; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 4:hqWjrcrMN6rV5txtWl80ik7JPIDpiCRDGX+s3HGyS9iPrlyBOTSdu8UdCfJFhhTF2CfO/GGPdCs7+YB8J4nnhPT5Tx4Esyvu3moqTSgOjlEEX5mY7iT1gSQCXvkCFO0svB6BDp8tgDraCSPOctemfhsUMjcNCrR69fuRKPbM6fhyVt/KQteKDuiF79sPypMPsb8KFENo0eHWS5kA/6FwWLw0vgeU8XjvOONezPvusatUpCoclPCskrTCsU+nnIM0enp5iAtoLa9sjyynM3czFhi/9C+UR2Gr9pmpfSC5OYSW5bGDJ8zghk2SDAJPBfH09d8cMULrz6E+5ssFH1MIN3rE1kE2jvwlAzujpghcPbH+tsqJResQ4LtRE2mWdk6m5lV3RIq53ww6b3ZFXWWtwwFirszm5f9k8QX+5viNP9DsAnBUyRw70mZn5pqsL/6ACqo7jXsekOyAT0g72J2GAmZ8OujqQaBuE2N9Npa1emicQOIDbZa+3inityd9x9PFSPr5mwiqsMjt/LnqYrnNOlrLBA4V652GRDLzEpYKz/zaAtGkpDUHsye7GMQboO23Pp+MevgCZ5PkqsxGtXOT8anJKHgw/ehBZ1yhGxZB1inmDeHu659UF/L7Z8bjI///ck8navslD9t2LqHTujVVk5DPixlxlXpbK4g2H7Fd4YpkYfc3ODHN+n207BvkNkeB5UUxJ1bStyCJ7lIhjrNGlBRRZNawWGjRPoYdUtyqE154gps36r1knpCcEOm04JonA7N/q2TdmjuT8X2ZNqtOQjpSzEs5Y7dPEfF667ziia5MCsb50cmkHzJ/wzxrSb25K9ZClSYI0T05oCvUtCKu85vdulmB3h9NDRZ/N0StBd+AzSGRZm0IQZi8LWCWCdMG X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =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Gkybisbc08J6r/Z+YqoRJLvNIVMbI8m5bU+R2V0ArpL2vDIvMV7SiGKVsFFX3L3tZsocYG5eTGaPAQCxdh97SHcEDZS73bceO6Os= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0363; 7:ZW1Zr23cRc73qDKp1dPt2jIkwzg8f99IN0YTvk8nPMCTwRC/HdOFvya5UKBRQPgVDnYbVd4Bgmryn3b215XyF9aRGVSMtKrapX+nOtm0Z+218pqABF0Pdk4lSPlhm1yoF8DCFy1xnAl6WR0PkRMCsRnmUYOqe1t+kGzdGsrgts41GfinUTwyNCyaah2Q7J3OK0Q+XIoXHxRZoY6t8q+f6422qwtSkJAUJ6d9Y2tv2/jp1a/pdciHDeI6dZtp9ryg8KMescP4qWRPP9TNp4MRlKiAyQAbdwe91yBTHZAnClmcUoVEqsYnk1CRo0ig6BMrCJvhvLhr0jcqEl9uBr7mtQ==; 20:dKlFMJO2oaIT4hdeiB1cqKDPIwhkNXr1qcOWz5jmECJDzwJ6Q0QARTPbqWhkNMT4z+UYEz12yBJTL0QEuO6L4WnSJbPkheNVc5mvnpWUrgck3+dsxZMUudCyX+RTWcMWRVf9tetBpft6dChmZqRjl1eWJW0Fgm9AbQmFu/r12bo= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:05.3058 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR04MB0363 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 Since .se_tfo is only set if a command has been submitted to the LIO core, check .se_tfo instead of .iscsi_opcode. Since __iscsit_free_cmd() only affects SCSI commands but not TMFs, calling that function for TMFs does not change behavior. This patch does not change the behavior of iscsit_free_cmd(). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/iscsi/iscsi_target_util.c | 39 ++++---------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 41b9e7cc08b8..1e36f83b5961 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c @@ -734,49 +734,18 @@ void __iscsit_free_cmd(struct iscsi_cmd *cmd, bool check_queues) void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) { - struct se_cmd *se_cmd = NULL; + struct se_cmd *se_cmd = cmd->se_cmd.se_tfo ? &cmd->se_cmd : NULL; int rc; - /* - * Determine if a struct se_cmd is associated with - * this struct iscsi_cmd. - */ - switch (cmd->iscsi_opcode) { - case ISCSI_OP_SCSI_CMD: - /* - * Fallthrough - */ - case ISCSI_OP_SCSI_TMFUNC: - se_cmd = &cmd->se_cmd; - __iscsit_free_cmd(cmd, shutdown); + __iscsit_free_cmd(cmd, shutdown); + if (se_cmd) { rc = transport_generic_free_cmd(se_cmd, shutdown); if (!rc && shutdown && se_cmd->se_sess) { __iscsit_free_cmd(cmd, shutdown); target_put_sess_cmd(se_cmd); } - break; - case ISCSI_OP_REJECT: - /* - * Handle special case for REJECT when iscsi_add_reject*() has - * overwritten the original iscsi_opcode assignment, and the - * associated cmd->se_cmd needs to be released. - */ - if (cmd->se_cmd.se_tfo != NULL) { - se_cmd = &cmd->se_cmd; - __iscsit_free_cmd(cmd, shutdown); - - rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); - if (!rc && shutdown && se_cmd->se_sess) { - __iscsit_free_cmd(cmd, shutdown); - target_put_sess_cmd(se_cmd); - } - break; - } - /* Fall-through */ - default: - __iscsit_free_cmd(cmd, shutdown); + } else { iscsit_release_cmd(cmd); - break; } } EXPORT_SYMBOL(iscsit_free_cmd);