Lines Matching refs:tport
44 struct ft_tport *tport; in ft_tport_get() local
47 tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP], in ft_tport_get()
49 if (tport && tport->tpg) in ft_tport_get()
50 return tport; in ft_tport_get()
56 if (tport) { in ft_tport_get()
57 tport->tpg = tpg; in ft_tport_get()
58 tpg->tport = tport; in ft_tport_get()
59 return tport; in ft_tport_get()
62 tport = kzalloc(sizeof(*tport), GFP_KERNEL); in ft_tport_get()
63 if (!tport) in ft_tport_get()
66 tport->lport = lport; in ft_tport_get()
67 tport->tpg = tpg; in ft_tport_get()
68 tpg->tport = tport; in ft_tport_get()
70 INIT_HLIST_HEAD(&tport->hash[i]); in ft_tport_get()
72 rcu_assign_pointer(lport->prov[FC_TYPE_FCP], tport); in ft_tport_get()
73 return tport; in ft_tport_get()
80 static void ft_tport_delete(struct ft_tport *tport) in ft_tport_delete() argument
85 ft_sess_delete_all(tport); in ft_tport_delete()
86 lport = tport->lport; in ft_tport_delete()
88 BUG_ON(tport != lport->prov[FC_TYPE_FCP]); in ft_tport_delete()
91 tpg = tport->tpg; in ft_tport_delete()
93 tpg->tport = NULL; in ft_tport_delete()
94 tport->tpg = NULL; in ft_tport_delete()
96 kfree_rcu(tport, rcu); in ft_tport_delete()
117 struct ft_tport *tport; in ft_lport_del() local
120 tport = lport->prov[FC_TYPE_FCP]; in ft_lport_del()
121 if (tport) in ft_lport_del()
122 ft_tport_delete(tport); in ft_lport_del()
160 struct ft_tport *tport; in ft_sess_get() local
166 tport = rcu_dereference(lport->prov[FC_TYPE_FCP]); in ft_sess_get()
167 if (!tport) { in ft_sess_get()
172 head = &tport->hash[ft_sess_hash(port_id)]; in ft_sess_get()
193 struct ft_tport *tport = sess->tport; in ft_sess_alloc_cb() local
194 struct hlist_head *head = &tport->hash[ft_sess_hash(sess->port_id)]; in ft_sess_alloc_cb()
196 TFC_SESS_DBG(tport->lport, "port_id %x sess %p\n", sess->port_id, sess); in ft_sess_alloc_cb()
198 tport->sess_count++; in ft_sess_alloc_cb()
207 static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id, in ft_sess_create() argument
210 struct se_portal_group *se_tpg = &tport->tpg->se_tpg; in ft_sess_create()
217 head = &tport->hash[ft_sess_hash(port_id)]; in ft_sess_create()
227 sess->tport = tport; in ft_sess_create()
248 struct ft_tport *tport = sess->tport; in ft_sess_unhash() local
251 BUG_ON(!tport->sess_count); in ft_sess_unhash()
252 tport->sess_count--; in ft_sess_unhash()
261 static struct ft_sess *ft_sess_delete(struct ft_tport *tport, u32 port_id) in ft_sess_delete() argument
266 head = &tport->hash[ft_sess_hash(port_id)]; in ft_sess_delete()
287 static void ft_sess_delete_all(struct ft_tport *tport) in ft_sess_delete_all() argument
292 for (head = tport->hash; in ft_sess_delete_all()
293 head < &tport->hash[FT_SESS_HASH_SIZE]; head++) { in ft_sess_delete_all()
320 TFC_SESS_DBG(sess->tport->lport, "port_id %x close session\n", port_id); in ft_sess_close()
350 struct ft_tport *tport; in ft_prli_locked() local
354 tport = ft_tport_get(rdata->local_port); in ft_prli_locked()
355 if (!tport) in ft_prli_locked()
379 sess = ft_sess_create(tport, rdata->ids.port_id, rdata); in ft_prli_locked()
453 struct ft_tport *tport; in ft_prlo() local
456 tport = rcu_dereference_protected(rdata->local_port->prov[FC_TYPE_FCP], in ft_prlo()
459 if (!tport) { in ft_prlo()
463 sess = ft_sess_delete(tport, rdata->ids.port_id); in ft_prlo()