From patchwork Wed Feb 15 00:26:06 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: 9573111 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 B3F086045F for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A76F1205D6 for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C92E26E76; Wed, 15 Feb 2017 00:26:58 +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 21D8B205D6 for ; Wed, 15 Feb 2017 00:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751208AbdBOA04 (ORCPT ); Tue, 14 Feb 2017 19:26:56 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:17288 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbdBOA0x (ORCPT ); Tue, 14 Feb 2017 19:26:53 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867929" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 08:26:22 +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 5E.E4.57638.E20A3A85; Tue, 14 Feb 2017 16:26:22 -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-7c-58a3a02e621d Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 52.8D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Christoph Hellwig , David Disseldorp Subject: [PATCH v6 27/33] target: Reduce number of __transport_wait_for_tasks() arguments Date: Tue, 14 Feb 2017 16:26:06 -0800 Message-ID: <20170215002612.14566-28-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+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5ka7egsURBlcXilp8/T+dxWLl6qNM Fm2rzzBatC59y+TA4nF/+xEmj903G9g8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoEro+v0VJaC w1IVi3uOMDUwzhPrYuTkkBAwkTiztY2ti5GLQ0hgKZPE9xnfWCCcbYwS37ZOYYap6lz9Gapq I6PE4cW/WEESbAJGEt/ez2QBsUWA7NU9y5hAipgFpjFK9Fw+zwiSEBaIlNjZvgWsiEVAVWLP pWdgNq+Ag8TJnyC7QTbIS+xquwg2lBMoPmPHSaAaDqBt9hKPzliDzJQQaGKVuP9lKhNEr6DE yZlPwOYwC0hIHHzxAuxSIQF1iZNL5jNNYBSahaRsFpKyBYxMqxjFcjNzinPTUwsMTfWKE/NS Mouz9ZLzczcxQkI7cwfj3SfehxgFOBiVeHhPyC6OEGJNLCuuzD3EKMHBrCTCy1YPFOJNSays Si3Kjy8qzUktPsQozcGiJM57TmZqhJBAemJJanZqakFqEUyWiYNTqoGxJuvP1rS/RzaIlMrf cuRd3+ubudfs7YP2g6ZrNrz+yLjw79EMHe6vWax1q5irpx64I/bxpMSfiRw2nneDfK/WWjW+ Prch2XWf805r81y2Bx26m7q/PeIw3DNt1k/jnVXNBR8mTtOWCEywyLm3f//R3mKPuGr7WfaX Y5PD1m7jexFbK1IrdE9LiaU4I9FQi7moOBEAiSZjxGkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg3tPDCwO/mxjtPj6fzqL xcrVR5ks2lafYbRoXfqWyYHV4/72I0weu282sHlMW3OeyWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDK6Tk9lKTgsVbG45whTA+M8sS5GTg4JAROJztWf2boYuTiEBNYzSvz/cpkVJMEmYCTx 7f1MFhBbBMhe3bOMCaSIWWAao8SVV1PAioQFIiV2tm8BK2IRUJXYc+kZmM0r4CCx++tZFogN 8hK72i6C1XMCxWfsOAkU5wDaZi/x6Iz1BEbuBYwMqxjFcjNzinPTMwsMDfWKE/NSMouz9ZLz czcxQgIicgfj04nmhxiZODilGhg1b7DsFvshcb7TxHsZl3Wb51mf+aenCS99oTZnWsvBC+tk ff4GLys5+OIdZ/+jzWYsu56w3DCvezZpwYy9i8J2r9bSV7O0nGq98rBBHrPdSxmPczf0pNQO THD9kSE0935yBSPDqYrS6NscncbmN3cYv9y+sK2ie/26QLa+uXqxPU+2ZvYcKFZUYinOSDTU Yi4qTgQA93/64LgBAAA= 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 *aborted and *tas variables are set by __transport_wait_for_tasks() but the value that is set is ignored by all callers due to previous patches. Hence remove the code that sets these variables. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Nicholas A. Bellinger Cc: Christoph Hellwig Cc: David Disseldorp --- drivers/target/target_core_transport.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 9a4671bff337..4293a693e8a4 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2504,24 +2504,21 @@ static void transport_write_pending_qf(struct se_cmd *cmd) } static bool -__transport_wait_for_tasks(struct se_cmd *, bool, bool *, bool *, - unsigned long *flags); +__transport_wait_for_tasks(struct se_cmd *, bool, unsigned long *flags); -static void target_wait_free_cmd(struct se_cmd *cmd, bool *aborted, bool *tas) +static void target_wait_free_cmd(struct se_cmd *cmd) { unsigned long flags; spin_lock_irqsave(&cmd->t_state_lock, flags); - __transport_wait_for_tasks(cmd, true, aborted, tas, &flags); + __transport_wait_for_tasks(cmd, true, &flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags); } int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) { - bool aborted = false, tas = false; - if (wait_for_tasks) - target_wait_free_cmd(cmd, &aborted, &tas); + target_wait_free_cmd(cmd); if (cmd->se_cmd_flags & SCF_SE_LUN_CMD) { /* @@ -2785,9 +2782,8 @@ void transport_clear_lun_ref(struct se_lun *lun) wait_for_completion(&lun->lun_ref_comp); } -static bool -__transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, - bool *aborted, bool *tas, unsigned long *flags) +static bool __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, + unsigned long *flags) __releases(&cmd->t_state_lock) __acquires(&cmd->t_state_lock) { @@ -2798,12 +2794,6 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, if (fabric_stop) cmd->transport_state |= CMD_T_FABRIC_STOP; - if (cmd->transport_state & CMD_T_ABORTED) - *aborted = true; - - if (cmd->transport_state & CMD_T_TAS) - *tas = true; - if (!(cmd->se_cmd_flags & SCF_SE_LUN_CMD) && !(cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) return false; @@ -2815,7 +2805,7 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, if (!(cmd->transport_state & CMD_T_ACTIVE)) return false; - if (fabric_stop && *aborted) + if (fabric_stop && (cmd->transport_state & CMD_T_ABORTED)) return false; cmd->transport_state |= CMD_T_STOP; @@ -2846,10 +2836,10 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, bool transport_wait_for_tasks(struct se_cmd *cmd) { unsigned long flags; - bool ret, aborted = false, tas = false; + bool ret; spin_lock_irqsave(&cmd->t_state_lock, flags); - ret = __transport_wait_for_tasks(cmd, false, &aborted, &tas, &flags); + ret = __transport_wait_for_tasks(cmd, false, &flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags); return ret;