Lines Matching refs: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);
1686 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1687 struct sbp_tport *tport = tpg->tport;
1694 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1695 return tpg->tport_tpgt;
1798 static int sbp_count_se_tpg_luns(struct se_portal_group *tpg)
1804 hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link)
1823 if (!tport->enable || !tport->tpg)
1826 num_luns = sbp_count_se_tpg_luns(&tport->tpg->se_tpg);
1877 hlist_for_each_entry_rcu(lun, &tport->tpg->se_tpg.tpg_lun_hlist, link) {
1964 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1966 return sbp_update_unit_directory(tpg->tport);
1973 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
1974 struct sbp_tport *tport = tpg->tport;
1977 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0)
1991 struct sbp_tpg *tpg;
2000 if (tport->tpg) {
2005 tpg = kzalloc(sizeof(*tpg), GFP_KERNEL);
2006 if (!tpg)
2009 tpg->tport = tport;
2010 tpg->tport_tpgt = tpgt;
2011 tport->tpg = tpg;
2026 ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_SBP);
2030 return &tpg->se_tpg;
2035 tport->tpg = NULL;
2036 kfree(tpg);
2042 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2043 struct sbp_tport *tport = tpg->tport;
2047 tport->tpg = NULL;
2048 kfree(tpg);
2095 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2096 struct sbp_tport *tport = tpg->tport;
2108 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2109 struct sbp_tport *tport = tpg->tport;
2134 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2135 struct sbp_tport *tport = tpg->tport;
2143 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2144 struct sbp_tport *tport = tpg->tport;
2157 if (sbp_count_se_tpg_luns(&tpg->se_tpg) == 0) {
2195 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2196 struct sbp_tport *tport = tpg->tport;
2204 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2205 struct sbp_tport *tport = tpg->tport;
2230 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2231 struct sbp_tport *tport = tpg->tport;
2239 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2240 struct sbp_tport *tport = tpg->tport;
2265 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2266 struct sbp_tport *tport = tpg->tport;
2274 struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
2275 struct sbp_tport *tport = tpg->tport;