From patchwork Wed Feb 15 00:26:01 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: 9573103 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 7BDB4600F6 for ; Wed, 15 Feb 2017 00:26:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F868283F4 for ; Wed, 15 Feb 2017 00:26:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 646D02842B; Wed, 15 Feb 2017 00:26:56 +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 D875528418 for ; Wed, 15 Feb 2017 00:26:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444AbdBOA0z (ORCPT ); Tue, 14 Feb 2017 19:26:55 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:10895 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdBOA0x (ORCPT ); Tue, 14 Feb 2017 19:26:53 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867891" 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 8D.E4.57638.D20A3A85; Tue, 14 Feb 2017 16:26:21 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) 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-79-58a3a02d510f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 30.8D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Andy Grover Subject: [PATCH v6 22/33] target: Inline transport_check_aborted_status() Date: Tue, 14 Feb 2017 16:26:01 -0800 Message-ID: <20170215002612.14566-23-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+NgFjrDLMWRmVeSWpSXmKPExsXCddJ5ka7ugsURBksXalvsn/WMyaJt9RlG i9alb5kcmD3ubz/C5PF+31U2j8+b5AKYo7hsUlJzMstSi/TtErgy9vw6xFhwTqfi2cQ7bA2M a1W7GDk5JARMJC7NfsjUxcjFISSwlEni+bIWKGcHo0Trud9sMFVd+9ayQyQ2Mko8fPwDLMEm YCTx7f1MFhBbBMhe3bOMCcRmFiiRWPz/DpgtLOApMenUFGYQm0VAVaL37F6wOK+Ag8T+7zNY IBbIS+xqu8gKYnMCxWfsOAkU5wBaZi/x6Iw1yF4JgW8sEvMbnjNC9ApKnJz5hAVil4TEwRcv wOYLCahLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoqlecmJeSWZytl5yfu4kREsaZ OxjvPvE+xCjAwajEw3tCdnGEEGtiWXFl7iFGCQ5mJRFetnqgEG9KYmVValF+fFFpTmrxIUZp DhYlcd5zMlMjhATSE0tSs1NTC1KLYLJMHJxSDYwuzT/MvHPW5r9xnMAp+dRX45ugW5Ls3/vb X/dsfV7sI/HH8eoFT7XanrR9PNPu7b9mVMRadTru6VxR0eObet7fmRCvpMRwXPTApqtvKlWm z2EXd3/2xOZE+qSAvP45bGXdgjZcx24G3mqav+f/E4Xehd8ztzvctL2q6eOVwCaaEc3v25m+ w0eJpTgj0VCLuag4EQBhIcXaXwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIgyUPNSz2z3rGZHHwZxuj RdvqM4wWrUvfMjmweNzffoTJ4/2+q2we09acZ/L4vEkugCWKyyYlNSezLLVI3y6BK2PPr0OM Bed0Kp5NvMPWwLhWtYuRk0NCwESia99a9i5GLg4hgfWMEs+mHGcFSbAJGEl8ez+TBcQWAbJX 9yxjArGZBUok3vUcZAexhQU8JSadmsIMYrMIqEr0nt0LVsMr4CDx6edpZogF8hK72i6CzeQE is/YcRJoJgfQMnuJR2esJzByL2BkWMUolpuZU5ybnllgaKhXnJiXklmcrZecn7uJEeL9yB2M TyeaH2Jk4uCUamDc8d7pW68Pa9CVIsEdvwsfHfXy0nj2KXDy1MDXdseLgx4ZWifdfbltR8m2 1JxZPFrHb8clVy/uNZmh3qC8crm584K1020YV3fxt999vCD5xIautEtCX04qL9GZpDgr+WaC m2bDhOW3Tv+2XaJa6Hl13cPlnd+fZXw/8nN9Xs+GC32ps4pv2h3vVGIpzkg01GIuKk4EALeY CrGuAQAA 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 Due to the previous patch the second argument of transport_check_aborted_status() is ignored and that function does no longer have any side effect. Hence remove all calls of that function that do not check the return value. Additionally, inline this function. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Cc: Andy Grover --- drivers/infiniband/ulp/srpt/ib_srpt.c | 4 ++-- drivers/target/iscsi/iscsi_target.c | 7 +------ drivers/target/iscsi/iscsi_target_erl1.c | 8 +++----- drivers/target/target_core_transport.c | 10 ++-------- include/target/target_core_fabric.h | 1 - 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index d21ba9d857c3..3bd9d880eb5d 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2289,8 +2289,8 @@ static void srpt_queue_response(struct se_cmd *cmd) } spin_unlock_irqrestore(&ioctx->spinlock, flags); - if (unlikely(transport_check_aborted_status(&ioctx->cmd, false) - || WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { + if (unlikely((ioctx->cmd.transport_state & CMD_T_ABORTED) || + WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) { atomic_inc(&ch->req_lim_delta); srpt_abort_cmd(ioctx); return; diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index d8a9121ba189..b98a9521212f 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1512,8 +1512,6 @@ __iscsit_check_dataout_hdr(struct iscsi_conn *conn, void *buf, if (hdr->flags & ISCSI_FLAG_CMD_FINAL) iscsit_stop_dataout_timer(cmd); - transport_check_aborted_status(se_cmd, - (hdr->flags & ISCSI_FLAG_CMD_FINAL)); return iscsit_dump_data_payload(conn, payload_length, 1); } } else { @@ -1529,11 +1527,8 @@ __iscsit_check_dataout_hdr(struct iscsi_conn *conn, void *buf, */ if (se_cmd->transport_state & CMD_T_ABORTED) { if (hdr->flags & ISCSI_FLAG_CMD_FINAL) - if (--cmd->outstanding_r2ts < 1) { + if (--cmd->outstanding_r2ts < 1) iscsit_stop_dataout_timer(cmd); - transport_check_aborted_status( - se_cmd, 1); - } return iscsit_dump_data_payload(conn, payload_length, 1); } diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c index fe9b7f1e44ac..ee6ac90b9cf5 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.c +++ b/drivers/target/iscsi/iscsi_target_erl1.c @@ -951,8 +951,7 @@ int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) * should be sent after unsolicited data out with * ISCSI_FLAG_CMD_FINAL set in iscsi_handle_data_out() */ - if (transport_check_aborted_status(se_cmd, - (cmd->unsolicited_data == 0)) != 0) + if (se_cmd->transport_state & CMD_T_ABORTED) return 0; /* * Otherwise send CHECK_CONDITION and sense for @@ -980,8 +979,7 @@ int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) * WRITEs if no more unsolicitied data is * expected. */ - if (transport_check_aborted_status(se_cmd, 1) - != 0) + if (se_cmd->transport_state & CMD_T_ABORTED) return 0; iscsit_set_dataout_sequence_values(cmd); @@ -1000,7 +998,7 @@ int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) * Send the delayed TASK_ABORTED status for WRITEs if * no more nsolicitied data is expected. */ - if (transport_check_aborted_status(se_cmd, 1) != 0) + if (se_cmd->transport_state & CMD_T_ABORTED) return 0; iscsit_set_unsoliticed_dataout(cmd); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 6995d0093d16..225fc2840017 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1679,7 +1679,7 @@ void transport_generic_request_failure(struct se_cmd *cmd, { int ret = 0, post_ret = 0; - if (transport_check_aborted_status(cmd, 1)) { + if (cmd->transport_state & CMD_T_ABORTED) { target_handle_abort(cmd); return; } @@ -1902,7 +1902,7 @@ static bool target_handle_task_attr(struct se_cmd *cmd) void target_execute_cmd(struct se_cmd *cmd) { - if (transport_check_aborted_status(cmd, 1)) { + if (cmd->transport_state & CMD_T_ABORTED) { target_handle_abort(cmd); return; } @@ -3104,12 +3104,6 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd, } EXPORT_SYMBOL(transport_send_check_condition_and_sense); -bool transport_check_aborted_status(struct se_cmd *cmd, int send_status) -{ - return cmd->transport_state & CMD_T_ABORTED; -} -EXPORT_SYMBOL(transport_check_aborted_status); - static void target_tmr_work(struct work_struct *work) { struct se_cmd *cmd = container_of(work, struct se_cmd, work); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 5b7af743fe79..4c2d6fbf5f95 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -153,7 +153,6 @@ 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 *); -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);