diff options
author | Christoph Hellwig <hch@lst.de> | 2012-11-06 15:24:09 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-06 23:55:46 -0500 |
commit | de103c93aff0bed0ae984274e5dc8b95899badab (patch) | |
tree | 7db9bba755fa95772052e8d31285a38ba48f1a84 /include/target/target_core_fabric.h | |
parent | fecae40abb1ae9218bdbaa8b8e30bfb5ae43f522 (diff) |
target: pass sense_reason as a return value
Pass the sense reason as an explicit return value from the I/O submission
path instead of storing it in struct se_cmd and using negative return
values. This cleans up a lot of the code pathes, and with the sparse
annotations for the new sense_reason_t type allows for much better
error checking.
(nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
sense_reason_t with Roland's MODE SELECT changes)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target/target_core_fabric.h')
-rw-r--r-- | include/target/target_core_fabric.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 81ddb4ae6c3f..9087b200e552 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -98,8 +98,8 @@ void transport_deregister_session(struct se_session *); | |||
98 | 98 | ||
99 | void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, | 99 | void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, |
100 | struct se_session *, u32, int, int, unsigned char *); | 100 | struct se_session *, u32, int, int, unsigned char *); |
101 | int transport_lookup_cmd_lun(struct se_cmd *, u32); | 101 | sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u32); |
102 | int target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); | 102 | sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); |
103 | int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, | 103 | int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, |
104 | unsigned char *, unsigned char *, u32, u32, int, int, int, | 104 | unsigned char *, unsigned char *, u32, u32, int, int, int, |
105 | struct scatterlist *, u32, struct scatterlist *, u32); | 105 | struct scatterlist *, u32, struct scatterlist *, u32); |
@@ -110,9 +110,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, | |||
110 | void *fabric_tmr_ptr, unsigned char tm_type, | 110 | void *fabric_tmr_ptr, unsigned char tm_type, |
111 | gfp_t, unsigned int, int); | 111 | gfp_t, unsigned int, int); |
112 | int transport_handle_cdb_direct(struct se_cmd *); | 112 | int transport_handle_cdb_direct(struct se_cmd *); |
113 | int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, | 113 | sense_reason_t transport_generic_new_cmd(struct se_cmd *); |
114 | struct scatterlist *, u32, struct scatterlist *, u32); | ||
115 | int transport_generic_new_cmd(struct se_cmd *); | ||
116 | 114 | ||
117 | void target_execute_cmd(struct se_cmd *cmd); | 115 | void target_execute_cmd(struct se_cmd *cmd); |
118 | 116 | ||
@@ -120,7 +118,8 @@ void transport_generic_free_cmd(struct se_cmd *, int); | |||
120 | 118 | ||
121 | bool transport_wait_for_tasks(struct se_cmd *); | 119 | bool transport_wait_for_tasks(struct se_cmd *); |
122 | int transport_check_aborted_status(struct se_cmd *, int); | 120 | int transport_check_aborted_status(struct se_cmd *, int); |
123 | int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); | 121 | int transport_send_check_condition_and_sense(struct se_cmd *, |
122 | sense_reason_t, int); | ||
124 | 123 | ||
125 | int target_put_sess_cmd(struct se_session *, struct se_cmd *); | 124 | int target_put_sess_cmd(struct se_session *, struct se_cmd *); |
126 | void target_sess_cmd_list_set_waiting(struct se_session *); | 125 | void target_sess_cmd_list_set_waiting(struct se_session *); |
@@ -131,7 +130,7 @@ int core_alua_check_nonop_delay(struct se_cmd *); | |||
131 | int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); | 130 | int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); |
132 | void core_tmr_release_req(struct se_tmr_req *); | 131 | void core_tmr_release_req(struct se_tmr_req *); |
133 | int transport_generic_handle_tmr(struct se_cmd *); | 132 | int transport_generic_handle_tmr(struct se_cmd *); |
134 | void transport_generic_request_failure(struct se_cmd *); | 133 | void transport_generic_request_failure(struct se_cmd *, sense_reason_t); |
135 | int transport_lookup_tmr_lun(struct se_cmd *, u32); | 134 | int transport_lookup_tmr_lun(struct se_cmd *, u32); |
136 | 135 | ||
137 | struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, | 136 | struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, |