From patchwork Wed Feb 8 22:24:51 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: 9563647 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 585296020F for ; Wed, 8 Feb 2017 22:28:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C5942852B for ; Wed, 8 Feb 2017 22:28:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2119D28531; Wed, 8 Feb 2017 22:28:06 +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 55FE72852B for ; Wed, 8 Feb 2017 22:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751092AbdBHW17 (ORCPT ); Wed, 8 Feb 2017 17:27:59 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:63832 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008AbdBHW14 (ORCPT ); Wed, 8 Feb 2017 17:27:56 -0500 X-IronPort-AV: E=Sophos;i="5.35,348,1483977600"; d="scan'208";a="76618046" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2017 06:28:23 +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 57.72.18895.CCA9B985; Wed, 8 Feb 2017 14:25:16 -0800 (PST) Received: from milsmgip12.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; Wed, 8 Feb 2017 14:25:11 -0800 X-AuditID: 0ac94371-0fadb980000049cf-ff-589b9accdaca Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id D4.42.18148.7CA9B985; Wed, 8 Feb 2017 14:25:11 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: Subject: [PATCH v4 21/37] target: Remove the SCF_SEND_DELAYED_TAS command flag Date: Wed, 8 Feb 2017 14:24:51 -0800 Message-ID: <20170208222507.25715-22-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170208222507.25715-1-bart.vanassche@sandisk.com> References: <20170208222507.25715-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsXCddJ5ke6ZWbMjDO4cMLFoXfqWyYHR4/Mm uQDGKC6blNSczLLUIn27BK6MpVv72Qo6pCv2XGxkbGBcIt7FyMkhIWAi8eLxFMYuRi4OIYGl TBKLr2xkgXC2Mko86j3FBlP1uvMeO0RiI6PExz3zmEASbAJGEt/ez2QBsUUEDCR+915gBLGZ BZQk9kxdBlYjLOAnsWHicaA4BweLgIrEyfuOIGFeAQeJVzPWskPMl5fY1XaRFcTmBIpPePkM bIyQgL3EqwNfwK6TELjOIrGv/TYrRLOgxMmZT1ggdklIHHzxghmiQV3i5JL5TBMYhWYhKZuF pGwBI9MqRrHczJzi3PTUAkMTveLEvJTM4my95PzcTYyQ8Czcwfj6tvchRgEORiUe3gvWsyOE WBPLiitzDzFKcDArifCmTAMK8aYkVlalFuXHF5XmpBYfYpTmYFES582SnRohJJCeWJKanZpa kFoEk2Xi4JRqYExQbw76xNun6a17sKlsyRNzvWtmsrHPJr3cpCTHs+h516udi49p/z7/5+ib LTf7nh2p2F5etVDAgCPrRZVDYfCXjBmLgz8cbGE1fsV45sW057LLYuscY5fqzmLfIlyvqPWH 88kf5dn5yWcalLwYr83S+R4mrZcS5jqlzzLUJvyLxyc79etsLkosxRmJhlrMRcWJAIvx6mpL AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkuLIzCtJLcpLzFFi42Lh2sjJpnt81uwIgwMb9C0O/mxjtGhd+pbJ gclj2przTB6fN8kFMEVx2aSk5mSWpRbp2yVwZSzd2s9W0CFdsediI2MD4xLxLkZODgkBE4nX nffYuxi5OIQE1jNKnF7WxAqSYBMwkvj2fiYLiC0iYCDxu/cCI4jNLKAgcXHqLDBbWMBPYsPE 42A2i4CqxIfuA8wgNq+Ag0TH5pPMEAvkJXa1XQSbyQkUn/DyGVi9kIC9xKsDXxgnMHIvYGRY xSiWm5lTnJueWWBopFecmJeSWZytl5yfu4kR4teoHYzXJ5ofYmTi4JRqYNwSvVQx7fal25sD OTN3ij/anZ3Ht/aGBMNnFq3J9j83VR+e86maoV3mdP1H3gc1Xfd6phr7f+j690m51dXz/EeD i8V6637fdDP27frd//W0wp4t9yd+Dfg+q3PHxtOlp8VaBYWNdafpb+x4q2tnme39xalse1Xa 7ANX59wRNmoOZmXilj0mNVWJpTgj0VCLuag4EQCuqX9imwEAAA== 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 1ea63b261641..81e25fbb69fc 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1890,8 +1890,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) { /* @@ -2996,39 +2994,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) +bool transport_check_aborted_status(struct se_cmd *cmd, int send_status) { - 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) -{ - 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 187caa258253..163b98fd11c1 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);