diff options
author | Andy Grover <agrover@redhat.com> | 2011-07-19 06:26:37 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 05:37:43 -0400 |
commit | 5951146dea1ac8ff2f177477c907084d63913cad (patch) | |
tree | 699cb7c498ca1799ae3e349cb4360171d9fa63e0 /include/target | |
parent | f22c119683e73498d8126581a1be75e1b7a339a3 (diff) |
target: More core cleanups from AGrover (round 2)
This patch contains the squashed version of second round of target core
cleanups and simplifications and Andy and Co. It also contains a handful
of fixes to address bugs the original series and other minor cleanups.
Here is the condensed shortlog:
target: Remove unneeded casts to void*
target: Rename get_lun_for_{cmd,tmr} to lookup_{cmd,tmr}_lun
target: Make t_task a member of se_cmd, not a pointer
target: Handle functions returning "-2"
target: Use cmd->se_dev over cmd->se_lun->lun_se_dev
target: Embed qr in struct se_cmd
target: Replace embedded struct se_queue_req with a list_head
target: Rename list_heads that are nodes in struct se_cmd to "*_node"
target: Fold transport_device_setup_cmd() into lookup_{tmr,cmd}_lun()
target: Make t_mem_list and t_mem_list_bidi members of t_task
target: Add comment & cleanup transport_map_sg_to_mem()
target: Remove unneeded checks in transport_free_pages()
(Roland: Fix se_queue_req removal leftovers OOPs)
(nab: Fix transport_lookup_tmr_lun failure case)
(nab: Fix list_empty(&cmd->t_task.t_mem_bidi_list) inversion bugs)
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 17 | ||||
-rw-r--r-- | include/target/target_core_device.h | 4 | ||||
-rw-r--r-- | include/target/target_core_transport.h | 1 |
3 files changed, 10 insertions, 12 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index b0b83edbe453..94c838dcfc3c 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -123,7 +123,7 @@ enum se_cmd_flags_table { | |||
123 | SCF_SENT_DELAYED_TAS = 0x00020000, | 123 | SCF_SENT_DELAYED_TAS = 0x00020000, |
124 | SCF_ALUA_NON_OPTIMIZED = 0x00040000, | 124 | SCF_ALUA_NON_OPTIMIZED = 0x00040000, |
125 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, | 125 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, |
126 | SCF_PASSTHROUGH_SG_TO_MEM = 0x00100000, | 126 | SCF_UNUSED = 0x00100000, |
127 | SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000, | 127 | SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000, |
128 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, | 128 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, |
129 | SCF_EMULATE_SYNC_CACHE = 0x00800000, | 129 | SCF_EMULATE_SYNC_CACHE = 0x00800000, |
@@ -452,9 +452,9 @@ struct se_transport_task { | |||
452 | * and other HW target mode fabric modules. | 452 | * and other HW target mode fabric modules. |
453 | */ | 453 | */ |
454 | struct scatterlist *t_task_pt_sgl; | 454 | struct scatterlist *t_task_pt_sgl; |
455 | struct list_head *t_mem_list; | 455 | struct list_head t_mem_list; |
456 | /* Used for BIDI READ */ | 456 | /* Used for BIDI READ */ |
457 | struct list_head *t_mem_bidi_list; | 457 | struct list_head t_mem_bidi_list; |
458 | struct list_head t_task_list; | 458 | struct list_head t_task_list; |
459 | } ____cacheline_aligned; | 459 | } ____cacheline_aligned; |
460 | 460 | ||
@@ -523,9 +523,9 @@ struct se_cmd { | |||
523 | atomic_t transport_sent; | 523 | atomic_t transport_sent; |
524 | /* Used for sense data */ | 524 | /* Used for sense data */ |
525 | void *sense_buffer; | 525 | void *sense_buffer; |
526 | struct list_head se_delayed_list; | 526 | struct list_head se_delayed_node; |
527 | struct list_head se_ordered_list; | 527 | struct list_head se_ordered_node; |
528 | struct list_head se_lun_list; | 528 | struct list_head se_lun_node; |
529 | struct se_device *se_dev; | 529 | struct se_device *se_dev; |
530 | struct se_dev_entry *se_deve; | 530 | struct se_dev_entry *se_deve; |
531 | struct se_device *se_obj_ptr; | 531 | struct se_device *se_obj_ptr; |
@@ -534,9 +534,8 @@ struct se_cmd { | |||
534 | /* Only used for internal passthrough and legacy TCM fabric modules */ | 534 | /* Only used for internal passthrough and legacy TCM fabric modules */ |
535 | struct se_session *se_sess; | 535 | struct se_session *se_sess; |
536 | struct se_tmr_req *se_tmr_req; | 536 | struct se_tmr_req *se_tmr_req; |
537 | /* t_task is setup to t_task_backstore in transport_init_se_cmd() */ | 537 | struct se_transport_task t_task; |
538 | struct se_transport_task *t_task; | 538 | struct list_head se_queue_node; |
539 | struct se_transport_task t_task_backstore; | ||
540 | struct target_core_fabric_ops *se_tfo; | 539 | struct target_core_fabric_ops *se_tfo; |
541 | int (*transport_emulate_cdb)(struct se_cmd *); | 540 | int (*transport_emulate_cdb)(struct se_cmd *); |
542 | void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); | 541 | void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); |
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h index d9745bfa4429..96586cc94984 100644 --- a/include/target/target_core_device.h +++ b/include/target/target_core_device.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef TARGET_CORE_DEVICE_H | 1 | #ifndef TARGET_CORE_DEVICE_H |
2 | #define TARGET_CORE_DEVICE_H | 2 | #define TARGET_CORE_DEVICE_H |
3 | 3 | ||
4 | extern int transport_get_lun_for_cmd(struct se_cmd *, u32); | 4 | extern int transport_lookup_cmd_lun(struct se_cmd *, u32); |
5 | extern int transport_get_lun_for_tmr(struct se_cmd *, u32); | 5 | extern int transport_lookup_tmr_lun(struct se_cmd *, u32); |
6 | extern struct se_dev_entry *core_get_se_deve_from_rtpi( | 6 | extern struct se_dev_entry *core_get_se_deve_from_rtpi( |
7 | struct se_node_acl *, u16); | 7 | struct se_node_acl *, u16); |
8 | extern int core_free_device_list_for_node(struct se_node_acl *, | 8 | extern int core_free_device_list_for_node(struct se_node_acl *, |
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index 1dd4d1841497..acd591491767 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h | |||
@@ -159,7 +159,6 @@ extern struct se_device *transport_add_device_to_core_hba(struct se_hba *, | |||
159 | struct se_subsystem_dev *, u32, | 159 | struct se_subsystem_dev *, u32, |
160 | void *, struct se_dev_limits *, | 160 | void *, struct se_dev_limits *, |
161 | const char *, const char *); | 161 | const char *, const char *); |
162 | extern void transport_device_setup_cmd(struct se_cmd *); | ||
163 | extern void transport_init_se_cmd(struct se_cmd *, | 162 | extern void transport_init_se_cmd(struct se_cmd *, |
164 | struct target_core_fabric_ops *, | 163 | struct target_core_fabric_ops *, |
165 | struct se_session *, u32, int, int, | 164 | struct se_session *, u32, int, int, |