Lines Matching refs:lun

60 	struct se_lun *lun;  in core_clear_initiator_node_from_tpg()  local
76 lun = deve->se_lun; in core_clear_initiator_node_from_tpg()
78 core_disable_device_list_for_node(lun, NULL, deve->mapped_lun, in core_clear_initiator_node_from_tpg()
132 struct se_lun *lun; in core_tpg_add_node_to_devs() local
137 lun = tpg->tpg_lun_list[i]; in core_tpg_add_node_to_devs()
138 if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) in core_tpg_add_node_to_devs()
143 dev = lun->lun_se_dev; in core_tpg_add_node_to_devs()
164 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, in core_tpg_add_node_to_devs()
168 core_enable_device_list_for_node(lun, NULL, lun->unpacked_lun, in core_tpg_add_node_to_devs()
175 core_scsi3_check_aptpl_registration(dev, tpg, lun, acl, in core_tpg_add_node_to_devs()
176 lun->unpacked_lun); in core_tpg_add_node_to_devs()
335 struct se_lun *lun; in core_tpg_clear_object_luns() local
339 lun = tpg->tpg_lun_list[i]; in core_tpg_clear_object_luns()
341 if ((lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) || in core_tpg_clear_object_luns()
342 (lun->lun_se_dev == NULL)) in core_tpg_clear_object_luns()
346 core_dev_del_lun(tpg, lun); in core_tpg_clear_object_luns()
645 struct se_lun *lun = container_of(ref, struct se_lun, lun_ref); in core_tpg_lun_ref_release() local
647 complete(&lun->lun_ref_comp); in core_tpg_lun_ref_release()
654 struct se_lun *lun = &se_tpg->tpg_virt_lun0; in core_tpg_setup_virtual_lun0() local
658 lun->unpacked_lun = 0; in core_tpg_setup_virtual_lun0()
659 lun->lun_status = TRANSPORT_LUN_STATUS_FREE; in core_tpg_setup_virtual_lun0()
660 atomic_set(&lun->lun_acl_count, 0); in core_tpg_setup_virtual_lun0()
661 init_completion(&lun->lun_shutdown_comp); in core_tpg_setup_virtual_lun0()
662 INIT_LIST_HEAD(&lun->lun_acl_list); in core_tpg_setup_virtual_lun0()
663 spin_lock_init(&lun->lun_acl_lock); in core_tpg_setup_virtual_lun0()
664 spin_lock_init(&lun->lun_sep_lock); in core_tpg_setup_virtual_lun0()
665 init_completion(&lun->lun_ref_comp); in core_tpg_setup_virtual_lun0()
667 ret = core_tpg_add_lun(se_tpg, lun, lun_access, dev); in core_tpg_setup_virtual_lun0()
681 struct se_lun *lun; in core_tpg_register() local
693 lun = se_tpg->tpg_lun_list[i]; in core_tpg_register()
694 lun->unpacked_lun = i; in core_tpg_register()
695 lun->lun_link_magic = SE_LUN_LINK_MAGIC; in core_tpg_register()
696 lun->lun_status = TRANSPORT_LUN_STATUS_FREE; in core_tpg_register()
697 atomic_set(&lun->lun_acl_count, 0); in core_tpg_register()
698 init_completion(&lun->lun_shutdown_comp); in core_tpg_register()
699 INIT_LIST_HEAD(&lun->lun_acl_list); in core_tpg_register()
700 spin_lock_init(&lun->lun_acl_lock); in core_tpg_register()
701 spin_lock_init(&lun->lun_sep_lock); in core_tpg_register()
702 init_completion(&lun->lun_ref_comp); in core_tpg_register()
789 struct se_lun *lun; in core_tpg_alloc_lun() local
801 lun = tpg->tpg_lun_list[unpacked_lun]; in core_tpg_alloc_lun()
802 if (lun->lun_status == TRANSPORT_LUN_STATUS_ACTIVE) { in core_tpg_alloc_lun()
812 return lun; in core_tpg_alloc_lun()
817 struct se_lun *lun, in core_tpg_add_lun() argument
823 ret = percpu_ref_init(&lun->lun_ref, core_tpg_lun_ref_release, 0, in core_tpg_add_lun()
828 ret = core_dev_export(dev, tpg, lun); in core_tpg_add_lun()
830 percpu_ref_exit(&lun->lun_ref); in core_tpg_add_lun()
835 lun->lun_access = lun_access; in core_tpg_add_lun()
836 lun->lun_status = TRANSPORT_LUN_STATUS_ACTIVE; in core_tpg_add_lun()
844 struct se_lun *lun) in core_tpg_remove_lun() argument
846 core_clear_lun_from_tpg(lun, tpg); in core_tpg_remove_lun()
847 transport_clear_lun_ref(lun); in core_tpg_remove_lun()
849 core_dev_unexport(lun->lun_se_dev, tpg, lun); in core_tpg_remove_lun()
852 lun->lun_status = TRANSPORT_LUN_STATUS_FREE; in core_tpg_remove_lun()
855 percpu_ref_exit(&lun->lun_ref); in core_tpg_remove_lun()