target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 27 Mar 2015 04:51:03 +0000 (04:51 +0000)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 1 Jun 2015 07:24:12 +0000 (00:24 -0700)
commit79dc9c9e865a7f8c14737453f112ced25deafdef
tree3b2ed302eecee3319868fc5f29c7ecfea1f8f27e
parent80bfdfa92481d431b199eff72788588d13a3988f
target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

This patch changes __core_scsi3_do_alloc_registration() code to
drop pr_reg->pr_reg_tg_pt_lun pointer usage in favor of a new
pr_reg RPTI + existing pr_reg->pr_aptpl_target_lun used by
APTPL metadata logic.

It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL
feature bit codepaths to use rcu_dereference_check() with the
expected non-zero se_dev_entry->pr_kref reference held.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_configfs.c
drivers/target/target_core_pr.c
include/target/target_core_base.h