Commit 64f1db38 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nicholas Bellinger

target: remove control CDB flags

We don't need three flags to classifiy the CDB as we can check for a NULL S/G
list for a dataless command, and can infer from the absence of the data flag
that we deal with a control CDB.  Also remove the _SG_IO from the data CDB
flag as all I/O is dont on S/G lists now.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent cb4f4d3c
...@@ -211,12 +211,11 @@ static void tcm_loop_submission_work(struct work_struct *work) ...@@ -211,12 +211,11 @@ static void tcm_loop_submission_work(struct work_struct *work)
/* /*
* Because some userspace code via scsi-generic do not memset their * Because some userspace code via scsi-generic do not memset their
* associated read buffers, go ahead and do that here for type * associated read buffers, go ahead and do that here for type
* SCF_SCSI_CONTROL_SG_IO_CDB. Also note that this is currently * non-data CDBs. Also note that this is currently guaranteed to be a
* guaranteed to be a single SGL for SCF_SCSI_CONTROL_SG_IO_CDB * single SGL for this case by target core in
* by target core in target_setup_cmd_from_cdb() -> * target_setup_cmd_from_cdb() -> transport_generic_cmd_sequencer().
* transport_generic_cmd_sequencer().
*/ */
if (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB && if (!(se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) &&
se_cmd->data_direction == DMA_FROM_DEVICE) { se_cmd->data_direction == DMA_FROM_DEVICE) {
struct scatterlist *sg = scsi_sglist(sc); struct scatterlist *sg = scsi_sglist(sc);
unsigned char *buf = kmap(sg_page(sg)) + sg->offset; unsigned char *buf = kmap(sg_page(sg)) + sg->offset;
......
...@@ -1042,7 +1042,7 @@ static int pscsi_execute_cmd(struct se_cmd *cmd, struct scatterlist *sgl, ...@@ -1042,7 +1042,7 @@ static int pscsi_execute_cmd(struct se_cmd *cmd, struct scatterlist *sgl,
memcpy(pt->pscsi_cdb, cmd->t_task_cdb, memcpy(pt->pscsi_cdb, cmd->t_task_cdb,
scsi_command_size(cmd->t_task_cdb)); scsi_command_size(cmd->t_task_cdb));
if (cmd->se_cmd_flags & SCF_SCSI_NON_DATA_CDB) { if (!sgl) {
req = blk_get_request(pdv->pdv_sd->request_queue, req = blk_get_request(pdv->pdv_sd->request_queue,
(data_direction == DMA_TO_DEVICE), (data_direction == DMA_TO_DEVICE),
GFP_KERNEL); GFP_KERNEL);
......
This diff is collapsed.
...@@ -215,7 +215,7 @@ int ft_write_pending(struct se_cmd *se_cmd) ...@@ -215,7 +215,7 @@ int ft_write_pending(struct se_cmd *se_cmd)
*/ */
if ((ep->xid <= lport->lro_xid) && if ((ep->xid <= lport->lro_xid) &&
(fh->fh_r_ctl == FC_RCTL_DD_DATA_DESC)) { (fh->fh_r_ctl == FC_RCTL_DD_DATA_DESC)) {
if ((se_cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) && if ((se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) &&
lport->tt.ddp_target(lport, ep->xid, lport->tt.ddp_target(lport, ep->xid,
se_cmd->t_data_sg, se_cmd->t_data_sg,
se_cmd->t_data_nents)) se_cmd->t_data_nents))
......
...@@ -160,25 +160,22 @@ enum se_cmd_flags_table { ...@@ -160,25 +160,22 @@ enum se_cmd_flags_table {
SCF_SUPPORTED_SAM_OPCODE = 0x00000001, SCF_SUPPORTED_SAM_OPCODE = 0x00000001,
SCF_TRANSPORT_TASK_SENSE = 0x00000002, SCF_TRANSPORT_TASK_SENSE = 0x00000002,
SCF_EMULATED_TASK_SENSE = 0x00000004, SCF_EMULATED_TASK_SENSE = 0x00000004,
SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, SCF_SCSI_DATA_CDB = 0x00000008,
SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, SCF_SCSI_TMR_CDB = 0x00000010,
SCF_SCSI_NON_DATA_CDB = 0x00000020, SCF_SCSI_CDB_EXCEPTION = 0x00000020,
SCF_SCSI_TMR_CDB = 0x00000040, SCF_SCSI_RESERVATION_CONFLICT = 0x00000040,
SCF_SCSI_CDB_EXCEPTION = 0x00000080, SCF_FUA = 0x00000080,
SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, SCF_SE_LUN_CMD = 0x00000100,
SCF_FUA = 0x00000200, SCF_SE_ALLOW_EOO = 0x00000200,
SCF_SE_LUN_CMD = 0x00000800, SCF_BIDI = 0x00000400,
SCF_SE_ALLOW_EOO = 0x00001000, SCF_SENT_CHECK_CONDITION = 0x00000800,
SCF_BIDI = 0x00002000, SCF_OVERFLOW_BIT = 0x00001000,
SCF_SENT_CHECK_CONDITION = 0x00004000, SCF_UNDERFLOW_BIT = 0x00002000,
SCF_OVERFLOW_BIT = 0x00008000, SCF_SENT_DELAYED_TAS = 0x00004000,
SCF_UNDERFLOW_BIT = 0x00010000, SCF_ALUA_NON_OPTIMIZED = 0x00008000,
SCF_SENT_DELAYED_TAS = 0x00020000, SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00010000,
SCF_ALUA_NON_OPTIMIZED = 0x00040000, SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000,
SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, SCF_ACK_KREF = 0x00040000,
SCF_UNUSED = 0x00100000,
SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00200000,
SCF_ACK_KREF = 0x00400000,
}; };
/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment