From patchwork Wed Jan 25 23:36:28 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: 9538117 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 8D7486042C for ; Wed, 25 Jan 2017 23:37:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 830D827F17 for ; Wed, 25 Jan 2017 23:37:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77C6D27FBB; Wed, 25 Jan 2017 23:37:09 +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 D291E27F17 for ; Wed, 25 Jan 2017 23:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750716AbdAYXhI (ORCPT ); Wed, 25 Jan 2017 18:37:08 -0500 Received: from mail-by2nam01on0048.outbound.protection.outlook.com ([104.47.34.48]:15200 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751344AbdAYXg6 (ORCPT ); Wed, 25 Jan 2017 18:36:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zE2LP+aujYJBqUF6oer/t7SEa8wAcYI6RWJxvlk+EfA=; b=R6v1Us1VAZq57SdG3Ga4x4q1CI6umfb4Yx6v84pQlLHh1t50OiUpUsOnHRcQB+VNENZrUfp71nmlQFX0U3PPm1RQX2FU2EZwieBexvGVWPAV6SHfogu0VOZ877tSdFrfjK5/sqXBMhcLOjyUQ6jBXhIQfsLiF7G4NbKoxRS0huQ= Received: from CY1PR0201CA0031.namprd02.prod.outlook.com (10.163.30.169) by CO1PR02MB046.namprd02.prod.outlook.com (10.242.163.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 23:36:55 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::193) by CY1PR0201CA0031.outlook.office365.com (2a01:111:e400:58b9::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12 via Frontend Transport; Wed, 25 Jan 2017 23:36:55 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; 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 BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Wed, 25 Jan 2017 23:36:54 +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 99.C8.65426.5C339885; Wed, 25 Jan 2017 15:24:54 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 25 Jan 2017 15:36:49 -0800 X-AuditID: 0ac94369-b62949800001ff92-2a-588933c59b26 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id EB.35.16817.19639885; Wed, 25 Jan 2017 15:36:49 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Andy Grover" , David Disseldorp Subject: [PATCH 16/34] target: Inline transport_cmd_check_stop() Date: Wed, 25 Jan 2017 15:36:28 -0800 Message-ID: <20170125233646.2243-17-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170125233646.2243-1-bart.vanassche@sandisk.com> References: <20170125233646.2243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsXCddJ5ke4x484IgwPzmS32z3rGZPH1/3QW i5WrjzJZtC59y+TA4rH7ZgObx/t9V9k8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoErY+r+pUwF rWoVTX+3szcwrpfvYuTkkBAwkdg55zlbFyMXh5DAUiaJRRdesUA42xglbj/5xwJTtahhJRNE YiOjxM8Xl9hBEmwCRhLf3s8EKxIRMJD43XuBEaSIWaCDUWJ+zzNWkISwgINEx90jYEUsAqoS l7fOB7N5BewlOk+cZofYIC+xq+0iWD0nULz17E+wGiEBO4n1B1rBNksItLFK9D3uZoJoFpQ4 OfMJWBGzgITEwRcvmCEa1CVOLpnPNIFRaBaSsllIyhYwMq1iFMvNzCnOTU8tMDTVK07MS8ks ztZLzs/dxAgJ7swdjHefeB9iFOBgVOLhFdjSESHEmlhWXJl7iFGCg1lJhHedXGeEEG9KYmVV alF+fFFpTmrxIUZpDhYlcV63e1/ChATSE0tSs1NTC1KLYLJMHJxSDYyN7Q0bOF91JicGmuVu afas69Dy+37nXPDF+3V1Pg8PBjdFsL9N+7xuGoO3Utcm3RLXV+wmF9yOqGcU7XtVVGItbyJx pShkurdb8c6F8h4Xz0i3lc9RsV8QxFaYL6KzMWfB5D1HYs03VySmSCc/n7k36N+zeTPY+6wV D8s/Zr5X/Gvp370+TEosxRmJhlrMRcWJAENxsXVqAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTXeiWWeEQddyI4v9s54xWRz82cZo 8fX/dBaLlauPMlm0Ln3L5MDqsftmA5vH+31X2TymrTnP5LH5dLXH501yAaxRXDYpqTmZZalF +nYJXBlT9y9lKmhVq2j6u529gXG9fBcjJ4eEgInEooaVTF2MXBxCAusZJea8usgOkmATMJL4 9n4mC4gtImAg8bv3AiNIEbNAF6PEpjOnwIqEBRwkOu4eAStiEVCVuLx1PpDNwcErYC9x8mk0 xAJ5iV1tF1lBbE6gcOvZn2DlQgJ2EusPtDJNYORewMiwilEsNzOnODc9s8DQUK84MS8lszhb Lzk/dxMjJCAidzA+nWh+iJGJg1OqgXHlLR6h6I0quUnZk3f8+3Zjwc5NtkcX2wfcUlgTzqF2 YOKcp74rQsR/XwreJhU/3YjN1PclE0fMGnHGmpkNQdyCR57s3+a2c9H1kBXG0ofzj/yNbf7E fui45o/14lL6Xu7e0w2nSeUoSMZOvvnzac0s1p07JMK3qGfvNc4/6vzP/OYDwwRmLn4lluKM REMt5qLiRADrw8FvuAEAAA== MIME-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:(10009020)(6009001)(7916002)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(189002)(199003)(2950100002)(6862003)(5003940100001)(189998001)(77096006)(38730400001)(6200100001)(5660300001)(8676002)(110136003)(68736007)(54906002)(6666003)(356003)(86362001)(50226002)(626004)(305945005)(575784001)(8936002)(81166006)(33646002)(50466002)(48376002)(92566002)(36756003)(2906002)(4326007)(76176999)(50986999)(47776003)(1076002)(81156014)(2270400002)(7049001)(97736004)(69596002)(53936002)(106466001)(1691005); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB046; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD016; 1:UJpqMt3WLqYkSmua17iTI/nVpQt/zT/WVA1ps0+Jl9PVUr/c6gVn5fspwyTAEr6xj/vBB6pq7UQuHZ7KaoSw0ggIlGfiokyYvEt5hZQXzzzEJEIYQwyVH1qGpUzHbOO9r0cM7ULO79T0N3F1lhuad5foUvOfrcA0Ho2SNiHF8ufvEcrK5crdIruJcbKc7beFObZbeLh1bh0yCeFpyM/K0TzOezLPAGLUsCQB859FdYfNmi4HAeaidUHnLUbCpKOMHWEP3X9eF9AgkUSnlyl50obtKUiMGn02qWf/fv2iySpWCKp66ytVPXWeGCyjdTCTt48awfEgXMW9R0KoT9o75KJ61BSlDAjKtI3Tm39P+Vpzn2Rv+zcJ4wpJPwjrGFGU/wilgaMt9dfauMGz5RXG9/KE8wBNyGFMX4PLtBGcvCdJvGo1fXnVc5Nq7ZlZBKU3rwyXBQ4sKq/3FivYN6WcPQsltbLHSOWKgyyCGfkgCgNTbQgnJzmJSNdKqv0QnCAJ X-MS-Office365-Filtering-Correlation-Id: d322ee8f-8d68-4102-e6f4-08d4457b0bda X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CO1PR02MB046; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046; 3:Km/HFNcZWJKHrzwRVurpmt8VnPu2LEk/9QzVaS/vfB0YZ5QdyDDseCQW8013T+o5OcrKriDfkbm0ItHoLNVIz9swE5TephijtRaPSjIIpoz5cOHtdasnwnDmb7atay02HuVomeM6X9KxRPTAGFGcZU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ange-Diagnostics: 1; CO1PR02MB046; 31:tUFO7kolaRQC9Eks81GHOTl07VD3r6LAuV/wWXFV3eTuz3L8KFzgMwE7DCmWoeZluT+6N6W5j0FDl6Zo5fGEXNhOZ9ja+S6lJVjJLiOKvmR3+5QVXQ6bG+JfJXy9pyxnkEyxFtLIMu8CC2IXYzJVhTnCQ+wigqI8673nQJ40jDk5x2g8Pu4b08FtKO6M0aRQvT+/Sk764ewkcVbKoweiFuNS3RJhroPrSBuR5RRyAGpivO2kYluRbjLxyXljA45fNA84/OL5YWIZn8pzIphzWA==; 20:9sZe3rtPKgnqv8PkXJ0CJUEQawKgRFti8iviKsrwVO3vrL4YtX+RhUSmWnOdrf5eLBns3di44Bcnc11gtqlZrNgnzoZdb7u5gDOye3qY634UGWXrVN0o/RszWY2d/FoKXz387TbzbtMOhBxINCJPX2xzdcQfSW4SMjC60te7bgGer3P+j4F+9ayso01djE2yJ6cX6v7ivYHFrHV5/C5QqbuompsEs1Ye9mMk//LJ3cnhppvr/KVKW9vx6gWjD6so4xESyEFG6HBoGGgBrKWWximk70Wf3qNHBjYH4c4GOczHKSumZIp62Q3qSHthDT4CSSRF++ucJ6KGiiGMpRu7YEIQ0J/RSJz154cFwZZBIRB87AEbF7XLAziQGDaNeWV4rhsi3G4eZs5rq2myaxlRm64G+7FFirMvi7IyxMplps6GogQsaXxgsFa5NRYWDSN85pc7f+QkevHEVkYY8YeF7PQpJoiUcIUlBnChAcBS6RD3gajp+f2ahsqkmizanS4y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:CO1PR02MB046; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB046; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046;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4KCS/BG9NAwrKbbtmyBZ7g5EqPDvJLzuCxJhKqCix3Wvg?= =?us-ascii?Q?oig6CQ6mhJHJaOnIvJny1nJaE6Ku9efgBOV7CwOskSi2WKbQZDydT077Vhh7?= =?us-ascii?Q?14lbNcS2CzcLMlHLM=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046; 6:SxCPrByyfNTXAGDZdzRsC32NPN1NOfXUV95hLbhHnSarne8/CK5ITLo/z8lTANJxs6WTk6ZW5417jQFiUIie11QlcRSinJqPEyn5+KeQkzSZQ7+GKbxJdnYjiHtqvcU8cf8I9pJ09ZeytjCu9rnOxClfK8xlM7aWH9QHnPHV68nTTzrvtBM8W+XlG2cGDNsX6NcMQbJnZEMHSncevL187Trlmo5wPiiaTx0emHNRpkPIbn90tSMjoH6y5eG3QgRvLfdk3l6foxcA1ShwdCLSWgwRR5yJUDjnVGQPlJDFYBbF9nu2xtUPJmVDg4WlrBEQW6dk7wdHFG+WHRiAmQ/YekgvIfULkUWKjxilwPNzEqPQOGnx3Jkr8yI8DUTuezI9jvWoiP3WHNnfJ99R6NHWgFBevBSJucqDkQLuc66/5FN2yPCT+V/WBn8e9HJxNB/mSkl9OnYUx9WiE+Vy9DtB5g==; 5:vN+sYL5FsYu8nooySyHb7EqKusSVPRklz6QBsw1ULaSj4dXF0igmzQI+CSlRQTYnRNkbCYSFmwqxpNxav4Rd4AavQDG9XxZN5FkI3F+/IYWq7n63dDJ+onTsirfQgeVRLsbxAgBqDbsnsLt7T0zdcA==; 24:PUpnuWVPKCjafG7ES61fhoDHPfxxg3Zrn6Z0TKKGE2BzTvFxMgvO2Dkpz1AbOrdW0z4oRgXpNjpZVlXMepQXN1mkc+sUsJ5LQyWGLKQ9YFg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046; 7:0GCriblukvL2C+v4f4xqx1i8mXziR/KpPgho/I2kagtjKVW02Vs8rMGf9UKC0/X/YlxQ5ebKFPszDzb+M2eeoDttJNKvNiEvJXJaLvUWyfWRlZ/sysfMsiwz7SWDmBNIfiN+UcPeezv0DesviyFEgwp1z63EWpT2OfjtbB6T7Oj92gKi1vflnWTfAFHmKlpU2+2ZTW1c5xPxfQtFvgmlIazmn/7sT4xuYSNpRBqHuWd9hIeRDxLgu7ZVKI5TokWJB5cvgu+/Fxq9GBWFNSt87C2Fgjmyu/2tWvH9fDL947kYUBuh8kMkxZZ79vpRfvsqJQktvSa2ZsNqUhdJ/AuomuXXf3WNFHYgsXjFCkyWcD+79JSCAu/3VW1CA2dEUuh02DfHqj/ge2DxrwGUXnVEMYHU8jP6P0heTY5sCKF05Dei2fkNzcx5PXO9tWOFv3oiFq9sK11rokySqlsukyMHBg== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:54.3747 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB046 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 The function transport_cmd_check_stop() has two callers. These callers invoke this function as follows: * transport_cmd_check_stop(cmd, true, false) * transport_cmd_check_stop(cmd, false, true) Hence inline this function into its callers. This patch does not change any functionality but improves source code readability. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp Reviewed-by: Hannes Reinecke Reviewed-by: Bryant G. Ly --- drivers/target/target_core_transport.c | 68 +++++++++++++++++----------------- include/target/target_core_fabric.h | 2 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index df23883869fb..5821ac0c349d 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -588,24 +588,18 @@ static void target_remove_from_state_list(struct se_cmd *cmd) spin_unlock_irqrestore(&dev->execute_task_lock, flags); } -static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, - bool write_pending) +static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) { unsigned long flags; - if (remove_from_lists) { - target_remove_from_state_list(cmd); + target_remove_from_state_list(cmd); - /* - * Clear struct se_cmd->se_lun before the handoff to FE. - */ - cmd->se_lun = NULL; - } + /* + * Clear struct se_cmd->se_lun before the handoff to FE. + */ + cmd->se_lun = NULL; spin_lock_irqsave(&cmd->t_state_lock, flags); - if (write_pending) - cmd->t_state = TRANSPORT_WRITE_PENDING; - /* * Determine if frontend context caller is requesting the stopping of * this command for frontend exceptions. @@ -618,30 +612,17 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, } else { cmd->transport_state &= ~CMD_T_ACTIVE; } - - if (remove_from_lists) { - /* - * Some fabric modules like tcm_loop can release - * their internally allocated I/O reference now and - * struct se_cmd now. - * - * Fabric modules are expected to return '1' here if the - * se_cmd being passed is released at this point, - * or zero if not being released. - */ - if (cmd->se_tfo->check_stop_free != NULL) { - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - return cmd->se_tfo->check_stop_free(cmd); - } - } - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - return 0; -} -static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) -{ - return transport_cmd_check_stop(cmd, true, false); + /* + * Some fabric modules like tcm_loop can release their internally + * allocated I/O reference and struct se_cmd now. + * + * Fabric modules are expected to return '1' here if the se_cmd being + * passed is released at this point, or zero if not being released. + */ + return cmd->se_tfo->check_stop_free ? cmd->se_tfo->check_stop_free(cmd) + : 0; } static void transport_lun_remove_cmd(struct se_cmd *cmd) @@ -2375,6 +2356,7 @@ EXPORT_SYMBOL(target_alloc_sgl); sense_reason_t transport_generic_new_cmd(struct se_cmd *cmd) { + unsigned long flags; int ret = 0; bool zero_flag = !(cmd->se_cmd_flags & SCF_SCSI_DATA_CDB); @@ -2440,8 +2422,24 @@ transport_generic_new_cmd(struct se_cmd *cmd) target_execute_cmd(cmd); return 0; } - if (transport_cmd_check_stop(cmd, false, true)) + + spin_lock_irqsave(&cmd->t_state_lock, flags); + cmd->t_state = TRANSPORT_WRITE_PENDING; + /* + * Determine if frontend context caller is requesting the stopping of + * this command for frontend exceptions. + */ + if (cmd->transport_state & CMD_T_STOP) { + pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08llx\n", + __func__, __LINE__, cmd->tag); + + spin_unlock_irqrestore(&cmd->t_state_lock, flags); + + complete_all(&cmd->t_transport_stop_comp); return 0; + } + cmd->transport_state &= ~CMD_T_ACTIVE; + spin_unlock_irqrestore(&cmd->t_state_lock, flags); ret = cmd->se_tfo->write_pending(cmd); if (ret == -EAGAIN || ret == -ENOMEM) diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 358041bad1da..d7dd1427fe0d 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -47,7 +47,7 @@ struct target_core_fabric_ops { u32 (*tpg_get_inst_index)(struct se_portal_group *); /* * Optional to release struct se_cmd and fabric dependent allocated - * I/O descriptor in transport_cmd_check_stop(). + * I/O descriptor after command execution has finished. * * Returning 1 will signal a descriptor has been released. * Returning 0 will signal a descriptor has not been released.