Lines Matching defs:tpg

78 	struct sbp_tpg *tpg, u64 guid)
83 spin_lock_bh(&tpg->se_tpg.session_lock);
84 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) {
89 spin_unlock_bh(&tpg->se_tpg.session_lock);
110 struct sbp_tpg *tpg,
119 spin_lock_bh(&tpg->se_tpg.session_lock);
120 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) {
133 spin_unlock_bh(&tpg->se_tpg.session_lock);
139 struct sbp_tpg *tpg, int login_id)
145 spin_lock_bh(&tpg->se_tpg.session_lock);
146 list_for_each_entry(se_sess, &tpg->se_tpg.tpg_sess_list, sess_list) {
156 spin_unlock_bh(&tpg->se_tpg.session_lock);
161 static u32 sbp_get_lun_from_tpg(struct sbp_tpg *tpg, u32 login_lun, int *err)
163 struct se_portal_group *se_tpg = &tpg->se_tpg;
181 struct sbp_tpg *tpg,
199 sess->se_sess = target_setup_session(&tpg->se_tpg, 128,
263 struct sbp_tpg *tpg = tport->tpg;
271 unpacked_lun = sbp_get_lun_from_tpg(tpg,
296 sess = sbp_session_find_by_guid(tpg, guid);
326 sbp_login_count_all_by_lun(tpg, unpacked_lun, 0)) {
339 if (sbp_login_count_all_by_lun(tpg, unpacked_lun, 1)) {
352 if (sbp_login_count_all_by_lun(tpg, unpacked_lun, 0) >=
363 sess = sbp_session_create(tpg, guid);
494 struct sbp_tpg *tpg = tport->tpg;
511 login = sbp_login_find_by_id(tpg,
553 struct sbp_tpg *tpg = tport->tpg;
559 login = sbp_login_find_by_id(tpg, id);
1678 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1679 struct sbp_tport *tport = tpg->tport;
1686 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1687 return tpg->tport_tpgt;
1770 static int sbp_count_se_tpg_luns(struct se_portal_group *tpg)
1776 hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link)
1795 if (!tport->enable || !tport->tpg)
1798 num_luns = sbp_count_se_tpg_luns(&tport->tpg->se_tpg);
1849 hlist_for_each_entry_rcu(lun, &tport->tpg->se_tpg.tpg_lun_hlist, link) {
1936 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1938 return sbp_update_unit_directory(tpg->tport);
1945 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1946 struct sbp_tport *tport = tpg->tport;
1949 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0)
1963 struct sbp_tpg *tpg;
1972 if (tport->tpg) {
1977 tpg = kzalloc(sizeof(*tpg), GFP_KERNEL);
1978 if (!tpg)
1981 tpg->tport = tport;
1982 tpg->tport_tpgt = tpgt;
1983 tport->tpg = tpg;
1998 ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_SBP);
2002 return &tpg->se_tpg;
2007 tport->tpg = NULL;
2008 kfree(tpg);
2014 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2015 struct sbp_tport *tport = tpg->tport;
2019 tport->tpg = NULL;
2020 kfree(tpg);
2067 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2068 struct sbp_tport *tport = tpg->tport;
2080 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2081 struct sbp_tport *tport = tpg->tport;
2105 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2106 struct sbp_tport *tport = tpg->tport;
2110 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) {
2146 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2147 struct sbp_tport *tport = tpg->tport;
2155 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2156 struct sbp_tport *tport = tpg->tport;
2181 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2182 struct sbp_tport *tport = tpg->tport;
2190 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2191 struct sbp_tport *tport = tpg->tport;
2216 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2217 struct sbp_tport *tport = tpg->tport;
2225 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2226 struct sbp_tport *tport = tpg->tport;