diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 22:00:42 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 22:00:42 -0500 |
| commit | 6aad3738f6a79fd0ca480eaceefe064cc471f6eb (patch) | |
| tree | 08fb9ec4824bf3320af01f29fe84b75f814c0fa0 /include | |
| parent | 02ebbbd481635fd3ce7018e5bb19c18c0f1e4561 (diff) | |
| parent | 5bda90c8f20f0af93375721533f4081a40fa6f41 (diff) | |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target: use ->exectute_task for all CDB emulation
target: remove SCF_EMULATE_CDB_ASYNC
target: refactor transport_emulate_control_cdb
target: pass the se_task to the CDB emulation callback
target: split core_scsi3_emulate_pr
target: split core_scsi2_emulate_crh
target: Add generic active I/O shutdown logic
target: add back error handling in transport_complete_task
target/pscsi: blk_make_request() returns an ERR_PTR()
target: Remove core TRANSPORT_FREE_CMD_INTR usage
target: Make TFO->check_stop_free return free status
iscsi-target: Fix non-immediate TMR handling
iscsi-target: Add missing CMDSN_LOWER_THAN_EXP check in iscsit_handle_scsi_cmd
target: Avoid double list_del for aborted se_tmr_req
target: Minor cleanups to core_tmr_drain_tmr_list
target: Fix wrong se_tmr being added to drain_tmr_list
target: Fix incorrect se_cmd assignment in core_tmr_drain_tmr_list
target: Check -ENOMEM to signal QUEUE_FULL from fabric callbacks
tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB
target: Fix compile warning w/ missing module.h include
Diffstat (limited to 'include')
| -rw-r--r-- | include/target/target_core_base.h | 13 | ||||
| -rw-r--r-- | include/target/target_core_device.h | 2 | ||||
| -rw-r--r-- | include/target/target_core_fabric_ops.h | 11 | ||||
| -rw-r--r-- | include/target/target_core_transport.h | 7 |
4 files changed, 25 insertions, 8 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 35aa786f93da..7f5fed3c89e1 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -89,7 +89,6 @@ enum transport_state_table { | |||
| 89 | TRANSPORT_PROCESS_TMR = 9, | 89 | TRANSPORT_PROCESS_TMR = 9, |
| 90 | TRANSPORT_ISTATE_PROCESSING = 11, | 90 | TRANSPORT_ISTATE_PROCESSING = 11, |
| 91 | TRANSPORT_NEW_CMD_MAP = 16, | 91 | TRANSPORT_NEW_CMD_MAP = 16, |
| 92 | TRANSPORT_FREE_CMD_INTR = 17, | ||
| 93 | TRANSPORT_COMPLETE_QF_WP = 18, | 92 | TRANSPORT_COMPLETE_QF_WP = 18, |
| 94 | TRANSPORT_COMPLETE_QF_OK = 19, | 93 | TRANSPORT_COMPLETE_QF_OK = 19, |
| 95 | }; | 94 | }; |
| @@ -115,7 +114,6 @@ enum se_cmd_flags_table { | |||
| 115 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, | 114 | SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, |
| 116 | SCF_UNUSED = 0x00100000, | 115 | SCF_UNUSED = 0x00100000, |
| 117 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, | 116 | SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, |
| 118 | SCF_EMULATE_CDB_ASYNC = 0x01000000, | ||
| 119 | }; | 117 | }; |
| 120 | 118 | ||
| 121 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ | 119 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ |
| @@ -426,6 +424,9 @@ struct se_cmd { | |||
| 426 | enum transport_state_table t_state; | 424 | enum transport_state_table t_state; |
| 427 | /* Transport specific error status */ | 425 | /* Transport specific error status */ |
| 428 | int transport_error_status; | 426 | int transport_error_status; |
| 427 | /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */ | ||
| 428 | int check_release:1; | ||
| 429 | int cmd_wait_set:1; | ||
| 429 | /* See se_cmd_flags_table */ | 430 | /* See se_cmd_flags_table */ |
| 430 | u32 se_cmd_flags; | 431 | u32 se_cmd_flags; |
| 431 | u32 se_ordered_id; | 432 | u32 se_ordered_id; |
| @@ -452,8 +453,10 @@ struct se_cmd { | |||
| 452 | struct se_session *se_sess; | 453 | struct se_session *se_sess; |
| 453 | struct se_tmr_req *se_tmr_req; | 454 | struct se_tmr_req *se_tmr_req; |
| 454 | struct list_head se_queue_node; | 455 | struct list_head se_queue_node; |
| 456 | struct list_head se_cmd_list; | ||
| 457 | struct completion cmd_wait_comp; | ||
| 455 | struct target_core_fabric_ops *se_tfo; | 458 | struct target_core_fabric_ops *se_tfo; |
| 456 | int (*transport_emulate_cdb)(struct se_cmd *); | 459 | int (*execute_task)(struct se_task *); |
| 457 | void (*transport_complete_callback)(struct se_cmd *); | 460 | void (*transport_complete_callback)(struct se_cmd *); |
| 458 | 461 | ||
| 459 | unsigned char *t_task_cdb; | 462 | unsigned char *t_task_cdb; |
| @@ -559,12 +562,16 @@ struct se_node_acl { | |||
| 559 | } ____cacheline_aligned; | 562 | } ____cacheline_aligned; |
| 560 | 563 | ||
| 561 | struct se_session { | 564 | struct se_session { |
| 565 | int sess_tearing_down:1; | ||
| 562 | u64 sess_bin_isid; | 566 | u64 sess_bin_isid; |
| 563 | struct se_node_acl *se_node_acl; | 567 | struct se_node_acl *se_node_acl; |
| 564 | struct se_portal_group *se_tpg; | 568 | struct se_portal_group *se_tpg; |
| 565 | void *fabric_sess_ptr; | 569 | void *fabric_sess_ptr; |
| 566 | struct list_head sess_list; | 570 | struct list_head sess_list; |
| 567 | struct list_head sess_acl_list; | 571 | struct list_head sess_acl_list; |
| 572 | struct list_head sess_cmd_list; | ||
| 573 | struct list_head sess_wait_list; | ||
| 574 | spinlock_t sess_cmd_lock; | ||
| 568 | } ____cacheline_aligned; | 575 | } ____cacheline_aligned; |
| 569 | 576 | ||
| 570 | struct se_device; | 577 | struct se_device; |
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h index 46571912086c..2be31ff8763b 100644 --- a/include/target/target_core_device.h +++ b/include/target/target_core_device.h | |||
| @@ -17,7 +17,7 @@ extern int core_dev_export(struct se_device *, struct se_portal_group *, | |||
| 17 | struct se_lun *); | 17 | struct se_lun *); |
| 18 | extern void core_dev_unexport(struct se_device *, struct se_portal_group *, | 18 | extern void core_dev_unexport(struct se_device *, struct se_portal_group *, |
| 19 | struct se_lun *); | 19 | struct se_lun *); |
| 20 | extern int transport_core_report_lun_response(struct se_cmd *); | 20 | extern int target_report_luns(struct se_task *); |
| 21 | extern void se_release_device_for_hba(struct se_device *); | 21 | extern void se_release_device_for_hba(struct se_device *); |
| 22 | extern void se_release_vpd_for_dev(struct se_device *); | 22 | extern void se_release_vpd_for_dev(struct se_device *); |
| 23 | extern void se_clear_dev_ports(struct se_device *); | 23 | extern void se_clear_dev_ports(struct se_device *); |
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h index 126c675f4f14..0256825f923d 100644 --- a/include/target/target_core_fabric_ops.h +++ b/include/target/target_core_fabric_ops.h | |||
| @@ -46,9 +46,16 @@ struct target_core_fabric_ops { | |||
| 46 | int (*new_cmd_map)(struct se_cmd *); | 46 | int (*new_cmd_map)(struct se_cmd *); |
| 47 | /* | 47 | /* |
| 48 | * Optional to release struct se_cmd and fabric dependent allocated | 48 | * Optional to release struct se_cmd and fabric dependent allocated |
| 49 | * I/O descriptor in transport_cmd_check_stop() | 49 | * I/O descriptor in transport_cmd_check_stop(). |
| 50 | * | ||
| 51 | * Returning 1 will signal a descriptor has been released. | ||
| 52 | * Returning 0 will signal a descriptor has not been released. | ||
| 50 | */ | 53 | */ |
| 51 | void (*check_stop_free)(struct se_cmd *); | 54 | int (*check_stop_free)(struct se_cmd *); |
| 55 | /* | ||
| 56 | * Optional check for active I/O shutdown | ||
| 57 | */ | ||
| 58 | int (*check_release_cmd)(struct se_cmd *); | ||
| 52 | void (*release_cmd)(struct se_cmd *); | 59 | void (*release_cmd)(struct se_cmd *); |
| 53 | /* | 60 | /* |
| 54 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. | 61 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. |
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index a037a1a6fbba..c16e9431dd01 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h | |||
| @@ -160,17 +160,20 @@ extern int transport_generic_handle_cdb_map(struct se_cmd *); | |||
| 160 | extern int transport_generic_handle_data(struct se_cmd *); | 160 | extern int transport_generic_handle_data(struct se_cmd *); |
| 161 | extern void transport_new_cmd_failure(struct se_cmd *); | 161 | extern void transport_new_cmd_failure(struct se_cmd *); |
| 162 | extern int transport_generic_handle_tmr(struct se_cmd *); | 162 | extern int transport_generic_handle_tmr(struct se_cmd *); |
| 163 | extern void transport_generic_free_cmd_intr(struct se_cmd *); | ||
| 164 | extern bool target_stop_task(struct se_task *task, unsigned long *flags); | 163 | extern bool target_stop_task(struct se_task *task, unsigned long *flags); |
| 165 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, | 164 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, |
| 166 | struct scatterlist *, u32); | 165 | struct scatterlist *, u32); |
| 167 | extern int transport_clear_lun_from_sessions(struct se_lun *); | 166 | extern int transport_clear_lun_from_sessions(struct se_lun *); |
| 168 | extern void transport_wait_for_tasks(struct se_cmd *); | 167 | extern bool transport_wait_for_tasks(struct se_cmd *); |
| 169 | extern int transport_check_aborted_status(struct se_cmd *, int); | 168 | extern int transport_check_aborted_status(struct se_cmd *, int); |
| 170 | extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); | 169 | extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); |
| 171 | extern void transport_send_task_abort(struct se_cmd *); | 170 | extern void transport_send_task_abort(struct se_cmd *); |
| 172 | extern void transport_release_cmd(struct se_cmd *); | 171 | extern void transport_release_cmd(struct se_cmd *); |
| 173 | extern void transport_generic_free_cmd(struct se_cmd *, int); | 172 | extern void transport_generic_free_cmd(struct se_cmd *, int); |
| 173 | extern void target_get_sess_cmd(struct se_session *, struct se_cmd *); | ||
| 174 | extern int target_put_sess_cmd(struct se_session *, struct se_cmd *); | ||
| 175 | extern void target_splice_sess_cmd_list(struct se_session *); | ||
| 176 | extern void target_wait_for_sess_cmds(struct se_session *, int); | ||
| 174 | extern void transport_generic_wait_for_cmds(struct se_cmd *, int); | 177 | extern void transport_generic_wait_for_cmds(struct se_cmd *, int); |
| 175 | extern void transport_do_task_sg_chain(struct se_cmd *); | 178 | extern void transport_do_task_sg_chain(struct se_cmd *); |
| 176 | extern void transport_generic_process_write(struct se_cmd *); | 179 | extern void transport_generic_process_write(struct se_cmd *); |
