From patchwork Fri Feb 10 01:28: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: 9565779 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 2180D60573 for ; Fri, 10 Feb 2017 01:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 133E228532 for ; Fri, 10 Feb 2017 01:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 081A82853A; Fri, 10 Feb 2017 01:29:38 +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 979B228548 for ; Fri, 10 Feb 2017 01:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbdBJB3e (ORCPT ); Thu, 9 Feb 2017 20:29:34 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:15691 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbdBJB31 (ORCPT ); Thu, 9 Feb 2017 20:29:27 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="82349506" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 10 Feb 2017 09:29:00 +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 FF.87.57638.C571D985; Thu, 9 Feb 2017 17:29:00 -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; Thu, 9 Feb 2017 17:28:55 -0800 X-AuditID: 0ac94369-26dee9800001e126-fd-589d175c1145 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 04.9F.11415.7571D985; Thu, 9 Feb 2017 17:28:55 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche Subject: [PATCH v5 07/22] target: Remove the SCF_SEND_DELAYED_TAS command flag Date: Thu, 9 Feb 2017 17:28:37 -0800 Message-ID: <20170210012852.15735-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210012852.15735-1-bart.vanassche@sandisk.com> References: <20170210012852.15735-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsXCddJ5kW6M+NwIg9Z3whZtq88wWrQufcvk wORxf/sRJo/Pm+QCmKK4bFJSczLLUov07RK4MqZ8uMxe0CFd0TYxvIFxiXgXIyeHhICJxJdr P9hBbCGBpUwSHxZxdDFyAdlbGSXm/X3MBlM0fesxJojERkaJM5+XMoMk2ASMJL69n8kCYosA 2at7ljGB2MwCQRL/du0DiwsL+En8uPwErJ5FQEXi+v/NQNs4OHgF7CW2b+GBmC8vsavtIiuI zSngIPFq9nVWkBIhoJIduwwgSh6zSNxYLAli8woISpyc+YQFYpOExMEXL5gh7leXOLlkPtME RqFZSMpmISlbwMi0ilEsNzOnODc9tcDQVK84MS8lszhbLzk/dxMjJFQzdzDefeJ9iFGAg1GJ h/dFzZwIIdbEsuLK3EOMEhzMSiK89/nmRgjxpiRWVqUW5ccXleakFh9ilOZgURLnPSczNUJI ID2xJDU7NbUgtQgmy8TBKdXAeOnr/kUddTerzz2692rdy9VLlaQOH8k7tPWs2b4dv0WPP73C t/2B9gdJRvPnP031bOYeunBf0OtPo0z7nsliLVq73ui+ymHvNPpwh2XDv3S7peuPee2aaLhq iv4KTaeDQn9u3zeLfWHHmFEuE3X6UeI8N09vu9QFK1WX7Vlrp7WAe2uukOBOmbtKLMUZiYZa zEXFiQBrq7MwUQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAJMWRmVeSWpSXmKPExsXCtZGTTTdcfG6EQU+bkMXBn22MFm2rzzBa tC59y+TA7HF/+xEmj2lrzjN5fN4kF8AcxWWTkpqTWZZapG+XwJUx5cNl9oIO6Yq2ieENjEvE uxg5OSQETCSmbz3G1MXIxSEksJ5RomP1e0aQBJuAkcS39zNZQGwRIHt1zzImEJtZIEDi2KwW MFtYwE/ix+UnzCA2i4CqxNRnC9lBbF4Be4lJl1tZIRbIS+xquwhmcwo4SLyafR3I5gBaZi+x Y5fBBEbuBYwMqxjFcjNzinPTMwsMDfWKE/NSMouz9ZLzczcxQvwcuYPx6UTzQ4xMHJxSDYzL bCznpkjc7F/5+5OkRaU284wvt2Orzx/cN4uzRNN+SuyqO5F7XgoZF/192TDtg73MvGs+M1a9 bt9cnNN6L+CPCNtStevKIeeXeV6t51MqzKh6MTexRUt1cmbftfnuYraFKr4rS1LYPzz3MW1c GMoTEBly4/cVIdXS33fEZQ1jpzufL9q52E+JpTgj0VCLuag4EQBFiJwqowEAAA== 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 | 36 ++-------------------------------- include/target/target_core_base.h | 1 - include/target/target_core_fabric.h | 2 +- 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 7cd065318b74..d2cd7906a4a8 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1904,8 +1904,6 @@ 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) { /* @@ -3092,39 +3090,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 77c2a19d85df..5f35d92387d5 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);