Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312675
b: refs/heads/master
c: 43381ce
h: refs/heads/master
i:
  312673: a5c60e4
  312671: e237d3b
v: v3
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed Jul 17, 2012
1 parent a172654 commit 39eb555
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e672a47fd99b47589dfe2f85759e4c8de526196b
refs/heads/master: 43381ce8bb14d2536102fe700b43e97da1410169
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/qla2xxx/qla_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ struct qla_tgt_func_tmpl {

int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,
unsigned char *, uint32_t, int, int, int);
int (*handle_data)(struct qla_tgt_cmd *);
void (*handle_data)(struct qla_tgt_cmd *);
int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t,
uint32_t);
void (*free_cmd)(struct qla_tgt_cmd *);
Expand Down
46 changes: 18 additions & 28 deletions trunk/drivers/scsi/qla2xxx/tcm_qla2xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,22 +604,10 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
return 0;
}

static void tcm_qla2xxx_do_rsp(struct work_struct *work)
static void tcm_qla2xxx_handle_data_work(struct work_struct *work)
{
struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work);
/*
* Dispatch ->queue_status from workqueue process context
*/
transport_generic_request_failure(&cmd->se_cmd);
}

/*
* Called from qla_target.c:qlt_do_ctio_completion()
*/
static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd)
{
struct se_cmd *se_cmd = &cmd->se_cmd;
unsigned long flags;
/*
* Ensure that the complete FCP WRITE payload has been received.
* Otherwise return an exception via CHECK_CONDITION status.
Expand All @@ -629,24 +617,26 @@ static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd)
* Check if se_cmd has already been aborted via LUN_RESET, and
* waiting upon completion in tcm_qla2xxx_write_pending_status()
*/
spin_lock_irqsave(&se_cmd->t_state_lock, flags);
if (se_cmd->transport_state & CMD_T_ABORTED) {
spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
complete(&se_cmd->t_transport_stop_comp);
return 0;
if (cmd->se_cmd.transport_state & CMD_T_ABORTED) {
complete(&cmd->se_cmd.t_transport_stop_comp);
return;
}
spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);

se_cmd->scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD;
INIT_WORK(&cmd->work, tcm_qla2xxx_do_rsp);
queue_work(tcm_qla2xxx_free_wq, &cmd->work);
return 0;
cmd->se_cmd.scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD;
transport_generic_request_failure(&cmd->se_cmd);
return;
}
/*
* We now tell TCM to queue this WRITE CDB with TRANSPORT_PROCESS_WRITE
* status to the backstore processing thread.
*/
return transport_generic_handle_data(&cmd->se_cmd);

return target_execute_cmd(&cmd->se_cmd);
}

/*
* Called from qla_target.c:qlt_do_ctio_completion()
*/
static void tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd)
{
INIT_WORK(&cmd->work, tcm_qla2xxx_handle_data_work);
queue_work(tcm_qla2xxx_free_wq, &cmd->work);
}

/*
Expand Down

0 comments on commit 39eb555

Please sign in to comment.