diff options
author | Andy Grover <agrover@redhat.com> | 2012-01-19 16:39:17 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 17:37:47 -0500 |
commit | c8e31f26feeb03dc6f51bff68135cc58431e099b (patch) | |
tree | 8d584fcb7cb7a58988cd2463a9a26f577410e6ac /drivers/target/loopback | |
parent | 35b2cdc4fea1f0d13e1602c07e62c797c9fe5ed4 (diff) |
target: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cache
Change the test for if a cmd is a tmr request to checking if
SCF_SCSI_TMR_CDB (a new flag) is set in cmd->se_cmd_flags.
Also remove se_tmr_req_cache usage in favor of kzalloc usage,
and make core_tmr_alloc_req() return int + setup se_cmd->se_tmr_req
directly and fix up various fabric module usages
Cc: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index c47ff7f59e57..7cfbcb00b3c3 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -187,7 +187,7 @@ static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) | |||
187 | * pointer. These will be released directly in tcm_loop_device_reset() | 187 | * pointer. These will be released directly in tcm_loop_device_reset() |
188 | * with transport_generic_free_cmd(). | 188 | * with transport_generic_free_cmd(). |
189 | */ | 189 | */ |
190 | if (se_cmd->se_tmr_req) | 190 | if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) |
191 | return 0; | 191 | return 0; |
192 | /* | 192 | /* |
193 | * Release the struct se_cmd, which will make a callback to release | 193 | * Release the struct se_cmd, which will make a callback to release |
@@ -324,7 +324,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc) | |||
324 | struct tcm_loop_nexus *tl_nexus; | 324 | struct tcm_loop_nexus *tl_nexus; |
325 | struct tcm_loop_tmr *tl_tmr = NULL; | 325 | struct tcm_loop_tmr *tl_tmr = NULL; |
326 | struct tcm_loop_tpg *tl_tpg; | 326 | struct tcm_loop_tpg *tl_tpg; |
327 | int ret = FAILED; | 327 | int ret = FAILED, rc; |
328 | /* | 328 | /* |
329 | * Locate the tcm_loop_hba_t pointer | 329 | * Locate the tcm_loop_hba_t pointer |
330 | */ | 330 | */ |
@@ -365,12 +365,9 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc) | |||
365 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, | 365 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, |
366 | DMA_NONE, MSG_SIMPLE_TAG, | 366 | DMA_NONE, MSG_SIMPLE_TAG, |
367 | &tl_cmd->tl_sense_buf[0]); | 367 | &tl_cmd->tl_sense_buf[0]); |
368 | /* | 368 | |
369 | * Allocate the LUN_RESET TMR | 369 | rc = core_tmr_alloc_req(se_cmd, tl_tmr, TMR_LUN_RESET, GFP_KERNEL); |
370 | */ | 370 | if (rc < 0) |
371 | se_cmd->se_tmr_req = core_tmr_alloc_req(se_cmd, tl_tmr, | ||
372 | TMR_LUN_RESET, GFP_KERNEL); | ||
373 | if (IS_ERR(se_cmd->se_tmr_req)) | ||
374 | goto release; | 371 | goto release; |
375 | /* | 372 | /* |
376 | * Locate the underlying TCM struct se_lun from sc->device->lun | 373 | * Locate the underlying TCM struct se_lun from sc->device->lun |