aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/loopback
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-05-31 23:56:57 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:44 -0400
commit35462975b2b197b990fedbb74b81f9bea9d344cb (patch)
tree72aea1508e81292f7fe7a17b39ed7f59de3dc3ce /drivers/target/loopback
parentdb1620a2788f6c470804f6a5f983a0152188bd90 (diff)
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 <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r--drivers/target/loopback/tcm_loop.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index cb4a9b906a4b..c2937b2035d3 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)
204 * Release the struct se_cmd, which will make a callback to release 204 * Release the struct se_cmd, which will make a callback to release
205 * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() 205 * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd()
206 */ 206 */
207 transport_generic_free_cmd(se_cmd, 0, 1, 0); 207 transport_generic_free_cmd(se_cmd, 0, 0);
208} 208}
209 209
210/* 210static void tcm_loop_release_cmd(struct se_cmd *se_cmd)
211 * Called from struct target_core_fabric_ops->release_cmd_to_pool()
212 */
213static void tcm_loop_deallocate_core_cmd(struct se_cmd *se_cmd)
214{ 211{
215 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, 212 struct tcm_loop_cmd *tl_cmd = container_of(se_cmd,
216 struct tcm_loop_cmd, tl_se_cmd); 213 struct tcm_loop_cmd, tl_se_cmd);
@@ -395,7 +392,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
395 SUCCESS : FAILED; 392 SUCCESS : FAILED;
396release: 393release:
397 if (se_cmd) 394 if (se_cmd)
398 transport_generic_free_cmd(se_cmd, 1, 1, 0); 395 transport_generic_free_cmd(se_cmd, 1, 0);
399 else 396 else
400 kmem_cache_free(tcm_loop_cmd_cache, tl_cmd); 397 kmem_cache_free(tcm_loop_cmd_cache, tl_cmd);
401 kfree(tl_tmr); 398 kfree(tl_tmr);
@@ -1418,8 +1415,7 @@ static int tcm_loop_register_configfs(void)
1418 */ 1415 */
1419 fabric->tf_ops.new_cmd_map = &tcm_loop_new_cmd_map; 1416 fabric->tf_ops.new_cmd_map = &tcm_loop_new_cmd_map;
1420 fabric->tf_ops.check_stop_free = &tcm_loop_check_stop_free; 1417 fabric->tf_ops.check_stop_free = &tcm_loop_check_stop_free;
1421 fabric->tf_ops.release_cmd_to_pool = &tcm_loop_deallocate_core_cmd; 1418 fabric->tf_ops.release_cmd = &tcm_loop_release_cmd;
1422 fabric->tf_ops.release_cmd_direct = &tcm_loop_deallocate_core_cmd;
1423 fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session; 1419 fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session;
1424 fabric->tf_ops.close_session = &tcm_loop_close_session; 1420 fabric->tf_ops.close_session = &tcm_loop_close_session;
1425 fabric->tf_ops.stop_session = &tcm_loop_stop_session; 1421 fabric->tf_ops.stop_session = &tcm_loop_stop_session;