Lines Matching refs:tpg

95 	struct sbp_tpg *tpg, u64 guid)  in sbp_session_find_by_guid()  argument
100 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_session_find_by_guid()
101 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_session_find_by_guid()
106 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_session_find_by_guid()
127 struct sbp_tpg *tpg, in sbp_login_count_all_by_lun() argument
136 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_login_count_all_by_lun()
137 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_login_count_all_by_lun()
150 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_login_count_all_by_lun()
156 struct sbp_tpg *tpg, int login_id) in sbp_login_find_by_id() argument
162 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_login_find_by_id()
163 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_login_find_by_id()
173 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_login_find_by_id()
178 static struct se_lun *sbp_get_lun_from_tpg(struct sbp_tpg *tpg, int lun) in sbp_get_lun_from_tpg() argument
180 struct se_portal_group *se_tpg = &tpg->se_tpg; in sbp_get_lun_from_tpg()
198 struct sbp_tpg *tpg, in sbp_session_create() argument
223 se_nacl = core_tpg_check_initiator_node_acl(&tpg->se_tpg, guid_str); in sbp_session_create()
241 transport_register_session(&tpg->se_tpg, se_nacl, sess->se_sess, sess); in sbp_session_create()
297 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_login() local
306 se_lun = sbp_get_lun_from_tpg(tpg, in sbp_management_request_login()
331 sess = sbp_session_find_by_guid(tpg, guid); in sbp_management_request_login()
361 sbp_login_count_all_by_lun(tpg, se_lun, 0)) { in sbp_management_request_login()
374 if (sbp_login_count_all_by_lun(tpg, se_lun, 1)) { in sbp_management_request_login()
387 if (sbp_login_count_all_by_lun(tpg, se_lun, 0) >= in sbp_management_request_login()
398 sess = sbp_session_create(tpg, guid); in sbp_management_request_login()
529 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_reconnect() local
546 login = sbp_login_find_by_id(tpg, in sbp_management_request_reconnect()
588 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_logout() local
594 login = sbp_login_find_by_id(tpg, id); in sbp_management_request_logout()
1698 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_get_fabric_wwn() local
1699 struct sbp_tport *tport = tpg->tport; in sbp_get_fabric_wwn()
1706 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_get_tag() local
1707 return tpg->tport_tpgt; in sbp_get_tag()
1941 static int sbp_count_se_tpg_luns(struct se_portal_group *tpg) in sbp_count_se_tpg_luns() argument
1945 spin_lock(&tpg->tpg_lun_lock); in sbp_count_se_tpg_luns()
1947 struct se_lun *se_lun = tpg->tpg_lun_list[i]; in sbp_count_se_tpg_luns()
1954 spin_unlock(&tpg->tpg_lun_lock); in sbp_count_se_tpg_luns()
1970 if (!tport->enable || !tport->tpg) in sbp_update_unit_directory()
1973 num_luns = sbp_count_se_tpg_luns(&tport->tpg->se_tpg); in sbp_update_unit_directory()
2023 spin_lock(&tport->tpg->se_tpg.tpg_lun_lock); in sbp_update_unit_directory()
2025 struct se_lun *se_lun = tport->tpg->se_tpg.tpg_lun_list[i]; in sbp_update_unit_directory()
2032 spin_unlock(&tport->tpg->se_tpg.tpg_lun_lock); in sbp_update_unit_directory()
2042 spin_lock(&tport->tpg->se_tpg.tpg_lun_lock); in sbp_update_unit_directory()
2044 spin_unlock(&tport->tpg->se_tpg.tpg_lun_lock); in sbp_update_unit_directory()
2151 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_post_link_lun() local
2153 return sbp_update_unit_directory(tpg->tport); in sbp_post_link_lun()
2160 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_pre_unlink_lun() local
2161 struct sbp_tport *tport = tpg->tport; in sbp_pre_unlink_lun()
2164 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) in sbp_pre_unlink_lun()
2180 struct sbp_tpg *tpg; in sbp_make_tpg() local
2189 if (tport->tpg) { in sbp_make_tpg()
2194 tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); in sbp_make_tpg()
2195 if (!tpg) { in sbp_make_tpg()
2200 tpg->tport = tport; in sbp_make_tpg()
2201 tpg->tport_tpgt = tpgt; in sbp_make_tpg()
2202 tport->tpg = tpg; in sbp_make_tpg()
2217 ret = core_tpg_register(&sbp_ops, wwn, &tpg->se_tpg, tpg, in sbp_make_tpg()
2222 return &tpg->se_tpg; in sbp_make_tpg()
2227 tport->tpg = NULL; in sbp_make_tpg()
2228 kfree(tpg); in sbp_make_tpg()
2234 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_drop_tpg() local
2235 struct sbp_tport *tport = tpg->tport; in sbp_drop_tpg()
2239 tport->tpg = NULL; in sbp_drop_tpg()
2240 kfree(tpg); in sbp_drop_tpg()
2292 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_show_directory_id() local
2293 struct sbp_tport *tport = tpg->tport; in sbp_tpg_show_directory_id()
2306 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_store_directory_id() local
2307 struct sbp_tport *tport = tpg->tport; in sbp_tpg_store_directory_id()
2333 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_show_enable() local
2334 struct sbp_tport *tport = tpg->tport; in sbp_tpg_show_enable()
2343 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_store_enable() local
2344 struct sbp_tport *tport = tpg->tport; in sbp_tpg_store_enable()
2357 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) { in sbp_tpg_store_enable()
2395 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_show_mgt_orb_timeout() local
2396 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_show_mgt_orb_timeout()
2405 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_store_mgt_orb_timeout() local
2406 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_store_mgt_orb_timeout()
2431 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_show_max_reconnect_timeout() local
2432 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_show_max_reconnect_timeout()
2441 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_store_max_reconnect_timeout() local
2442 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_store_max_reconnect_timeout()
2467 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_show_max_logins_per_lun() local
2468 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_show_max_logins_per_lun()
2477 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_store_max_logins_per_lun() local
2478 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_store_max_logins_per_lun()