From 35462975b2b197b990fedbb74b81f9bea9d344cb Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 31 May 2011 23:56:57 -0400 Subject: target: merge release_cmd methods The release_cmd_to_pool and release_cmd_direct methods are always the same. Merge them into a single release_cmd method, and clean up the fallout. (nab: fix breakage in transport_generic_free_cmd() parameter build breakage in drivers/target/tcm_fc/tfc_cmd.c) Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/loopback/tcm_loop.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/target/loopback') diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index cb4a9b906a4..c2937b2035d 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -204,13 +204,10 @@ static void tcm_loop_check_stop_free(struct se_cmd *se_cmd) * Release the struct se_cmd, which will make a callback to release * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() */ - transport_generic_free_cmd(se_cmd, 0, 1, 0); + transport_generic_free_cmd(se_cmd, 0, 0); } -/* - * Called from struct target_core_fabric_ops->release_cmd_to_pool() - */ -static void tcm_loop_deallocate_core_cmd(struct se_cmd *se_cmd) +static void tcm_loop_release_cmd(struct se_cmd *se_cmd) { struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, struct tcm_loop_cmd, tl_se_cmd); @@ -395,7 +392,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc) SUCCESS : FAILED; release: if (se_cmd) - transport_generic_free_cmd(se_cmd, 1, 1, 0); + transport_generic_free_cmd(se_cmd, 1, 0); else kmem_cache_free(tcm_loop_cmd_cache, tl_cmd); kfree(tl_tmr); @@ -1418,8 +1415,7 @@ static int tcm_loop_register_configfs(void) */ fabric->tf_ops.new_cmd_map = &tcm_loop_new_cmd_map; fabric->tf_ops.check_stop_free = &tcm_loop_check_stop_free; - fabric->tf_ops.release_cmd_to_pool = &tcm_loop_deallocate_core_cmd; - fabric->tf_ops.release_cmd_direct = &tcm_loop_deallocate_core_cmd; + fabric->tf_ops.release_cmd = &tcm_loop_release_cmd; fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session; fabric->tf_ops.close_session = &tcm_loop_close_session; fabric->tf_ops.stop_session = &tcm_loop_stop_session; -- cgit v1.2.3