Lines Matching refs:tpg
221 struct ft_tpg *tpg; in ft_add_tpg() local
246 tpg = kzalloc(sizeof(*tpg), GFP_KERNEL); in ft_add_tpg()
247 if (!tpg) in ft_add_tpg()
249 tpg->index = index; in ft_add_tpg()
250 tpg->lport_wwn = ft_wwn; in ft_add_tpg()
251 INIT_LIST_HEAD(&tpg->lun_list); in ft_add_tpg()
255 kfree(tpg); in ft_add_tpg()
259 ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_FCP); in ft_add_tpg()
262 kfree(tpg); in ft_add_tpg()
265 tpg->workqueue = wq; in ft_add_tpg()
268 ft_wwn->tpg = tpg; in ft_add_tpg()
271 return &tpg->se_tpg; in ft_add_tpg()
276 struct ft_tpg *tpg = container_of(se_tpg, struct ft_tpg, se_tpg); in ft_del_tpg() local
277 struct ft_lport_wwn *ft_wwn = tpg->lport_wwn; in ft_del_tpg()
280 config_item_name(&tpg->se_tpg.tpg_group.cg_item)); in ft_del_tpg()
282 destroy_workqueue(tpg->workqueue); in ft_del_tpg()
288 ft_wwn->tpg = NULL; in ft_del_tpg()
289 if (tpg->tport) { in ft_del_tpg()
290 tpg->tport->tpg = NULL; in ft_del_tpg()
291 tpg->tport = NULL; in ft_del_tpg()
296 kfree(tpg); in ft_del_tpg()
311 return ft_wwn->tpg; in ft_lport_find_tpg()