summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_configfs.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-04-02 12:58:06 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2019-04-12 20:20:05 -0400
commitfae43461f8f227a83f8edc3b15325188b56aa023 (patch)
treee2162b9477b0bf0757a4df8a0783383845de9cc7 /drivers/target/target_core_configfs.c
parent63f7479439c95bcd49b7dd4af809862c316c71a3 (diff)
scsi: target/core: Rework the SPC-2 reservation handling code
Instead of tracking the initiator that established an SPC-2 reservation, track the session through which the SPC-2 reservation has been established. This patch does not change any functionality. Cc: Mike Christie <mchristi@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.com> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
-rw-r--r--drivers/target/target_core_configfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 3fe79875b3ac..db2558fe8d46 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -1624,11 +1624,12 @@ static ssize_t target_core_dev_pr_show_spc3_res(struct se_device *dev,
static ssize_t target_core_dev_pr_show_spc2_res(struct se_device *dev,
char *page)
{
+ struct se_session *sess = dev->reservation_holder;
struct se_node_acl *se_nacl;
ssize_t len;
- se_nacl = dev->dev_reserved_node_acl;
- if (se_nacl) {
+ if (sess) {
+ se_nacl = sess->se_node_acl;
len = sprintf(page,
"SPC-2 Reservation: %s Initiator: %s\n",
se_nacl->se_tpg->se_tpg_tfo->fabric_name,