From patchwork Wed Feb 15 00:26:00 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: 9573089 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 9899A6045F for ; Wed, 15 Feb 2017 00:26:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BE6E28418 for ; Wed, 15 Feb 2017 00:26:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80EF72843D; Wed, 15 Feb 2017 00:26:52 +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,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 EAC0C28418 for ; Wed, 15 Feb 2017 00:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404AbdBOA0u (ORCPT ); Tue, 14 Feb 2017 19:26:50 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:61609 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbdBOA0s (ORCPT ); Tue, 14 Feb 2017 19:26:48 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867879" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 08:26:21 +0800 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 1D.E4.57638.D20A3A85; Tue, 14 Feb 2017 16:26:21 -0800 (PST) Received: from milsmgip11.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, 14 Feb 2017 16:26:16 -0800 X-AuditID: 0ac94369-26dee9800001e126-78-58a3a02d29ee Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id BF.7D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche Subject: [PATCH v6 21/33] target: Remove the SCF_SEND_DELAYED_TAS command flag Date: Tue, 14 Feb 2017 16:26:00 -0800 Message-ID: <20170215002612.14566-22-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170215002612.14566-1-bart.vanassche@sandisk.com> References: <20170215002612.14566-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsXCddJ5ka7ugsURBt++yVq0rT7DaNG69C2T A5PH/e1HmDw+b5ILYIrisklJzcksSy3St0vgymjt7WIu+CBfsfbUYaYGxqnSXYycHBICJhJb 5r1m62Lk4hASWMokcWPPBihnG6PEt61TmGGqTv58zwKR2Mgo8WxXIytIgk3ASOLb+5ksILYI kL26ZxkTiM0sECTxb9c+sLiwgJ/E6it7wepZBFQlrrVfAYvzCjhI9M94ywqxQF5iV9tFMJsT KD5jx0mgGg6gZfYSj85Yg+yVELjPInHz6nw2iF5BiZMzn7BA7JKQOPjiBdihQgLqEieXzGea wCg0C0nZLCRlCxiZVjGK5WbmFOempxYYmuoVJ+alZBZn6yXn525ihIRs5g7Gu0+8DzEKcDAq 8fCekF0cIcSaWFZcmXuIUYKDWUmEl60eKMSbklhZlVqUH19UmpNafIhRmoNFSZz3nMzUCCGB 9MSS1OzU1ILUIpgsEwenVAOj8ja1JMXqHWlLby1XPXH15YUpXQJ/W+o21zotDKqx97AWv+NV aBhe33Hh6DSxB00/t+kLv2m9+5fTcs6Upy1Tgo5c/904YUWpoc/zUs2Xpfstjm13LzgYoqv4 fqrb1bo3Sd92p0z8vPLnl8ozv2eb7Fy4OclqmcH1W/07zXrnmDmcsPlxlVNskxJLcUaioRZz UXEiABMDCotVAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg6+H1S0O/mxjtGhbfYbR onXpWyYHZo/7248weUxbc57J4/MmuQDmKC6blNSczLLUIn27BK6M1t4u5oIP8hVrTx1mamCc Kt3FyMkhIWAicfLne5YuRi4OIYH1jBLftvxlAUmwCRhJfHs/E8wWAbJX9yxjArGZBQIkjs1q AbOFBfwkVl/ZywpiswioSlxrvwJWzyvgIPFz2kVmiAXyErvaLoLVcALFZ+w4CVTDAbTMXuLR GesJjNwLGBlWMYrlZuYU56ZnFhga6hUn5qVkFmfrJefnbmKEeDpyB+PTieaHGJk4OKUaGBUs FEOKKxz/tx7l3+9vrPaB6b9x9qnv9scKon1mGT/yir6z5uCdqck5C2cVSJZdeSNwrjkmWPxO gsYf1/jvtw53BKxd8dnSMvrb4sUTv2gamUxUCOX32xppeCb7mUzLZ6dJSw6u/Zk0W5LvaGqj SN/Kva1flRp2JbDPPBhWZZ4w9XY549rfLUosxRmJhlrMRcWJAJLdqGakAQAA MIME-Version: 1.0 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 previous patch removed the code that sets this flag. Hence also remove the code that tests this flag and the flag itself. Signed-off-by: Bart Van Assche Reviewed-by: Andy Grover Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- drivers/target/target_core_transport.c | 48 +++++----------------------------- include/target/target_core_base.h | 1 - include/target/target_core_fabric.h | 2 +- 3 files changed, 8 insertions(+), 43 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 41e40cebcd98..6995d0093d16 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1900,22 +1900,18 @@ static bool target_handle_task_attr(struct se_cmd *cmd) return true; } -static int __transport_check_aborted_status(struct se_cmd *, int); - void target_execute_cmd(struct se_cmd *cmd) { + if (transport_check_aborted_status(cmd, 1)) { + target_handle_abort(cmd); + return; + } + /* * Determine if frontend context caller is requesting the stopping of * this command for frontend exceptions. - * - * If the received CDB has aleady been aborted stop processing it here. */ spin_lock_irq(&cmd->t_state_lock); - if (__transport_check_aborted_status(cmd, 1)) { - spin_unlock_irq(&cmd->t_state_lock); - target_handle_abort(cmd); - return; - } if (cmd->transport_state & CMD_T_STOP) { pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08llx\n", __func__, __LINE__, cmd->tag); @@ -3108,39 +3104,9 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd, } EXPORT_SYMBOL(transport_send_check_condition_and_sense); -static int __transport_check_aborted_status(struct se_cmd *cmd, int send_status) - __releases(&cmd->t_state_lock) - __acquires(&cmd->t_state_lock) -{ - assert_spin_locked(&cmd->t_state_lock); - WARN_ON_ONCE(!irqs_disabled()); - - if (!(cmd->transport_state & CMD_T_ABORTED)) - return 0; - /* - * If cmd has been aborted but either no status is to be sent or it has - * already been sent, just return - */ - if (!send_status || !(cmd->se_cmd_flags & SCF_SEND_DELAYED_TAS)) { - if (send_status) - cmd->se_cmd_flags |= SCF_SEND_DELAYED_TAS; - return 1; - } - - cmd->se_cmd_flags &= ~SCF_SEND_DELAYED_TAS; - - return 1; -} - -int transport_check_aborted_status(struct se_cmd *cmd, int send_status) +bool transport_check_aborted_status(struct se_cmd *cmd, int send_status) { - int ret; - - spin_lock_irq(&cmd->t_state_lock); - ret = __transport_check_aborted_status(cmd, send_status); - spin_unlock_irq(&cmd->t_state_lock); - - return ret; + return cmd->transport_state & CMD_T_ABORTED; } EXPORT_SYMBOL(transport_check_aborted_status); diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index d06f2678f988..2324e03ba61e 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -130,7 +130,6 @@ enum se_cmd_flags_table { SCF_SENT_CHECK_CONDITION = 0x00000800, SCF_OVERFLOW_BIT = 0x00001000, SCF_UNDERFLOW_BIT = 0x00002000, - SCF_SEND_DELAYED_TAS = 0x00004000, SCF_ALUA_NON_OPTIMIZED = 0x00008000, SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000, SCF_COMPARE_AND_WRITE = 0x00080000, diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index d7dd1427fe0d..5b7af743fe79 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -153,7 +153,7 @@ void target_execute_cmd(struct se_cmd *cmd); int transport_generic_free_cmd(struct se_cmd *, int); bool transport_wait_for_tasks(struct se_cmd *); -int transport_check_aborted_status(struct se_cmd *, int); +bool transport_check_aborted_status(struct se_cmd *, int); int transport_send_check_condition_and_sense(struct se_cmd *, sense_reason_t, int); int target_get_sess_cmd(struct se_cmd *, bool);