aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-12-17 03:18:49 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-01-10 00:48:17 -0500
commitc66094bf325ee406b92298d73089ee25484a0263 (patch)
treecfa2fb231dbd3e120ad2d75f96c250c24233978a /include
parentfbfe858fea2a45df6339eb03dd1715b51f1bdc92 (diff)
target_core_alua: Referrals infrastructure
Add infrastructure for referrals. v2 changes: - Fix unsigned long long division in core_alua_state_lba_dependent on 32-bit (Fengguang + Chen + Hannes) - Fix compile warning in core_alua_state_lba_dependent (nab) - Convert segment_* + sectors variables in core_alua_state_lba_dependent to u64 (Hannes) Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/scsi.h1
-rw-r--r--include/target/target_core_base.h18
2 files changed, 19 insertions, 0 deletions
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 66d42edfb3fc..0a4edfe8af51 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -155,6 +155,7 @@ enum scsi_timeouts {
155/* values for service action in */ 155/* values for service action in */
156#define SAI_READ_CAPACITY_16 0x10 156#define SAI_READ_CAPACITY_16 0x10
157#define SAI_GET_LBA_STATUS 0x12 157#define SAI_GET_LBA_STATUS 0x12
158#define SAI_REPORT_REFERRALS 0x13
158/* values for VARIABLE_LENGTH_CMD service action codes 159/* values for VARIABLE_LENGTH_CMD service action codes
159 * see spc4r17 Section D.3.5, table D.7 and D.8 */ 160 * see spc4r17 Section D.3.5, table D.7 and D.8 */
160#define VLC_SA_RECEIVE_CREDENTIAL 0x1800 161#define VLC_SA_RECEIVE_CREDENTIAL 0x1800
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 6c8001516c6d..1ba19a4bec33 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -247,10 +247,28 @@ typedef enum {
247 247
248struct se_cmd; 248struct se_cmd;
249 249
250struct t10_alua_lba_map_member {
251 struct list_head lba_map_mem_list;
252 int lba_map_mem_alua_state;
253 int lba_map_mem_alua_pg_id;
254};
255
256struct t10_alua_lba_map {
257 u64 lba_map_first_lba;
258 u64 lba_map_last_lba;
259 struct list_head lba_map_list;
260 struct list_head lba_map_mem_list;
261};
262
250struct t10_alua { 263struct t10_alua {
251 /* ALUA Target Port Group ID */ 264 /* ALUA Target Port Group ID */
252 u16 alua_tg_pt_gps_counter; 265 u16 alua_tg_pt_gps_counter;
253 u32 alua_tg_pt_gps_count; 266 u32 alua_tg_pt_gps_count;
267 /* Referrals support */
268 spinlock_t lba_map_lock;
269 u32 lba_map_segment_size;
270 u32 lba_map_segment_multiplier;
271 struct list_head lba_map_list;
254 spinlock_t tg_pt_gps_lock; 272 spinlock_t tg_pt_gps_lock;
255 struct se_device *t10_dev; 273 struct se_device *t10_dev;
256 /* Used for default ALUA Target Port Group */ 274 /* Used for default ALUA Target Port Group */