Lines Matching refs:group

72 typedef struct group {  struct
78 struct group *next; argument
470 group_t *group; in get_affected_clients() local
477 for (group = group_list; group != NULL; group = group->next) { in get_affected_clients()
480 if (bsearch(&phci, group->phcis, group->nphcis, sizeof (phci_t), in get_affected_clients()
491 detect_client_change(hdl, cmd, flags, group, rsrc)) { in get_affected_clients()
492 if (merge_clients(&nclients, &clients, group) < 0) { in get_affected_clients()
529 detect_client_change(rcm_handle_t *hdl, int cmd, int flags, group_t *group, in detect_client_change() argument
540 for (i = 0; i < group->nphcis; i++) { in detect_client_change()
543 if (strcmp(group->phcis[i].path, rsrc) == 0) in detect_client_change()
552 if ((group->phcis[i].state == DI_PATH_STATE_ONLINE) || in detect_client_change()
553 (group->phcis[i].state == DI_PATH_STATE_STANDBY)) { in detect_client_change()
554 if (rcm_get_rsrcstate(hdl, group->phcis[i].path, &state) in detect_client_change()
561 group->phcis[i].path, state); in detect_client_change()
583 merge_clients(int *nclients, char ***clientsp, group_t *group) in merge_clients() argument
589 if (group->nclients) { in merge_clients()
591 *nclients += group->nclients; in merge_clients()
606 clients_new[i] = group->clients[i - old_nclients]; in merge_clients()
653 group_t *group; in refresh_regs() local
668 for (group = group_list; group != NULL; group = group->next) { in refresh_regs()
669 for (i = 0; i < group->nphcis; i++) { in refresh_regs()
675 if ((reg = lookup_phci(group->phcis[i].path)) != NULL) { in refresh_regs()
678 reg->phci.state = group->phcis[i].state; in refresh_regs()
692 reg->phci.path = strdup(group->phcis[i].path); in refresh_regs()
700 reg->phci.state = group->phcis[i].state; in refresh_regs()
764 group_t *group; in build_groups() local
812 for (group = group_list; group != NULL; group = group->next) { in build_groups()
815 if (nphcis != group->nphcis) in build_groups()
820 if (strcmp(phcis[i].path, group->phcis[i].path) != 0) in build_groups()
830 if ((group->clients[group->nclients] = in build_groups()
833 group->nclients++; in build_groups()
839 if ((group = (group_t *)calloc(1, sizeof (*group))) == NULL) { in build_groups()
846 if ((group->clients = (char **)calloc(*nclients, sizeof (char *))) == in build_groups()
848 free(group); in build_groups()
852 group->nphcis = nphcis; in build_groups()
853 group->phcis = phcis; in build_groups()
854 if ((group->clients[0] = get_rsrcname(dinode)) == NULL) { in build_groups()
855 free_group(group); in build_groups()
858 group->nclients = 1; in build_groups()
861 group->next = group_list; in build_groups()
862 group_list = group; in build_groups()
893 group_t *group = group_list; in free_grouplist() local
896 while (group) { in free_grouplist()
897 next = group->next; in free_grouplist()
898 free_group(group); in free_grouplist()
899 group = next; in free_grouplist()
909 free_group(group_t *group) in free_group() argument
911 if (group) { in free_group()
912 free_phcis(group->nphcis, group->phcis); in free_group()
913 free_clients(group->nclients, group->clients); in free_group()
914 free(group); in free_group()