Lines Matching refs:tpg

78 	struct sbp_tpg *tpg, u64 guid)  in sbp_session_find_by_guid()  argument
83 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_session_find_by_guid()
84 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_session_find_by_guid()
89 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_session_find_by_guid()
110 struct sbp_tpg *tpg, in sbp_login_count_all_by_lun() argument
119 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_login_count_all_by_lun()
120 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_login_count_all_by_lun()
133 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_login_count_all_by_lun()
139 struct sbp_tpg *tpg, int login_id) in sbp_login_find_by_id() argument
145 spin_lock_bh(&tpg->se_tpg.session_lock); in sbp_login_find_by_id()
146 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) { in sbp_login_find_by_id()
156 spin_unlock_bh(&tpg->se_tpg.session_lock); in sbp_login_find_by_id()
161 static u32 sbp_get_lun_from_tpg(struct sbp_tpg *tpg, u32 login_lun, int *err) in sbp_get_lun_from_tpg() argument
163 struct se_portal_group *se_tpg = &tpg->se_tpg; in sbp_get_lun_from_tpg()
181 struct sbp_tpg *tpg, in sbp_session_create() argument
199 sess->se_sess = target_setup_session(&tpg->se_tpg, 128, in sbp_session_create()
263 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_login() local
271 unpacked_lun = sbp_get_lun_from_tpg(tpg, in sbp_management_request_login()
296 sess = sbp_session_find_by_guid(tpg, guid); in sbp_management_request_login()
326 sbp_login_count_all_by_lun(tpg, unpacked_lun, 0)) { in sbp_management_request_login()
339 if (sbp_login_count_all_by_lun(tpg, unpacked_lun, 1)) { in sbp_management_request_login()
352 if (sbp_login_count_all_by_lun(tpg, unpacked_lun, 0) >= in sbp_management_request_login()
363 sess = sbp_session_create(tpg, guid); in sbp_management_request_login()
494 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_reconnect() local
511 login = sbp_login_find_by_id(tpg, in sbp_management_request_reconnect()
553 struct sbp_tpg *tpg = tport->tpg; in sbp_management_request_logout() local
559 login = sbp_login_find_by_id(tpg, id); in sbp_management_request_logout()
1683 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_get_fabric_wwn() local
1684 struct sbp_tport *tport = tpg->tport; in sbp_get_fabric_wwn()
1691 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_get_tag() local
1692 return tpg->tport_tpgt; in sbp_get_tag()
1795 static int sbp_count_se_tpg_luns(struct se_portal_group *tpg) in sbp_count_se_tpg_luns() argument
1801 hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) in sbp_count_se_tpg_luns()
1820 if (!tport->enable || !tport->tpg) in sbp_update_unit_directory()
1823 num_luns = sbp_count_se_tpg_luns(&tport->tpg->se_tpg); in sbp_update_unit_directory()
1874 hlist_for_each_entry_rcu(lun, &tport->tpg->se_tpg.tpg_lun_hlist, link) { in sbp_update_unit_directory()
1961 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_post_link_lun() local
1963 return sbp_update_unit_directory(tpg->tport); in sbp_post_link_lun()
1970 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_pre_unlink_lun() local
1971 struct sbp_tport *tport = tpg->tport; in sbp_pre_unlink_lun()
1974 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) in sbp_pre_unlink_lun()
1988 struct sbp_tpg *tpg; in sbp_make_tpg() local
1997 if (tport->tpg) { in sbp_make_tpg()
2002 tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); in sbp_make_tpg()
2003 if (!tpg) in sbp_make_tpg()
2006 tpg->tport = tport; in sbp_make_tpg()
2007 tpg->tport_tpgt = tpgt; in sbp_make_tpg()
2008 tport->tpg = tpg; in sbp_make_tpg()
2023 ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_SBP); in sbp_make_tpg()
2027 return &tpg->se_tpg; in sbp_make_tpg()
2032 tport->tpg = NULL; in sbp_make_tpg()
2033 kfree(tpg); in sbp_make_tpg()
2039 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_drop_tpg() local
2040 struct sbp_tport *tport = tpg->tport; in sbp_drop_tpg()
2044 tport->tpg = NULL; in sbp_drop_tpg()
2045 kfree(tpg); in sbp_drop_tpg()
2092 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_directory_id_show() local
2093 struct sbp_tport *tport = tpg->tport; in sbp_tpg_directory_id_show()
2105 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_directory_id_store() local
2106 struct sbp_tport *tport = tpg->tport; in sbp_tpg_directory_id_store()
2130 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_enable_tpg() local
2131 struct sbp_tport *tport = tpg->tport; in sbp_enable_tpg()
2135 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) { in sbp_enable_tpg()
2171 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_mgt_orb_timeout_show() local
2172 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_mgt_orb_timeout_show()
2180 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_mgt_orb_timeout_store() local
2181 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_mgt_orb_timeout_store()
2206 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_max_reconnect_timeout_show() local
2207 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_max_reconnect_timeout_show()
2215 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_max_reconnect_timeout_store() local
2216 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_max_reconnect_timeout_store()
2241 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_max_logins_per_lun_show() local
2242 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_max_logins_per_lun_show()
2250 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); in sbp_tpg_attrib_max_logins_per_lun_store() local
2251 struct sbp_tport *tport = tpg->tport; in sbp_tpg_attrib_max_logins_per_lun_store()