@@ -1109,13 +1109,13 @@ static void pscsi_req_done(struct request *req, int uptodate)
switch (host_byte(pt->pscsi_result)) {
case DID_OK:
- target_complete_cmd(cmd, cmd->scsi_status);
+ target_complete_ios(&cmd->t_iostate, cmd->scsi_status);
break;
default:
pr_debug("PSCSI Host Byte exception at cmd: %p CDB:"
" 0x%02x Result: 0x%08x\n", cmd, pt->pscsi_cdb[0],
pt->pscsi_result);
- target_complete_cmd(cmd, SAM_STAT_CHECK_CONDITION);
+ target_complete_ios(&cmd->t_iostate, SAM_STAT_CHECK_CONDITION);
break;
}
@@ -714,7 +714,6 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
cmd->scsi_status = scsi_status;
-
spin_lock_irqsave(&cmd->t_state_lock, flags);
cmd->transport_state &= ~CMD_T_BUSY;
@@ -752,6 +751,14 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
}
EXPORT_SYMBOL(target_complete_cmd);
+void target_complete_ios(struct target_iostate *ios, u16 scsi_status)
+{
+ struct se_cmd *cmd = container_of(ios, struct se_cmd, t_iostate);
+
+ target_complete_cmd(cmd, scsi_status);
+}
+EXPORT_SYMBOL(target_complete_ios);
+
void target_complete_cmd_with_length(struct se_cmd *cmd, u8 scsi_status, int length)
{
if (scsi_status == SAM_STAT_GOOD && length < cmd->t_iostate.data_length) {
@@ -601,7 +601,7 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry *
se_cmd->t_iostate.data_direction);
}
- target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status);
+ target_complete_ios(&cmd->se_cmd->t_iostate, entry->rsp.scsi_status);
cmd->se_cmd = NULL;
kmem_cache_free(tcmu_cmd_cache, cmd);
@@ -680,7 +680,7 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data)
return 0;
set_bit(TCMU_CMD_BIT_EXPIRED, &cmd->flags);
- target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION);
+ target_complete_ios(&cmd->se_cmd->t_iostate, SAM_STAT_CHECK_CONDITION);
cmd->se_cmd = NULL;
kmem_cache_free(tcmu_cmd_cache, cmd);
@@ -58,6 +58,7 @@ void target_backend_unregister(const struct target_backend_ops *);
void target_complete_cmd(struct se_cmd *, u8);
void target_complete_cmd_with_length(struct se_cmd *, u8, int);
+void target_complete_ios(struct target_iostate *, u16);
sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size);
sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd);