Lines Matching refs:tpg
40 struct se_portal_group *tpg, in __core_tpg_get_initiator_node_acl() argument
45 list_for_each_entry(acl, &tpg->acl_node_list, acl_list) { in __core_tpg_get_initiator_node_acl()
58 struct se_portal_group *tpg, in core_tpg_get_initiator_node_acl() argument
71 mutex_lock(&tpg->acl_node_mutex); in core_tpg_get_initiator_node_acl()
72 acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_get_initiator_node_acl()
77 mutex_unlock(&tpg->acl_node_mutex); in core_tpg_get_initiator_node_acl()
105 struct se_portal_group *tpg, in core_tpg_add_node_to_devs() argument
112 mutex_lock(&tpg->tpg_lun_mutex); in core_tpg_add_node_to_devs()
113 hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { in core_tpg_add_node_to_devs()
118 lockdep_is_held(&tpg->tpg_lun_mutex)); in core_tpg_add_node_to_devs()
123 if (!tpg->se_tpg_tfo->tpg_check_demo_mode_write_protect(tpg)) { in core_tpg_add_node_to_devs()
138 tpg->se_tpg_tfo->fabric_name, in core_tpg_add_node_to_devs()
139 tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, in core_tpg_add_node_to_devs()
143 lun_access_ro, acl, tpg); in core_tpg_add_node_to_devs()
149 core_scsi3_check_aptpl_registration(dev, tpg, lun, acl, in core_tpg_add_node_to_devs()
152 mutex_unlock(&tpg->tpg_lun_mutex); in core_tpg_add_node_to_devs()
156 target_set_nacl_queue_depth(struct se_portal_group *tpg, in target_set_nacl_queue_depth() argument
163 "defaulting to 1.\n", tpg->se_tpg_tfo->fabric_name, in target_set_nacl_queue_depth()
169 static struct se_node_acl *target_alloc_node_acl(struct se_portal_group *tpg, in target_alloc_node_acl() argument
175 acl = kzalloc(max(sizeof(*acl), tpg->se_tpg_tfo->node_acl_size), in target_alloc_node_acl()
189 if (tpg->se_tpg_tfo->tpg_get_default_depth) in target_alloc_node_acl()
190 queue_depth = tpg->se_tpg_tfo->tpg_get_default_depth(tpg); in target_alloc_node_acl()
193 target_set_nacl_queue_depth(tpg, acl, queue_depth); in target_alloc_node_acl()
196 acl->se_tpg = tpg; in target_alloc_node_acl()
199 tpg->se_tpg_tfo->set_default_node_attributes(acl); in target_alloc_node_acl()
206 struct se_portal_group *tpg = acl->se_tpg; in target_add_node_acl() local
208 mutex_lock(&tpg->acl_node_mutex); in target_add_node_acl()
209 list_add_tail(&acl->acl_list, &tpg->acl_node_list); in target_add_node_acl()
210 mutex_unlock(&tpg->acl_node_mutex); in target_add_node_acl()
214 tpg->se_tpg_tfo->fabric_name, in target_add_node_acl()
215 tpg->se_tpg_tfo->tpg_get_tag(tpg), in target_add_node_acl()
218 tpg->se_tpg_tfo->fabric_name, in target_add_node_acl()
222 bool target_tpg_has_node_acl(struct se_portal_group *tpg, in target_tpg_has_node_acl() argument
228 mutex_lock(&tpg->acl_node_mutex); in target_tpg_has_node_acl()
229 list_for_each_entry(acl, &tpg->acl_node_list, acl_list) { in target_tpg_has_node_acl()
235 mutex_unlock(&tpg->acl_node_mutex); in target_tpg_has_node_acl()
242 struct se_portal_group *tpg, in core_tpg_check_initiator_node_acl() argument
247 acl = core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_check_initiator_node_acl()
251 if (!tpg->se_tpg_tfo->tpg_check_demo_mode(tpg)) in core_tpg_check_initiator_node_acl()
254 acl = target_alloc_node_acl(tpg, initiatorname); in core_tpg_check_initiator_node_acl()
273 if ((tpg->se_tpg_tfo->tpg_check_demo_mode_login_only == NULL) || in core_tpg_check_initiator_node_acl()
274 (tpg->se_tpg_tfo->tpg_check_demo_mode_login_only(tpg) != 1)) in core_tpg_check_initiator_node_acl()
275 core_tpg_add_node_to_devs(acl, tpg, NULL); in core_tpg_check_initiator_node_acl()
289 struct se_portal_group *tpg, in core_tpg_add_initiator_node_acl() argument
294 mutex_lock(&tpg->acl_node_mutex); in core_tpg_add_initiator_node_acl()
295 acl = __core_tpg_get_initiator_node_acl(tpg, initiatorname); in core_tpg_add_initiator_node_acl()
300 " for %s\n", tpg->se_tpg_tfo->fabric_name, in core_tpg_add_initiator_node_acl()
301 tpg->se_tpg_tfo->tpg_get_tag(tpg), initiatorname); in core_tpg_add_initiator_node_acl()
302 mutex_unlock(&tpg->acl_node_mutex); in core_tpg_add_initiator_node_acl()
308 " request.\n", tpg->se_tpg_tfo->fabric_name, in core_tpg_add_initiator_node_acl()
309 initiatorname, tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_add_initiator_node_acl()
310 mutex_unlock(&tpg->acl_node_mutex); in core_tpg_add_initiator_node_acl()
313 mutex_unlock(&tpg->acl_node_mutex); in core_tpg_add_initiator_node_acl()
315 acl = target_alloc_node_acl(tpg, initiatorname); in core_tpg_add_initiator_node_acl()
346 struct se_portal_group *tpg = acl->se_tpg; in core_tpg_del_initiator_node_acl() local
348 mutex_lock(&tpg->acl_node_mutex); in core_tpg_del_initiator_node_acl()
352 mutex_unlock(&tpg->acl_node_mutex); in core_tpg_del_initiator_node_acl()
364 core_free_device_list_for_node(acl, tpg); in core_tpg_del_initiator_node_acl()
367 " Initiator Node: %s\n", tpg->se_tpg_tfo->fabric_name, in core_tpg_del_initiator_node_acl()
368 tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth, in core_tpg_del_initiator_node_acl()
369 tpg->se_tpg_tfo->fabric_name, acl->initiatorname); in core_tpg_del_initiator_node_acl()
382 struct se_portal_group *tpg = acl->se_tpg; in core_tpg_set_initiator_node_queue_depth() local
396 target_set_nacl_queue_depth(tpg, acl, queue_depth); in core_tpg_set_initiator_node_queue_depth()
405 acl->initiatorname, tpg->se_tpg_tfo->fabric_name, in core_tpg_set_initiator_node_queue_depth()
406 tpg->se_tpg_tfo->tpg_get_tag(tpg)); in core_tpg_set_initiator_node_queue_depth()
419 struct se_portal_group *tpg, in core_tpg_set_initiator_node_tag() argument
543 struct se_portal_group *tpg, in core_tpg_alloc_lun() argument
563 lun->lun_tpg = tpg; in core_tpg_alloc_lun()
569 struct se_portal_group *tpg, in core_tpg_add_lun() argument
589 mutex_lock(&tpg->tpg_lun_mutex); in core_tpg_add_lun()
603 hlist_add_head_rcu(&lun->link, &tpg->tpg_lun_hlist); in core_tpg_add_lun()
604 mutex_unlock(&tpg->tpg_lun_mutex); in core_tpg_add_lun()
615 struct se_portal_group *tpg, in core_tpg_remove_lun() argument
626 core_clear_lun_from_tpg(lun, tpg); in core_tpg_remove_lun()
635 mutex_lock(&tpg->tpg_lun_mutex); in core_tpg_remove_lun()
649 mutex_unlock(&tpg->tpg_lun_mutex); in core_tpg_remove_lun()