: Add support for PRIN SA READ_FULL_STATUS
PATCH 3/4 : Add support for PRIN SA READ_FULL_STATUS
Quoted 1 line
From
652c67d6ff1cfbb5a2e42613f65854b7993bba3eMon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Fri, 30 Jan 2009 00:29:32 -0800
Subject: [PATCH 3/4] [Target_Core_Mod/PERSISTENT_RESERVATION]: Add support for PRIN SA READ_FULL_STATUS
This patch adds support for PRIN Service Action READ_FULL_STATUS as defined by spc4r17. This patch adds struct target_core_fabric_ops->tpg_get_pr_transport_id() and struct target_core_fabric_ops->tpg_get_pr_transport_id_len() for this purpose as calls into loaded $FABRIC_MOD SCSI Target Ports and Logical Units from the Target_Core_Mod/ConfigFS SCSI device server.
This patch defines the $FABRIC_MOD independent aspects of Target_Core_Mod/ConfigFS SPC-3 compliant Persistent Reservations support. Here is what it looks like with multiple PR registrations from two different Linux/iSCSI Initiatior nodes with a WRITE_EXCLUSIVE reservation held:
opensuse:~# sg_persist -in --read-full-status -v /dev/sdb
Persistent Reservation In cmd: 5e 03 00 00 00 00 00 20 00 00
PR generation=0x2
Key=0x5678efff
All target ports bit set
<< Reservation holder >>
scope: LU_SCOPE, type: Write Exclusive
Transport Id of initiator:
iSCSI world wide unique port id: iqn.1993-08.org.debian:01:2dadf92d0ef
Key=0x1234ffff
All target ports bit clear
Relative port address: 0x1
not reservation holder
Transport Id of initiator:
iSCSI world wide unique port id: iqn.1996-04.de.suse:01:1661f9ee7b5Tested with ALL_TG_PT=[1,0] bits using sg_persist on v2.6.29-rc2 32-bit HVM
--- drivers/lio-core/target_core_base.h | 1 + drivers/lio-core/target_core_fabric_ops.h | 4 +- drivers/lio-core/target_core_pr.c | 129 ++++++++++++++++++++++++++++- 3 files changed, 130 insertions(+), 4 deletions(-)
drivers/lio-core/target_core_base.h +1 -0
@@ -225,6 +225,7 @@ typedef struct t10_reservation_template_s { typedef struct t10_pr_registration_s { int pr_reg_all_tg_pt; /* Reservation effects all target ports */ + int pr_res_holder; int pr_res_type; int pr_res_scope; u32 pr_res_generation;
drivers/lio-core/target_core_fabric_ops.h +3 -1
@@ -1,8 +1,10 @@struct target_core_fabric_ops {char *(*get_fabric_name)(void );char *(*tpg_get_wwn)(struct se_portal_group_s *); -u32 (*tpg_get_tag)(struct se_portal_group_s *); +u16 (*tpg_get_tag)(struct se_portal_group_s *);u32 (*tpg_get_default_depth)(struct se_portal_group_s *); +u32 (*tpg_get_pr_transport_id)(struct se_portal_group_s *,struct se_node_acl_s *,int *,unsigned char *); +u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group_s *,struct se_node_acl_s *,int *);int (*tpg_check_demo_mode)(struct se_portal_group_s *);int (*tpg_check_demo_mode_cache)(struct se_portal_group_s *);int (*tpg_check_demo_mode_write_protect)(struct se_portal_group_s *);
drivers/lio-core/target_core_pr.c +126 -3
157 lines not on this page · raw message
Signature · 1 line
1.5.4.1