Lines Matching refs:tpg
58 struct se_portal_group *tpg) in core_clear_initiator_node_from_tpg() argument
74 tpg->se_tpg_tfo->get_fabric_name()); in core_clear_initiator_node_from_tpg()
81 TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); in core_clear_initiator_node_from_tpg()
93 struct se_portal_group *tpg, in __core_tpg_get_initiator_node_acl() argument
98 list_for_each_entry(acl, &tpg->acl_node_list, acl_list) { in __core_tpg_get_initiator_node_acl()
111 struct se_portal_group *tpg, in core_tpg_get_initiator_node_acl() argument
116 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_get_initiator_node_acl()
117 acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_get_initiator_node_acl()
118 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_get_initiator_node_acl()
129 struct se_portal_group *tpg) in core_tpg_add_node_to_devs() argument
136 spin_lock(&tpg->tpg_lun_lock); in core_tpg_add_node_to_devs()
138 lun = tpg->tpg_lun_list[i]; in core_tpg_add_node_to_devs()
142 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_add_node_to_devs()
149 if (!tpg->se_tpg_tfo->tpg_check_demo_mode_write_protect(tpg)) { in core_tpg_add_node_to_devs()
167 tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_add_node_to_devs()
168 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, in core_tpg_add_node_to_devs()
173 lun_access, acl, tpg, 1); in core_tpg_add_node_to_devs()
174 spin_lock(&tpg->tpg_lun_lock); in core_tpg_add_node_to_devs()
176 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_add_node_to_devs()
184 struct se_portal_group *tpg, in core_set_queue_depth_for_node() argument
189 "defaulting to 1.\n", tpg->se_tpg_tfo->get_fabric_name(), in core_set_queue_depth_for_node()
259 struct se_portal_group *tpg, in core_tpg_check_initiator_node_acl() argument
264 acl = core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_check_initiator_node_acl()
268 if (!tpg->se_tpg_tfo->tpg_check_demo_mode(tpg)) in core_tpg_check_initiator_node_acl()
271 acl = tpg->se_tpg_tfo->tpg_alloc_fabric_acl(tpg); in core_tpg_check_initiator_node_acl()
282 acl->queue_depth = tpg->se_tpg_tfo->tpg_get_default_depth(tpg); in core_tpg_check_initiator_node_acl()
284 acl->se_tpg = tpg; in core_tpg_check_initiator_node_acl()
289 tpg->se_tpg_tfo->set_default_node_attributes(acl); in core_tpg_check_initiator_node_acl()
292 tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl); in core_tpg_check_initiator_node_acl()
296 if (core_set_queue_depth_for_node(tpg, acl) < 0) { in core_tpg_check_initiator_node_acl()
297 core_free_device_list_for_node(acl, tpg); in core_tpg_check_initiator_node_acl()
298 tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl); in core_tpg_check_initiator_node_acl()
306 if ((tpg->se_tpg_tfo->tpg_check_demo_mode_login_only != NULL) && in core_tpg_check_initiator_node_acl()
307 (tpg->se_tpg_tfo->tpg_check_demo_mode_login_only(tpg) == 1)) in core_tpg_check_initiator_node_acl()
310 core_tpg_add_node_to_devs(acl, tpg); in core_tpg_check_initiator_node_acl()
312 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_check_initiator_node_acl()
313 list_add_tail(&acl->acl_list, &tpg->acl_node_list); in core_tpg_check_initiator_node_acl()
314 tpg->num_node_acls++; in core_tpg_check_initiator_node_acl()
315 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_check_initiator_node_acl()
318 " Initiator Node: %s\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_check_initiator_node_acl()
319 tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth, in core_tpg_check_initiator_node_acl()
320 tpg->se_tpg_tfo->get_fabric_name(), initiatorname); in core_tpg_check_initiator_node_acl()
332 void core_tpg_clear_object_luns(struct se_portal_group *tpg) in core_tpg_clear_object_luns() argument
337 spin_lock(&tpg->tpg_lun_lock); in core_tpg_clear_object_luns()
339 lun = tpg->tpg_lun_list[i]; in core_tpg_clear_object_luns()
345 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_clear_object_luns()
346 core_dev_del_lun(tpg, lun->unpacked_lun); in core_tpg_clear_object_luns()
347 spin_lock(&tpg->tpg_lun_lock); in core_tpg_clear_object_luns()
349 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_clear_object_luns()
358 struct se_portal_group *tpg, in core_tpg_add_initiator_node_acl() argument
365 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
366 acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_add_initiator_node_acl()
371 " for %s\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_add_initiator_node_acl()
372 tpg->se_tpg_tfo->tpg_get_tag(tpg), initiatorname); in core_tpg_add_initiator_node_acl()
373 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
380 tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, in core_tpg_add_initiator_node_acl()
387 " request.\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_add_initiator_node_acl()
388 initiatorname, tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_add_initiator_node_acl()
389 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
392 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
414 acl->se_tpg = tpg; in core_tpg_add_initiator_node_acl()
418 tpg->se_tpg_tfo->set_default_node_attributes(acl); in core_tpg_add_initiator_node_acl()
421 tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl); in core_tpg_add_initiator_node_acl()
425 if (core_set_queue_depth_for_node(tpg, acl) < 0) { in core_tpg_add_initiator_node_acl()
426 core_free_device_list_for_node(acl, tpg); in core_tpg_add_initiator_node_acl()
427 tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl); in core_tpg_add_initiator_node_acl()
431 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
432 list_add_tail(&acl->acl_list, &tpg->acl_node_list); in core_tpg_add_initiator_node_acl()
433 tpg->num_node_acls++; in core_tpg_add_initiator_node_acl()
434 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_add_initiator_node_acl()
438 " Initiator Node: %s\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_add_initiator_node_acl()
439 tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth, in core_tpg_add_initiator_node_acl()
440 tpg->se_tpg_tfo->get_fabric_name(), initiatorname); in core_tpg_add_initiator_node_acl()
451 struct se_portal_group *tpg, in core_tpg_del_initiator_node_acl() argument
460 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_del_initiator_node_acl()
465 tpg->num_node_acls--; in core_tpg_del_initiator_node_acl()
466 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_del_initiator_node_acl()
484 rc = tpg->se_tpg_tfo->shutdown_session(sess); in core_tpg_del_initiator_node_acl()
498 core_clear_initiator_node_from_tpg(acl, tpg); in core_tpg_del_initiator_node_acl()
499 core_free_device_list_for_node(acl, tpg); in core_tpg_del_initiator_node_acl()
502 " Initiator Node: %s\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_del_initiator_node_acl()
503 tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth, in core_tpg_del_initiator_node_acl()
504 tpg->se_tpg_tfo->get_fabric_name(), acl->initiatorname); in core_tpg_del_initiator_node_acl()
515 struct se_portal_group *tpg, in core_tpg_set_initiator_node_queue_depth() argument
525 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
526 acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_set_initiator_node_queue_depth()
530 " request.\n", tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_set_initiator_node_queue_depth()
531 initiatorname, tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_set_initiator_node_queue_depth()
532 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
539 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
541 spin_lock_irqsave(&tpg->session_lock, flags); in core_tpg_set_initiator_node_queue_depth()
542 list_for_each_entry(sess, &tpg->tpg_sess_list, sess_list) { in core_tpg_set_initiator_node_queue_depth()
552 tpg->se_tpg_tfo->get_fabric_name(), initiatorname); in core_tpg_set_initiator_node_queue_depth()
553 spin_unlock_irqrestore(&tpg->session_lock, flags); in core_tpg_set_initiator_node_queue_depth()
555 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
558 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
564 if (!tpg->se_tpg_tfo->shutdown_session(sess)) in core_tpg_set_initiator_node_queue_depth()
582 if (core_set_queue_depth_for_node(tpg, acl) < 0) { in core_tpg_set_initiator_node_queue_depth()
583 spin_unlock_irqrestore(&tpg->session_lock, flags); in core_tpg_set_initiator_node_queue_depth()
591 tpg->se_tpg_tfo->close_session(init_sess); in core_tpg_set_initiator_node_queue_depth()
593 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
596 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
599 spin_unlock_irqrestore(&tpg->session_lock, flags); in core_tpg_set_initiator_node_queue_depth()
605 tpg->se_tpg_tfo->close_session(init_sess); in core_tpg_set_initiator_node_queue_depth()
609 initiatorname, tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_set_initiator_node_queue_depth()
610 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_set_initiator_node_queue_depth()
612 spin_lock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
615 spin_unlock_irq(&tpg->acl_node_lock); in core_tpg_set_initiator_node_queue_depth()
765 struct se_portal_group *tpg, in core_tpg_pre_addlun() argument
773 tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_pre_addlun()
775 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_pre_addlun()
779 spin_lock(&tpg->tpg_lun_lock); in core_tpg_pre_addlun()
780 lun = tpg->tpg_lun_list[unpacked_lun]; in core_tpg_pre_addlun()
784 unpacked_lun, tpg->se_tpg_tfo->get_fabric_name(), in core_tpg_pre_addlun()
785 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_pre_addlun()
786 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_pre_addlun()
789 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_pre_addlun()
795 struct se_portal_group *tpg, in core_tpg_post_addlun() argument
802 ret = core_dev_export(lun_ptr, tpg, lun); in core_tpg_post_addlun()
806 spin_lock(&tpg->tpg_lun_lock); in core_tpg_post_addlun()
809 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_post_addlun()
815 struct se_portal_group *tpg, in core_tpg_shutdown_lun() argument
818 core_clear_lun_from_tpg(lun, tpg); in core_tpg_shutdown_lun()
823 struct se_portal_group *tpg, in core_tpg_pre_dellun() argument
831 tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun, in core_tpg_pre_dellun()
833 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_pre_dellun()
837 spin_lock(&tpg->tpg_lun_lock); in core_tpg_pre_dellun()
838 lun = tpg->tpg_lun_list[unpacked_lun]; in core_tpg_pre_dellun()
842 tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun, in core_tpg_pre_dellun()
843 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_pre_dellun()
844 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_pre_dellun()
847 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_pre_dellun()
853 struct se_portal_group *tpg, in core_tpg_post_dellun() argument
856 core_tpg_shutdown_lun(tpg, lun); in core_tpg_post_dellun()
858 core_dev_unexport(lun->lun_se_dev, tpg, lun); in core_tpg_post_dellun()
860 spin_lock(&tpg->tpg_lun_lock); in core_tpg_post_dellun()
862 spin_unlock(&tpg->tpg_lun_lock); in core_tpg_post_dellun()