Lines Matching refs:targ
116 struct target *targ, *tmp; in conf_delete() local
125 TAILQ_FOREACH_SAFE(targ, &conf->conf_targets, t_next, tmp) in conf_delete()
126 target_delete(targ); in conf_delete()
1384 struct target *targ; in target_new() local
1387 targ = target_find(conf, name); in target_new()
1388 if (targ != NULL) { in target_new()
1396 targ = calloc(1, sizeof(*targ)); in target_new()
1397 if (targ == NULL) in target_new()
1399 targ->t_name = checked_strdup(name); in target_new()
1406 targ->t_name[i] = tolower(targ->t_name[i]); in target_new()
1408 targ->t_conf = conf; in target_new()
1409 TAILQ_INIT(&targ->t_ports); in target_new()
1410 TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); in target_new()
1412 return (targ); in target_new()
1416 target_delete(struct target *targ) in target_delete() argument
1420 TAILQ_FOREACH_SAFE(port, &targ->t_ports, p_ts, tport) in target_delete()
1422 TAILQ_REMOVE(&targ->t_conf->conf_targets, targ, t_next); in target_delete()
1424 free(targ->t_pport); in target_delete()
1425 free(targ->t_name); in target_delete()
1426 free(targ->t_redirection); in target_delete()
1427 free(targ); in target_delete()
1433 struct target *targ; in target_find() local
1435 TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { in target_find()
1436 if (strcasecmp(targ->t_name, name) == 0) in target_find()
1437 return (targ); in target_find()
1485 struct target *targ; in lun_delete() local
1489 TAILQ_FOREACH(targ, &lun->l_conf->conf_targets, t_next) { in lun_delete()
1491 if (targ->t_luns[i] == lun) in lun_delete()
1492 targ->t_luns[i] = NULL; in lun_delete()
1703 struct target *targ;
1735 TAILQ_FOREACH(targ, &conf->conf_targets, t_next) {
1736 fprintf(stderr, "target %s {\n", targ->t_name);
1737 if (targ->t_alias != NULL)
1738 fprintf(stderr, "\t alias %s\n", targ->t_alias);
1806 struct target *targ; in conf_verify() local
1819 TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { in conf_verify()
1820 if (targ->t_auth_group == NULL) { in conf_verify()
1821 targ->t_auth_group = auth_group_find(conf, in conf_verify()
1823 assert(targ->t_auth_group != NULL); in conf_verify()
1825 if (TAILQ_EMPTY(&targ->t_ports)) { in conf_verify()
1828 port_new(conf, targ, pg); in conf_verify()
1832 if (targ->t_luns[i] != NULL) in conf_verify()
1835 if (!found && targ->t_redirection == NULL) { in conf_verify()
1837 targ->t_name); in conf_verify()
1839 if (found && targ->t_redirection != NULL) { in conf_verify()
1842 targ->t_name); in conf_verify()
1880 TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { in conf_verify()
1881 if (targ->t_auth_group == ag) { in conf_verify()
2751 struct target *targ; in new_pports_from_conf() local
2756 TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { in new_pports_from_conf()
2757 if (!targ->t_pport) in new_pports_from_conf()
2760 ret = sscanf(targ->t_pport, "ioctl/%d/%d", &i_pp, &i_vp); in new_pports_from_conf()
2762 tp = port_new_ioctl(conf, kports, targ, i_pp, i_vp); in new_pports_from_conf()
2765 "for target \"%s\"", targ->t_name); in new_pports_from_conf()
2772 pp = pport_find(kports, targ->t_pport); in new_pports_from_conf()
2775 targ->t_pport, targ->t_name); in new_pports_from_conf()
2781 targ->t_pport, targ->t_name); in new_pports_from_conf()
2784 tp = port_new_pp(conf, targ, pp); in new_pports_from_conf()
2787 targ->t_pport, targ->t_name); in new_pports_from_conf()