aboutsummaryrefslogtreecommitdiffstats
path: root/include/target/target_core_fabric.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2012-11-06 15:24:09 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-11-06 23:55:46 -0500
commitde103c93aff0bed0ae984274e5dc8b95899badab (patch)
tree7db9bba755fa95772052e8d31285a38ba48f1a84 /include/target/target_core_fabric.h
parentfecae40abb1ae9218bdbaa8b8e30bfb5ae43f522 (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.h13
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
99void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, 99void 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 *);
101int transport_lookup_cmd_lun(struct se_cmd *, u32); 101sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u32);
102int target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); 102sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *);
103int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, 103int 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);
112int transport_handle_cdb_direct(struct se_cmd *); 112int transport_handle_cdb_direct(struct se_cmd *);
113int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, 113sense_reason_t transport_generic_new_cmd(struct se_cmd *);
114 struct scatterlist *, u32, struct scatterlist *, u32);
115int transport_generic_new_cmd(struct se_cmd *);
116 114
117void target_execute_cmd(struct se_cmd *cmd); 115void target_execute_cmd(struct se_cmd *cmd);
118 116
@@ -120,7 +118,8 @@ void transport_generic_free_cmd(struct se_cmd *, int);
120 118
121bool transport_wait_for_tasks(struct se_cmd *); 119bool transport_wait_for_tasks(struct se_cmd *);
122int transport_check_aborted_status(struct se_cmd *, int); 120int transport_check_aborted_status(struct se_cmd *, int);
123int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 121int transport_send_check_condition_and_sense(struct se_cmd *,
122 sense_reason_t, int);
124 123
125int target_put_sess_cmd(struct se_session *, struct se_cmd *); 124int target_put_sess_cmd(struct se_session *, struct se_cmd *);
126void target_sess_cmd_list_set_waiting(struct se_session *); 125void target_sess_cmd_list_set_waiting(struct se_session *);
@@ -131,7 +130,7 @@ int core_alua_check_nonop_delay(struct se_cmd *);
131int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 130int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
132void core_tmr_release_req(struct se_tmr_req *); 131void core_tmr_release_req(struct se_tmr_req *);
133int transport_generic_handle_tmr(struct se_cmd *); 132int transport_generic_handle_tmr(struct se_cmd *);
134void transport_generic_request_failure(struct se_cmd *); 133void transport_generic_request_failure(struct se_cmd *, sense_reason_t);
135int transport_lookup_tmr_lun(struct se_cmd *, u32); 134int transport_lookup_tmr_lun(struct se_cmd *, u32);
136 135
137struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, 136struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,