hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/target/target_core_fabric.h
....@@ -8,7 +8,18 @@
88
99 struct target_core_fabric_ops {
1010 struct module *module;
11
- const char *name;
11
+ /*
12
+ * XXX: Special case for iscsi/iSCSI...
13
+ * If non-null, fabric_alias is used for matching target/$fabric
14
+ * ConfigFS paths. If null, fabric_name is used for this (see below).
15
+ */
16
+ const char *fabric_alias;
17
+ /*
18
+ * fabric_name is used for matching target/$fabric ConfigFS paths
19
+ * without a fabric_alias (see above). It's also used for the ALUA state
20
+ * path and is stored on disk with PR state.
21
+ */
22
+ const char *fabric_name;
1223 size_t node_acl_size;
1324 /*
1425 * Limits number of scatterlist entries per SCF_SCSI_DATA_CDB payload.
....@@ -23,7 +34,6 @@
2334 * XXX: Currently assumes single PAGE_SIZE per scatterlist entry
2435 */
2536 u32 max_data_sg_nents;
26
- char *(*get_fabric_name)(void);
2737 char *(*tpg_get_wwn)(struct se_portal_group *);
2838 u16 (*tpg_get_tag)(struct se_portal_group *);
2939 u32 (*tpg_get_default_depth)(struct se_portal_group *);
....@@ -64,7 +74,6 @@
6474 u32 (*sess_get_initiator_sid)(struct se_session *,
6575 unsigned char *, u32);
6676 int (*write_pending)(struct se_cmd *);
67
- int (*write_pending_status)(struct se_cmd *);
6877 void (*set_default_node_attributes)(struct se_node_acl *);
6978 int (*get_cmd_state)(struct se_cmd *);
7079 int (*queue_data_in)(struct se_cmd *);
....@@ -101,6 +110,13 @@
101110 struct configfs_attribute **tfc_tpg_nacl_attrib_attrs;
102111 struct configfs_attribute **tfc_tpg_nacl_auth_attrs;
103112 struct configfs_attribute **tfc_tpg_nacl_param_attrs;
113
+
114
+ /*
115
+ * Set this member variable to true if the SCSI transport protocol
116
+ * (e.g. iSCSI) requires that the Data-Out buffer is transferred in
117
+ * its entirety before a command is aborted.
118
+ */
119
+ bool write_pending_must_be_called;
104120 };
105121
106122 int target_register_template(const struct target_core_fabric_ops *fo);
....@@ -126,6 +142,7 @@
126142 struct se_node_acl *, struct se_session *, void *);
127143 ssize_t target_show_dynamic_sessions(struct se_portal_group *, char *);
128144 void transport_free_session(struct se_session *);
145
+void target_spc2_release(struct se_node_acl *nacl);
129146 void target_put_nacl(struct se_node_acl *);
130147 void transport_deregister_session_configfs(struct se_session *);
131148 void transport_deregister_session(struct se_session *);
....@@ -133,9 +150,10 @@
133150
134151 void transport_init_se_cmd(struct se_cmd *,
135152 const struct target_core_fabric_ops *,
136
- struct se_session *, u32, int, int, unsigned char *);
137
-sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u64);
138
-sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *);
153
+ struct se_session *, u32, int, int, unsigned char *, u64);
154
+sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
155
+sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *);
156
+sense_reason_t target_cmd_parse_cdb(struct se_cmd *);
139157 int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *,
140158 unsigned char *, unsigned char *, u64, u32, int, int, int,
141159 struct scatterlist *, u32, struct scatterlist *, u32,
....@@ -149,14 +167,15 @@
149167 int transport_handle_cdb_direct(struct se_cmd *);
150168 sense_reason_t transport_generic_new_cmd(struct se_cmd *);
151169
170
+void target_put_cmd_and_wait(struct se_cmd *cmd);
152171 void target_execute_cmd(struct se_cmd *cmd);
153172
154173 int transport_generic_free_cmd(struct se_cmd *, int);
155174
156175 bool transport_wait_for_tasks(struct se_cmd *);
157
-int transport_check_aborted_status(struct se_cmd *, int);
158176 int transport_send_check_condition_and_sense(struct se_cmd *,
159177 sense_reason_t, int);
178
+int target_send_busy(struct se_cmd *cmd);
160179 int target_get_sess_cmd(struct se_cmd *, bool);
161180 int target_put_sess_cmd(struct se_cmd *);
162181 void target_sess_cmd_list_set_waiting(struct se_session *);
....@@ -169,7 +188,7 @@
169188 void core_tmr_release_req(struct se_tmr_req *);
170189 int transport_generic_handle_tmr(struct se_cmd *);
171190 void transport_generic_request_failure(struct se_cmd *, sense_reason_t);
172
-int transport_lookup_tmr_lun(struct se_cmd *, u64);
191
+int transport_lookup_tmr_lun(struct se_cmd *);
173192 void core_allocate_nexus_loss_ua(struct se_node_acl *acl);
174193
175194 struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg,