From patchwork Wed Feb 8 22:25:02 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: 9563661 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 246916020F for ; Wed, 8 Feb 2017 22:28:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E2C2852D for ; Wed, 8 Feb 2017 22:28:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEBCC28530; Wed, 8 Feb 2017 22:28:12 +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 BFF09284F2 for ; Wed, 8 Feb 2017 22:28:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751785AbdBHW2I (ORCPT ); Wed, 8 Feb 2017 17:28:08 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:63830 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbdBHW16 (ORCPT ); Wed, 8 Feb 2017 17:27:58 -0500 X-IronPort-AV: E=Sophos;i="5.35,348,1483977600"; d="scan'208";a="76618215" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2017 06:28:24 +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 A7.72.18895.DCA9B985; Wed, 8 Feb 2017 14:25:17 -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-01-589b9acd5544 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 78.42.18148.7CA9B985; Wed, 8 Feb 2017 14:25:11 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v4 32/37] target: Inline transport_put_cmd() Date: Wed, 8 Feb 2017 14:25:02 -0800 Message-ID: <20170208222507.25715-33-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+NgFrrOLMWRmVeSWpSXmKPExsXCddJ5ke7ZWbMjDA72Clvsn/WMyeLr/+ks FitXH2WyaF36lsmBxWP3zQY2j/f7rrJ5bD5d7fF5k1wASxSXTUpqTmZZapG+XQJXRvuUO+wF 54QqjqzazdjAeJq/i5GTQ0LARGLSj36mLkYuDiGBpUwSP2edh3K2Mko86j3FBlN1bMppZojE RkaJt3tmsoMk2ASMJL69n8kCYosIGEj87r3ACFLELNDBKDG/5xkrSEJYwEbi9ra1zCA2i4CK xLer88HivAIOEgt/d7NCbJCX2NV2EczmBIpPePmMEcQWErCXeHXgC9hQCYEuVomOhVdZIJoF JU7OfAJmMwtISBx88YIZokFd4uSS+UwTGIVmISmbhaRsASPTKkax3Myc4tz01AJDE73ixLyU zOJsveT83E2MkOAu3MH4+rb3IUYBDkYlHt4L1rMjhFgTy4orcw8xSnAwK4nwpkwDCvGmJFZW pRblxxeV5qQWH2KU5mBREufNkp0aISSQnliSmp2aWpBaBJNl4uCUamCUOdu65sVsC5kmBr/o 4BXLNI5s3COjMYeLO/s1r1uhumTVmsu/Ni/b52obGl9dodJTFTVRZeqXKRcWz3HmnNVwMqvs nGemQPrrjstP//yaEjFvQtD2Q4c0lNzNk6aqPKyfdn5VYW739ZXrNh6RljnUcEDD2fOIitmv 2b9n7igWX/fxVNiSuZlXlFiKMxINtZiLihMBdlFQiGoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTff4rNkRBjOXW1vsn/WMyeLgzzZG i6//p7NYrFx9lMmidelbJgdWj903G9g83u+7yuYxbc15Jo/Np6s9Pm+SC2CN4rJJSc3JLEst 0rdL4Mpon3KHveCcUMWRVbsZGxhP83cxcnJICJhIHJtymrmLkYtDSGA9o8Sxa4/YQBJsAkYS 397PZAGxRQQMJH73XmAEKWIW6GKU2HTmFDtIQljARuL2trVA3RwcLAKqEkvepYKEeQUcJI5+ fcoOsUBeYlfbRVYQmxMoPuHlM0YQW0jAXuLVgS+MExi5FzAyrGIUy83MKc5NzywwNNIrTsxL ySzO1kvOz93ECAmIqB2M1yeaH2Jk4uCUamCsXZiuxxB54GHP56Nnn208zdqYNzOr0lHxsfuW x/G9cgL7nix8xG9rFXj64i3pyw+Yu15W+30UDN/6f3280/uTP+0FimYHHlqydL2W9sunrD8e O57IZaxrXMQuIMr3yEaEa0WLaUp2XvO87OwVa9e9rD6k3b5d4kxUWlesZ3v+oi+B8UfPiGxV YinOSDTUYi4qTgQAxDT4l7gBAAA= 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 transport_put_cmd() function consists of two lines of code. Due to previous patches only two callers are left. Hence inline this function. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_transport.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index fdd06ecacd52..8df03987bdb8 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -66,7 +66,6 @@ struct kmem_cache *t10_alua_lba_map_mem_cache; static void transport_complete_task_attr(struct se_cmd *cmd); static void transport_handle_queue_full(struct se_cmd *cmd, struct se_device *dev); -static int transport_put_cmd(struct se_cmd *cmd); static void target_complete_ok_work(struct work_struct *work); int init_se_kmem_caches(void) @@ -697,7 +696,7 @@ static void transport_handle_abort(struct se_cmd *cmd) * commands" in SAM. */ if (transport_cmd_check_stop_to_fabric(cmd) == 0 && ack_kref) - transport_put_cmd(cmd); + target_put_sess_cmd(cmd); } } @@ -2256,22 +2255,6 @@ static inline void transport_free_pages(struct se_cmd *cmd) cmd->t_bidi_data_nents = 0; } -/** - * transport_put_cmd - release a reference to a command - * @cmd: command to release - * - * This routine releases our reference to the command and frees it if possible. - */ -static int transport_put_cmd(struct se_cmd *cmd) -{ - BUG_ON(!cmd->se_tfo); - /* - * If this cmd has been setup with target_get_sess_cmd(), drop - * the kref and call ->release_cmd() in kref callback. - */ - return target_put_sess_cmd(cmd); -} - void *transport_kmap_data_sg(struct se_cmd *cmd) { struct scatterlist *sg = cmd->t_data_sg; @@ -2528,7 +2511,8 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) pr_debug("Detected CMD_T_ABORTED for ITT: %llu\n", cmd->tag); wait_for_completion(&cmd->complete); } - return transport_put_cmd(cmd); + BUG_ON(!cmd->se_tfo); + return target_put_sess_cmd(cmd); } EXPORT_SYMBOL(transport_generic_free_cmd);