From patchwork Wed Feb 15 00:26:10 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: 9573109 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 8F900600F6 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 834D6267EC for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 782CA27E5A; 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 2776928391 for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750908AbdBOA05 (ORCPT ); Tue, 14 Feb 2017 19:26:57 -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 S1750931AbdBOA0z (ORCPT ); Tue, 14 Feb 2017 19:26:55 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867932" 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 BE.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-7d-58a3a02ef753 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id F3.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 , Andy Grover , David Disseldorp Subject: [PATCH v6 31/33] target: Inline transport_put_cmd() Date: Tue, 14 Feb 2017 16:26:10 -0800 Message-ID: <20170215002612.14566-32-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+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ka7egsURBvMuKlrsn/WMyeLr/+ks FitXH2WyaFt9htGidelbJgdWj/vbjzB57L7ZwObxft9VNo/Np6s9Pm+SC2CN4rJJSc3JLEst 0rdL4Mo4dvQ9Y8FigYpHZ6+yNDDe4u1i5OSQEDCR2P1oAksXIxeHkMBSJok1n5sYIZxtjBLf tk5hhqmaeeUkM0RiI6PEyWk/WUESbAJGEt/ez2QBsUWA7NU9y5hAipgFdjBKTFy5mx0kISxg I3H06mWgBAcHi4CqxKbJriBhXgEHiWsNF6EWyEvsarsINpMTKD5jx0kWkHIhAXuJR2esQUZK CExildi14yQjRK+gxMmZT8D2MgtISBx88QJsjpCAusTJJfOZJjAKzUJSNgtJ2QJGplWMYrmZ OcW56akFhqZ6xYl5KZnF2XrJ+bmbGCHBnrmD8e4T70OMAhyMSjy8J2QXRwixJpYVV+YeYpTg YFYS4WWrBwrxpiRWVqUW5ccXleakFh9ilOZgURLnPSczNUJIID2xJDU7NbUgtQgmy8TBKdXA uKh/6qEQy7bVq94mX9nn2rDE0/nKa1fjgxd0Q6MnSD7f1aDkdSu8foHaX53l08oFLDd+b/C9 8er9kbX6DxynTVrrn1z32Ltm7sfH/S4TdqT1rC46XHHwzapfd6a9/rBw0/wg4UDW/11m0ySU 1BPPHj0jerd20j25n+pypVFzbl1h11vnn6q5aIsSS3FGoqEWc1FxIgA1Cq6rcgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg6XrTC32z3rGZHHwZxuj xdf/01ksVq4+ymTRtvoMo0Xr0rdMDmwe97cfYfLYfbOBzeP9vqtsHtPWnGfy2Hy62uPzJrkA tigum5TUnMyy1CJ9uwSujGNH3zMWLBaoeHT2KksD4y3eLkZODgkBE4mZV04ydzFycQgJrGeU 6FozjwUkwSZgJPHt/UwwWwTIXt2zjAmkiFlgF6PE5AknwBLCAjYSR69eBkpwcLAIqEpsmuwK EuYVcJDoWzSFGWKBvMSutousIDYnUHzGjpMsIOVCAvYSj85YT2DkXsDIsIpRLDczpzg3PbPA 0FCvODEvJbM4Wy85P3cTIyREIncwPp1ofoiRiYNTqoFxadcly7DbsdV5XFdm3tAp9175aXVR WcdRWfXZQsXhD344a9mql91c1Lauc3meZdaaDyy9bziLyrr7zI0v38zPeMvi9CW+9NfBc8nt tTZG1xQWJnnMjLv2eF6O3aJr2ZmrHvr9CY8uWHX6bYWm8a9VOfnxzNo/HJ990vBflqz5pn9X 0P5knbdKLMUZiYZazEXFiQDHAg/4wQEAAA== 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 2d9de8802889..5af06fd2abe9 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) @@ -2271,22 +2270,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; @@ -2532,7 +2515,8 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) if (cmd->se_lun) transport_lun_remove_cmd(cmd); } - return transport_put_cmd(cmd); + BUG_ON(!cmd->se_tfo); + return target_put_sess_cmd(cmd); } EXPORT_SYMBOL(transport_generic_free_cmd);