From patchwork Fri Feb 10 01:28:47 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: 9565791 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 1156460572 for ; Fri, 10 Feb 2017 01:29:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E6A28532 for ; Fri, 10 Feb 2017 01:29:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBD6C2853B; Fri, 10 Feb 2017 01:29:42 +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 8B16328532 for ; Fri, 10 Feb 2017 01:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbdBJB3l (ORCPT ); Thu, 9 Feb 2017 20:29:41 -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 S1751468AbdBJB3h (ORCPT ); Thu, 9 Feb 2017 20:29:37 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="82349559" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 10 Feb 2017 09:29:01 +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 72.97.57638.D571D985; Thu, 9 Feb 2017 17:29:01 -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; Thu, 9 Feb 2017 17:28:56 -0800 X-AuditID: 0ac94369-26dee9800001e126-04-589d175d1206 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 38.9F.11415.7571D985; Thu, 9 Feb 2017 17:28:55 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v5 17/22] target: Inline transport_put_cmd() Date: Thu, 9 Feb 2017 17:28:47 -0800 Message-ID: <20170210012852.15735-18-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+NgFrrDLMWRmVeSWpSXmKPExsXCddJ5kW6s+NwIgy3zjC32z3rGZPH1/3QW i5WrjzJZtK0+w2jRuvQtkwOrx/3tR5g8dt9sYPN4v+8qm8fm09UenzfJBbBGcdmkpOZklqUW 6dslcGW83bWCteCqQEXPX4cGxk6+LkZODgkBE4lV3TvYQGwhgaVMEju36nUxcgHZ2xkl7i5p Ze9i5AArevvMGaJmI6PErYvxIDabgJHEt/czWUBsESB7dc8yJpBeZoEdjBITV+5mB0kIC9hI zJx0DayIRUBF4s2SlawgNq+Ag0TT7lPMEEfIS+xquwgW5wSKv5p9nRVkr5CAvcSOXQYgMyUE JrFKfJn7kx2iV1Di5MwnYDOZBSQkDr54wQxxnLrEySXzmSYwCs1CUjYLSdkCRqZVjGK5mTnF uempBYamesWJeSmZxdl6yfm5mxghYZ65g/HuE+9DjAIcjEo8vC9q5kQIsSaWFVfmHmKU4GBW EuG9zzc3Qog3JbGyKrUoP76oNCe1+BCjNAeLkjjvOZmpEUIC6YklqdmpqQWpRTBZJg5OqQbG DXPPHuJtTBEy2RvH8WybeoB3SHzI5VhL3cW/38wP6F40g8V8If+09Ca+LpfF891erjBkKb1b o15n8NbpNY9Z6ev6zB9Bai/Wp0UoXO+xOHXCburHPe9FRaZeFHdInXA49E6O9RlVw57poS4i Ivbn5jlnX/S9U8LEwrnCgnHV2VJ5Jcf+dbOVWIozEg21mIuKEwH7HlP/bwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLJMWRmVeSWpSXmKPExsXCtZGTTTdcfG6EQe8+ZYv9s54xWRz82cZo 8fX/dBaLlauPMlm0rT7DaNG69C2TA5vH/e1HmDx232xg83i/7yqbx7Q155k8Np+u9vi8SS6A LYrLJiU1J7MstUjfLoEr4+2uFawFVwUqev46NDB28nUxcnBICJhIvH3m3MXIxSEksJ5R4nv7 M/YuRk4ONgEjiW/vZ7KA2CJA9uqeZUwgRcwCuxglJk84AZYQFrCRmDnpGpjNIqAqMeHMdlYQ m1fAQWJRyyJmEFtCQF5iV9tFsDgnUPzV7OusIIuFBOwlduwymMDIvYCRYRWjWG5mTnFuemaB oaFecWJeSmZxtl5yfu4mRkiARO5gfDrR/BAjEwenVAOjcmjs0Q6Wcr2AqrmHcrTPpIp/EZGX CDwmHRDBsfFYr3tW/p+Lly+0KMUzRs6Sns1kysUutjCz9jfvp8uGc3LYYk8nMXOpvDD1ne7k 52hisZA16lYJ9yfvoNithZMPfV3vfvbI670TmrfOEfu+y+9H1/02C7MP9ueFC/NtLohqP7t9 q01Y4K8SS3FGoqEWc1FxIgAzvJDQwAEAAA== 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 | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 0664e57e2211..0dd2119f21a9 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) @@ -2275,22 +2274,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; @@ -2547,7 +2530,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);