--- initial
+++ final
@@ -1,99 +1,99 @@
 static struct t10_pr_registration *__core_scsi3_alloc_registration(struct se_device *dev, struct se_node_acl *nacl, struct se_lun *lun, struct se_dev_entry *deve, u64 mapped_lun, unsigned char *isid, u64 sa_res_key, int all_tg_pt, int aptpl) {
   struct se_dev_entry *deve_tmp;
   struct se_node_acl *nacl_tmp;
   struct se_lun_acl *lacl_tmp;
   struct se_lun *lun_tmp, *next, *dest_lun;
   const struct target_core_fabric_ops *tfo = nacl->se_tpg->se_tpg_tfo;
   struct t10_pr_registration *pr_reg, *pr_reg_atp, *pr_reg_tmp, *pr_reg_tmp_safe;
   int ret;
   /*
    * Create a registration for the I_T Nexus upon which the
    * PROUT REGISTER was received.
    */
   pr_reg = __core_scsi3_do_alloc_registration(dev, nacl, lun, deve, mapped_lun, isid, sa_res_key, all_tg_pt, aptpl);
   if (!pr_reg) return NULL;
   /*
    * Return pointer to pr_reg for ALL_TG_PT=0
    */
   if (!all_tg_pt) return pr_reg;
   /*
    * Create list of matching SCSI Initiator Port registrations
    * for ALL_TG_PT=1
    */
   spin_lock(&dev->se_port_lock);
   list_for_each_entry_safe(lun_tmp, next, &dev->dev_sep_list, lun_dev_link) {
     if (!percpu_ref_tryget_live(&lun_tmp->lun_ref)) continue;
     spin_unlock(&dev->se_port_lock);
     spin_lock(&lun_tmp->lun_deve_lock);
     list_for_each_entry(deve_tmp, &lun_tmp->lun_deve_list, lun_link) {
       /*
        * This pointer will be NULL for demo mode MappedLUNs
        * that have not been make explicit via a ConfigFS
        * MappedLUN group for the SCSI Initiator Node ACL.
        */
       if (!deve_tmp->se_lun_acl) continue;
       lacl_tmp = rcu_dereference_check(deve_tmp->se_lun_acl, lockdep_is_held(&lun_tmp->lun_deve_lock));
       nacl_tmp = lacl_tmp->se_lun_nacl;
       /*
        * Skip the matching struct se_node_acl that is allocated
        * above..
        */
       if (nacl == nacl_tmp) continue;
       /*
        * Only perform PR registrations for target ports on
        * the same fabric module as the REGISTER w/ ALL_TG_PT=1
        * arrived.
        */
       if (tfo != nacl_tmp->se_tpg->se_tpg_tfo) continue;
       /*
        * Look for a matching Initiator Node ACL in ASCII format
        */
       if (strcmp(nacl->initiatorname, nacl_tmp->initiatorname)) continue;
       kref_get(&deve_tmp->pr_kref);
       spin_unlock(&lun_tmp->lun_deve_lock);
       /*
        * Grab a configfs group dependency that is released
        * for the exception path at label out: below, or upon
        * completion of adding ALL_TG_PT=1 registrations in
        * __core_scsi3_add_registration()
        */
       ret = core_scsi3_lunacl_depend_item(deve_tmp);
       if (ret < 0) {
         pr_err("core_scsi3_lunacl_depend"
                "_item() failed\n");
         percpu_ref_put(&lun_tmp->lun_ref);
         kref_put(&deve_tmp->pr_kref, target_pr_kref_release);
         goto out;
       }
       /*
        * Located a matching SCSI Initiator Port on a different
        * port, allocate the pr_reg_atp and attach it to the
        * pr_reg->pr_reg_atp_list that will be processed once
        * the original *pr_reg is processed in
        * __core_scsi3_add_registration()
        */
-      dest_lun = rcu_dereference_check(deve_tmp->se_lun, atomic_read(&deve_tmp->pr_kref.refcount) != 0);
+      dest_lun = rcu_dereference_check(deve_tmp->se_lun, kref_read(&deve_tmp->pr_kref) != 0);
       pr_reg_atp = __core_scsi3_do_alloc_registration(dev, nacl_tmp, dest_lun, deve_tmp, deve_tmp->mapped_lun, NULL, sa_res_key, all_tg_pt, aptpl);
       if (!pr_reg_atp) {
         percpu_ref_put(&lun_tmp->lun_ref);
         core_scsi3_lunacl_undepend_item(deve_tmp);
         goto out;
       }
       list_add_tail(&pr_reg_atp->pr_reg_atp_mem_list, &pr_reg->pr_reg_atp_list);
       spin_lock(&lun_tmp->lun_deve_lock);
     }
     spin_unlock(&lun_tmp->lun_deve_lock);
     spin_lock(&dev->se_port_lock);
     percpu_ref_put(&lun_tmp->lun_ref);
   }
   spin_unlock(&dev->se_port_lock);
   return pr_reg;
 out:
   list_for_each_entry_safe(pr_reg_tmp, pr_reg_tmp_safe, &pr_reg->pr_reg_atp_list, pr_reg_atp_mem_list) {
     list_del(&pr_reg_tmp->pr_reg_atp_mem_list);
     core_scsi3_lunacl_undepend_item(pr_reg_tmp->pr_reg_deve);
     kmem_cache_free(t10_pr_reg_cache, pr_reg_tmp);
   }
   kmem_cache_free(t10_pr_reg_cache, pr_reg);
   return NULL;
 }<sep>@@
expression e; 
@@
-               atomic_read(&e.refcount)
+               kref_read(&e)