aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-10-10 17:37:15 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-11-06 23:55:45 -0500
commitd977f4377fbc396b888e12fdb3b13118b09ca7db (patch)
treef3de282b1df951ec599908e24590dbcbac5b9047 /include/target
parent019c4ca621488739b1bfb7597a14ac7f0cbcc908 (diff)
target: simplify reservations code
We do not support host-level reservations for the pscsi backend, and all virtual backends are newere than SCSI-2, so just make the combined SPC-3 + SCSI-2 support the only supported variant and kill the switches for the different implementations, given that this code handles the no-op version just fine. (hch: Update DRF_SPC2_RESERVATIONS lock usage) Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 15af1307d064..892a93dec19c 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -93,8 +93,6 @@
93 */ 93 */
94#define DA_EMULATE_TPWS 0 94#define DA_EMULATE_TPWS 0
95/* No Emulation for PSCSI by default */ 95/* No Emulation for PSCSI by default */
96#define DA_EMULATE_RESERVATIONS 0
97/* No Emulation for PSCSI by default */
98#define DA_EMULATE_ALUA 0 96#define DA_EMULATE_ALUA 0
99/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ 97/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
100#define DA_ENFORCE_PR_ISIDS 1 98#define DA_ENFORCE_PR_ISIDS 1
@@ -333,18 +331,6 @@ struct t10_wwn {
333 struct list_head t10_vpd_list; 331 struct list_head t10_vpd_list;
334}; 332};
335 333
336
337/*
338 * Used by TCM Core internally to signal if >= SPC-3 persistent reservations
339 * emulation is enabled or disabled, or running in with TCM/pSCSI passthrough
340 * mode
341 */
342typedef enum {
343 SPC_PASSTHROUGH,
344 SPC2_RESERVATIONS,
345 SPC3_PERSISTENT_RESERVATIONS
346} t10_reservations_index_t;
347
348struct t10_pr_registration { 334struct t10_pr_registration {
349 /* Used for fabrics that contain WWN+ISID */ 335 /* Used for fabrics that contain WWN+ISID */
350#define PR_REG_ISID_LEN 16 336#define PR_REG_ISID_LEN 16
@@ -386,18 +372,6 @@ struct t10_pr_registration {
386 struct list_head pr_reg_atp_mem_list; 372 struct list_head pr_reg_atp_mem_list;
387}; 373};
388 374
389/*
390 * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS,
391 * SPC2_RESERVATIONS or SPC_PASSTHROUGH in drivers/target/target_core_pr.c:
392 * core_setup_reservations()
393 */
394struct t10_reservation_ops {
395 int (*t10_reservation_check)(struct se_cmd *, u32 *);
396 int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32);
397 int (*t10_pr_register)(struct se_cmd *);
398 int (*t10_pr_clear)(struct se_cmd *);
399};
400
401struct t10_reservation { 375struct t10_reservation {
402 /* Reservation effects all target ports */ 376 /* Reservation effects all target ports */
403 int pr_all_tg_pt; 377 int pr_all_tg_pt;
@@ -408,7 +382,6 @@ struct t10_reservation {
408#define PR_APTPL_BUF_LEN 8192 382#define PR_APTPL_BUF_LEN 8192
409 u32 pr_aptpl_buf_len; 383 u32 pr_aptpl_buf_len;
410 u32 pr_generation; 384 u32 pr_generation;
411 t10_reservations_index_t res_type;
412 spinlock_t registration_lock; 385 spinlock_t registration_lock;
413 spinlock_t aptpl_reg_lock; 386 spinlock_t aptpl_reg_lock;
414 /* 387 /*
@@ -424,7 +397,6 @@ struct t10_reservation {
424 struct se_node_acl *pr_res_holder; 397 struct se_node_acl *pr_res_holder;
425 struct list_head registration_list; 398 struct list_head registration_list;
426 struct list_head aptpl_reg_list; 399 struct list_head aptpl_reg_list;
427 struct t10_reservation_ops pr_ops;
428}; 400};
429 401
430struct se_tmr_req { 402struct se_tmr_req {
@@ -633,7 +605,6 @@ struct se_dev_attrib {
633 int emulate_tas; 605 int emulate_tas;
634 int emulate_tpu; 606 int emulate_tpu;
635 int emulate_tpws; 607 int emulate_tpws;
636 int emulate_reservations;
637 int emulate_alua; 608 int emulate_alua;
638 int enforce_pr_isids; 609 int enforce_pr_isids;
639 int is_nonrot; 610 int is_nonrot;