aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-01-19 16:39:17 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 17:37:47 -0500
commitc8e31f26feeb03dc6f51bff68135cc58431e099b (patch)
tree8d584fcb7cb7a58988cd2463a9a26f577410e6ac /include/target
parent35b2cdc4fea1f0d13e1602c07e62c797c9fe5ed4 (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 'include/target')
-rw-r--r--include/target/target_core_base.h39
-rw-r--r--include/target/target_core_fabric.h2
2 files changed, 21 insertions, 20 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 41dd91b98907..9d514e06625f 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -169,7 +169,8 @@ enum se_cmd_flags_table {
169 SCF_EMULATED_TASK_SENSE = 0x00000004, 169 SCF_EMULATED_TASK_SENSE = 0x00000004,
170 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, 170 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008,
171 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, 171 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010,
172 SCF_SCSI_NON_DATA_CDB = 0x00000040, 172 SCF_SCSI_NON_DATA_CDB = 0x00000020,
173 SCF_SCSI_TMR_CDB = 0x00000040,
173 SCF_SCSI_CDB_EXCEPTION = 0x00000080, 174 SCF_SCSI_CDB_EXCEPTION = 0x00000080,
174 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, 175 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100,
175 SCF_FUA = 0x00000200, 176 SCF_FUA = 0x00000200,
@@ -498,6 +499,24 @@ struct se_task {
498 struct completion task_stop_comp; 499 struct completion task_stop_comp;
499}; 500};
500 501
502struct se_tmr_req {
503 /* Task Management function to be performed */
504 u8 function;
505 /* Task Management response to send */
506 u8 response;
507 int call_transport;
508 /* Reference to ITT that Task Mgmt should be performed */
509 u32 ref_task_tag;
510 /* 64-bit encoded SAM LUN from $FABRIC_MOD TMR header */
511 u64 ref_task_lun;
512 void *fabric_tmr_ptr;
513 struct se_cmd *task_cmd;
514 struct se_cmd *ref_cmd;
515 struct se_device *tmr_dev;
516 struct se_lun *tmr_lun;
517 struct list_head tmr_list;
518};
519
501struct se_cmd { 520struct se_cmd {
502 /* SAM response code being sent to initiator */ 521 /* SAM response code being sent to initiator */
503 u8 scsi_status; 522 u8 scsi_status;
@@ -586,24 +605,6 @@ struct se_cmd {
586 605
587}; 606};
588 607
589struct se_tmr_req {
590 /* Task Management function to be performed */
591 u8 function;
592 /* Task Management response to send */
593 u8 response;
594 int call_transport;
595 /* Reference to ITT that Task Mgmt should be performed */
596 u32 ref_task_tag;
597 /* 64-bit encoded SAM LUN from $FABRIC_MOD TMR header */
598 u64 ref_task_lun;
599 void *fabric_tmr_ptr;
600 struct se_cmd *task_cmd;
601 struct se_cmd *ref_cmd;
602 struct se_device *tmr_dev;
603 struct se_lun *tmr_lun;
604 struct list_head tmr_list;
605};
606
607struct se_ua { 608struct se_ua {
608 u8 ua_asc; 609 u8 ua_asc;
609 u8 ua_ascq; 610 u8 ua_ascq;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index d36fad317e78..c5c16efe396d 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -139,7 +139,7 @@ void target_wait_for_sess_cmds(struct se_session *, int);
139 139
140int core_alua_check_nonop_delay(struct se_cmd *); 140int core_alua_check_nonop_delay(struct se_cmd *);
141 141
142struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 142int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
143void core_tmr_release_req(struct se_tmr_req *); 143void core_tmr_release_req(struct se_tmr_req *);
144int transport_generic_handle_tmr(struct se_cmd *); 144int transport_generic_handle_tmr(struct se_cmd *);
145int transport_lookup_tmr_lun(struct se_cmd *, u32); 145int transport_lookup_tmr_lun(struct se_cmd *, u32);