Lines Matching defs:cip

222 fmd_case_code_hash_insert(fmd_case_hash_t *chp, fmd_case_impl_t *cip)
224 uint_t h = fmd_strhash(cip->ci_code) % chp->ch_hashlen;
226 cip->ci_code_next = chp->ch_code_hash[h];
227 chp->ch_code_hash[h] = cip;
231 fmd_case_code_hash_delete(fmd_case_hash_t *chp, fmd_case_impl_t *cip)
235 if (cip->ci_code) {
236 uint_t h = fmd_strhash(cip->ci_code) % chp->ch_hashlen;
240 if (cp != cip)
260 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
267 ASSERT(MUTEX_HELD(&cip->ci_lock));
268 ASSERT(cip->ci_state >= FMD_CASE_SOLVED);
273 fmd_case_code_hash_delete(chp, cip);
275 fmd_free(cip->ci_code, cip->ci_codelen);
276 cip->ci_codelen = cip->ci_mod->mod_codelen;
277 cip->ci_code = fmd_zalloc(cip->ci_codelen, FMD_SLEEP);
278 keys = keyp = alloca(sizeof (char *) * (cip->ci_nsuspects + 1));
280 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next) {
287 if (cip->ci_nsuspects == 0 || fmd_module_dc_key2code(
288 cip->ci_mod, keys, cip->ci_code, cip->ci_codelen) != 0) {
290 fmd_free(cip->ci_code, cip->ci_codelen);
291 cip->ci_codelen = strlen(s) + 1;
292 cip->ci_code = fmd_zalloc(cip->ci_codelen, FMD_SLEEP);
293 (void) strcpy(cip->ci_code, s);
299 fmd_case_code_hash_insert(chp, cip);
301 return (cip->ci_code);
397 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
405 (void) pthread_mutex_lock(&cip->ci_lock);
406 ASSERT(cip->ci_state >= FMD_CASE_SOLVED);
408 nva = alloca(sizeof (nvlist_t *) * cip->ci_nsuspects);
409 ba = alloca(sizeof (uint8_t) * cip->ci_nsuspects);
419 fcl.fcl_maxcount = cip->ci_nsuspects;
425 if (cip->ci_code == NULL)
438 code = cip->ci_code;
441 cip->ci_flags |= FMD_CF_INVISIBLE;
447 nvl = fmd_protocol_list(class, cip->ci_diag_de == NULL ?
448 cip->ci_mod->mod_fmri : cip->ci_diag_de, cip->ci_uuid, code, count,
449 nva, ba, msg, &cip->ci_tv, cip->ci_injected);
451 (void) pthread_mutex_unlock(&cip->ci_lock);
547 fmd_case_impl_t *cip = fcmsp->fcms_cip;
575 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next, i++)
599 fmd_case_impl_t *cip = fcap->fca_cip;
605 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next)
623 fmd_case_impl_t *cip = fcap->fca_cip;
628 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next)
646 fmd_case_impl_t *cip = fcap->fca_cip;
651 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next)
911 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
927 new_susp_state = alloca(cip->ci_nsuspects * sizeof (uint8_t));
928 for (i = 0; i < cip->ci_nsuspects; i++)
930 new_match_state = alloca(cip->ci_nsuspects * sizeof (uint8_t));
931 for (i = 0; i < cip->ci_nsuspects; i++)
933 fccd.fccd_cip = cip;
965 (void) pthread_mutex_lock(&cip->ci_lock);
966 if (cip->ci_code == NULL)
968 else if (cip->ci_precanned)
969 fmd_case_code_hash_insert(fmd.d_cases, cip);
977 (void) pthread_mutex_unlock(&cip->ci_lock);
984 for (cis = cip->ci_suspects; cis != NULL; cis = cis->cis_next) {
988 "%s: %s\n", cip->ci_uuid, fmd_strerror(errno));
1010 for (i = 0; i < cip->ci_nsuspects; i++) {
1020 for (cis = cip->ci_suspects, i = 0; cis != NULL;
1036 (void) pthread_mutex_unlock(&cip->ci_lock);
1043 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1049 state = cip->ci_state; /* use current state */
1053 (void) pthread_mutex_lock(&cip->ci_lock);
1058 if (cip->ci_precanned == 0 && cip->ci_xprt == NULL &&
1059 cip->ci_code != NULL) {
1060 (void) pthread_mutex_unlock(&cip->ci_lock);
1064 if (cip->ci_tv_valid == 0) {
1065 fmd_time_gettimeofday(&cip->ci_tv);
1066 cip->ci_tv_valid = 1;
1068 (void) pthread_mutex_unlock(&cip->ci_lock);
1071 cip->ci_flags &= ~FMD_CF_SOLVED;
1075 if (cip->ci_xprt != NULL) {
1082 fmd_xprt_impl_t *xip = (fmd_xprt_impl_t *)cip->ci_xprt;
1085 fasp.fasp_maxcount = cip->ci_nsuspects;
1086 fasp.fasp_proxy_asru = cip->ci_proxy_asru;
1103 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
1104 cip->ci_mod->mod_stats->ms_casesolved.fmds_value.ui64++;
1105 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
1112 fmd_eventq_insert_at_head(cip->ci_mod->mod_queue, e);
1114 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
1115 cip->ci_mod->mod_stats->ms_caseclosed.fmds_value.ui64++;
1116 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
1152 fmd_case_impl_t *cip;
1158 for (cip = chp->ch_hash[h]; cip != NULL; cip = cip->ci_next) {
1159 if (strcmp(cip->ci_uuid, uuid) == 0)
1166 if (cip != NULL)
1167 cip = fmd_case_tryhold(cip);
1169 if (cip == NULL)
1173 return ((fmd_case_t *)cip);
1177 fmd_case_hash_insert(fmd_case_hash_t *chp, fmd_case_impl_t *cip)
1183 h = fmd_strhash(cip->ci_uuid) % chp->ch_hashlen;
1186 if (strcmp(cip->ci_uuid, eip->ci_uuid) == 0 &&
1193 cip->ci_next = chp->ch_hash[h];
1194 chp->ch_hash[h] = cip;
1200 return (cip);
1204 fmd_case_hash_delete(fmd_case_hash_t *chp, fmd_case_impl_t *cip)
1209 ASSERT(MUTEX_HELD(&cip->ci_lock));
1211 cip->ci_flags |= FMD_CF_DELETING;
1212 (void) pthread_mutex_unlock(&cip->ci_lock);
1216 h = fmd_strhash(cip->ci_uuid) % chp->ch_hashlen;
1220 if (cp != cip)
1228 (void *)cip, cip->ci_uuid, h);
1237 fmd_case_code_hash_delete(chp, cip);
1244 (void) pthread_mutex_lock(&cip->ci_lock);
1245 ASSERT(cip->ci_flags & FMD_CF_DELETING);
1251 fmd_case_impl_t *cip = fmd_zalloc(sizeof (fmd_case_impl_t), FMD_SLEEP);
1255 (void) pthread_mutex_init(&cip->ci_lock, NULL);
1256 fmd_buf_hash_create(&cip->ci_bufs);
1259 cip->ci_mod = mp;
1260 cip->ci_refs = 1;
1261 cip->ci_state = FMD_CASE_UNSOLVED;
1262 cip->ci_flags = FMD_CF_DIRTY;
1263 cip->ci_data = data;
1271 (void) fmd_conf_getprop(fmd.d_conf, "uuidlen", &cip->ci_uuidlen);
1272 cip->ci_uuid = fmd_zalloc(cip->ci_uuidlen + 1, FMD_SLEEP);
1285 uuid_unparse(uuid, cip->ci_uuid);
1286 } while ((eip = fmd_case_hash_insert(fmd.d_cases, cip)) != cip);
1293 (void) strncpy(cip->ci_uuid, uuidstr, cip->ci_uuidlen + 1);
1294 if (fmd_case_hash_insert(fmd.d_cases, cip) != cip) {
1295 fmd_free(cip->ci_uuid, cip->ci_uuidlen + 1);
1296 (void) fmd_buf_hash_destroy(&cip->ci_bufs);
1298 pthread_mutex_destroy(&cip->ci_lock);
1299 fmd_free(cip, sizeof (*cip));
1305 fmd_list_append(&mp->mod_cases, cip);
1308 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
1309 cip->ci_mod->mod_stats->ms_caseopen.fmds_value.ui64++;
1310 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
1312 return ((fmd_case_t *)cip);
1316 fmd_case_destroy_suspects(fmd_case_impl_t *cip)
1320 ASSERT(MUTEX_HELD(&cip->ci_lock));
1322 if (cip->ci_proxy_asru)
1323 fmd_free(cip->ci_proxy_asru, sizeof (uint8_t) *
1324 cip->ci_nsuspects);
1325 nvlist_free(cip->ci_diag_de);
1326 if (cip->ci_diag_asru)
1327 fmd_free(cip->ci_diag_asru, sizeof (uint8_t) *
1328 cip->ci_nsuspects);
1330 for (cis = cip->ci_suspects; cis != NULL; cis = ncis) {
1336 cip->ci_suspects = NULL;
1337 cip->ci_nsuspects = 0;
1344 fmd_case_impl_t *cip = fmd_zalloc(sizeof (fmd_case_impl_t), FMD_SLEEP);
1347 (void) pthread_mutex_init(&cip->ci_lock, NULL);
1348 fmd_buf_hash_create(&cip->ci_bufs);
1351 cip->ci_mod = mp;
1352 cip->ci_xprt = xp;
1353 cip->ci_refs = 1;
1354 cip->ci_state = state;
1355 cip->ci_uuid = fmd_strdup(uuid, FMD_SLEEP);
1356 cip->ci_uuidlen = strlen(cip->ci_uuid);
1357 cip->ci_code = fmd_strdup(code, FMD_SLEEP);
1358 cip->ci_codelen = cip->ci_code ? strlen(cip->ci_code) + 1 : 0;
1361 cip->ci_flags |= FMD_CF_SOLVED;
1368 if ((eip = fmd_case_hash_insert(fmd.d_cases, cip)) != cip) {
1369 (void) pthread_mutex_lock(&cip->ci_lock);
1370 cip->ci_refs--; /* decrement to zero */
1371 fmd_case_destroy((fmd_case_t *)cip, B_FALSE);
1373 cip = eip; /* switch 'cip' to the existing case */
1374 (void) pthread_mutex_lock(&cip->ci_lock);
1385 if (cip->ci_state < FMD_CASE_CLOSED) {
1386 if (code != NULL && cip->ci_code == NULL) {
1387 cip->ci_code = fmd_strdup(code,
1389 cip->ci_codelen = cip->ci_code ?
1390 strlen(cip->ci_code) + 1 : 0;
1392 cip);
1402 if ((cip->ci_state == FMD_CASE_REPAIRED ||
1403 cip->ci_state == FMD_CASE_RESOLVED) &&
1405 cip->ci_state = FMD_CASE_CLOSED;
1406 (void) pthread_mutex_unlock(&cip->ci_lock);
1407 fmd_case_rele((fmd_case_t *)cip);
1408 return ((fmd_case_t *)cip);
1415 if (cip->ci_mod != fmd.d_rmod || xp != NULL) {
1416 (void) pthread_mutex_unlock(&cip->ci_lock);
1417 fmd_case_rele((fmd_case_t *)cip);
1426 fmd_module_lock(cip->ci_mod);
1427 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
1428 fmd_module_unlock(cip->ci_mod);
1430 fmd_module_rele(cip->ci_mod);
1431 cip->ci_mod = mp;
1445 (fmd_case_t *)cip);
1446 fmd_case_destroy_suspects(cip);
1447 fmd_case_code_hash_delete(fmd.d_cases, cip);
1448 fmd_free(cip->ci_code, cip->ci_codelen);
1449 cip->ci_code = NULL;
1450 cip->ci_codelen = 0;
1451 cip->ci_tv_valid = 0;
1454 cip->ci_state = state;
1456 (void) pthread_mutex_unlock(&cip->ci_lock);
1457 fmd_case_rele((fmd_case_t *)cip);
1462 if (cip->ci_code)
1463 fmd_case_code_hash_insert(fmd.d_cases, cip);
1467 fmd_list_append(&mp->mod_cases, cip);
1469 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
1470 cip->ci_mod->mod_stats->ms_caseopen.fmds_value.ui64++;
1471 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
1473 return ((fmd_case_t *)cip);
1479 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1482 ASSERT(MUTEX_HELD(&cip->ci_lock));
1483 ASSERT(cip->ci_refs == 0);
1486 TRACE((FMD_DBG_CASE, "deleting case %s", cip->ci_uuid));
1487 fmd_case_hash_delete(fmd.d_cases, cip);
1490 for (cit = cip->ci_items; cit != NULL; cit = ncit) {
1496 fmd_case_destroy_suspects(cip);
1498 if (cip->ci_principal != NULL)
1499 fmd_event_rele(cip->ci_principal);
1501 fmd_free(cip->ci_uuid, cip->ci_uuidlen + 1);
1502 fmd_free(cip->ci_code, cip->ci_codelen);
1503 (void) fmd_buf_hash_destroy(&cip->ci_bufs);
1505 fmd_module_rele(cip->ci_mod);
1506 fmd_free(cip, sizeof (fmd_case_impl_t));
1512 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1514 (void) pthread_mutex_lock(&cip->ci_lock);
1516 (void) pthread_mutex_unlock(&cip->ci_lock);
1522 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1524 ASSERT(MUTEX_HELD(&cip->ci_lock));
1525 if (cip->ci_flags & FMD_CF_DELETING)
1527 (void *)cip, cip->ci_uuid);
1528 cip->ci_refs++;
1529 ASSERT(cip->ci_refs != 0);
1533 fmd_case_tryhold(fmd_case_impl_t *cip)
1539 (void) pthread_mutex_lock(&cip->ci_lock);
1540 if (cip->ci_flags & FMD_CF_DELETING) {
1541 (void) pthread_mutex_unlock(&cip->ci_lock);
1542 cip = NULL;
1544 fmd_case_hold_locked((fmd_case_t *)cip);
1545 (void) pthread_mutex_unlock(&cip->ci_lock);
1547 return (cip);
1553 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1555 (void) pthread_mutex_lock(&cip->ci_lock);
1556 ASSERT(cip->ci_refs != 0);
1558 if (--cip->ci_refs == 0)
1559 fmd_case_destroy((fmd_case_t *)cip, B_TRUE);
1561 (void) pthread_mutex_unlock(&cip->ci_lock);
1567 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1569 ASSERT(MUTEX_HELD(&cip->ci_lock));
1570 --cip->ci_refs;
1571 ASSERT(cip->ci_refs != 0);
1577 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1584 (void) pthread_mutex_lock(&cip->ci_lock);
1586 if (cip->ci_flags & FMD_CF_SOLVED)
1591 oep = cip->ci_principal;
1592 cip->ci_principal = ep;
1594 for (cit = cip->ci_items; cit != NULL; cit = cit->cit_next) {
1599 cip->ci_flags |= FMD_CF_DIRTY;
1602 (void) pthread_mutex_unlock(&cip->ci_lock);
1604 fmd_module_setcdirty(cip->ci_mod);
1616 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1622 (void) pthread_mutex_lock(&cip->ci_lock);
1624 if (cip->ci_flags & FMD_CF_SOLVED)
1629 for (cit = cip->ci_items; cit != NULL; cit = cit->cit_next) {
1634 new = cit == NULL && ep != cip->ci_principal;
1640 if (cit != NULL || (cip->ci_flags & FMD_CF_SOLVED)) {
1641 (void) pthread_mutex_unlock(&cip->ci_lock);
1653 cit->cit_next = cip->ci_items;
1656 cip->ci_items = cit;
1657 cip->ci_nitems++;
1659 cip->ci_flags |= FMD_CF_DIRTY;
1660 (void) pthread_mutex_unlock(&cip->ci_lock);
1662 fmd_module_setcdirty(cip->ci_mod);
1671 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1674 (void) pthread_mutex_lock(&cip->ci_lock);
1675 ASSERT(cip->ci_state < FMD_CASE_CLOSE_WAIT);
1676 cip->ci_flags |= FMD_CF_DIRTY;
1678 cis->cis_next = cip->ci_suspects;
1681 cip->ci_suspects = cis;
1682 cip->ci_nsuspects++;
1684 (void) pthread_mutex_unlock(&cip->ci_lock);
1685 if (cip->ci_xprt == NULL)
1686 fmd_module_setcdirty(cip->ci_mod);
1692 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1696 (void) pthread_mutex_lock(&cip->ci_lock);
1698 cis->cis_next = cip->ci_suspects;
1703 cip->ci_flags |= FMD_CF_INVISIBLE;
1705 cip->ci_suspects = cis;
1706 cip->ci_nsuspects++;
1708 (void) pthread_mutex_unlock(&cip->ci_lock);
1714 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1716 (void) pthread_mutex_lock(&cip->ci_lock);
1717 ASSERT(cip->ci_state < FMD_CASE_SOLVED);
1719 fmd_case_destroy_suspects(cip);
1720 cip->ci_flags |= FMD_CF_DIRTY;
1722 (void) pthread_mutex_unlock(&cip->ci_lock);
1723 fmd_module_setcdirty(cip->ci_mod);
1741 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1748 (void) pthread_mutex_lock(&cip->ci_lock);
1750 if (!(cip->ci_flags & FMD_CF_SOLVED) && !(flags & FMD_CF_SOLVED))
1753 cip->ci_flags |= flags;
1755 if (cip->ci_state >= state) {
1756 (void) pthread_mutex_unlock(&cip->ci_lock);
1760 TRACE((FMD_DBG_CASE, "case %s %s->%s", cip->ci_uuid,
1761 _fmd_case_snames[cip->ci_state], _fmd_case_snames[state]));
1763 cip->ci_state = state;
1764 cip->ci_flags |= FMD_CF_DIRTY;
1766 if (cip->ci_xprt == NULL && cip->ci_mod != fmd.d_rmod)
1767 fmd_module_setcdirty(cip->ci_mod);
1771 for (cit = cip->ci_items; cit != NULL; cit = cit->cit_next)
1774 if (cip->ci_principal != NULL) {
1775 fmd_event_transition(cip->ci_principal,
1786 if ((cip->ci_flags & (FMD_CF_SOLVED | FMD_CF_ISOLATED |
1797 if (cip->ci_flags & FMD_CF_REPAIRED) {
1798 state = cip->ci_state = FMD_CASE_REPAIRED;
1800 cip->ci_uuid,
1805 state = cip->ci_state = FMD_CASE_CLOSED;
1807 cip->ci_uuid,
1816 ASSERT(cip->ci_xprt != NULL || fmd_case_orphaned(cp));
1830 if (cip->ci_xprt != NULL)
1831 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
1838 if (cip->ci_xprt != NULL) {
1839 fmd_xprt_uuresolved(cip->ci_xprt, cip->ci_uuid);
1844 cip->ci_state = FMD_CASE_RESOLVED;
1845 (void) pthread_mutex_unlock(&cip->ci_lock);
1847 TRACE((FMD_DBG_CASE, "case %s %s->%s", cip->ci_uuid,
1852 (void) pthread_mutex_lock(&cip->ci_lock);
1861 if (cip->ci_xprt != NULL) {
1862 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
1876 (void) pthread_mutex_unlock(&cip->ci_lock);
1884 (void) pthread_mutex_unlock(&cip->ci_lock);
1895 if (cip->ci_mod->mod_flags & FMD_MOD_INIT)
1900 fmd_eventq_insert_at_head(cip->ci_mod->mod_queue, e);
1904 if (cip->ci_xprt != NULL) {
1912 (void) pthread_mutex_lock(&cip->ci_lock);
1914 (void) pthread_mutex_unlock(&cip->ci_lock);
1919 (void) pthread_mutex_lock(&cip->ci_lock);
1921 cip->ci_flags |= FMD_CF_RES_CMPL;
1922 (void) pthread_mutex_unlock(&cip->ci_lock);
1935 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1940 (void) pthread_mutex_lock(&cip->ci_lock);
1941 if (!(cip->ci_flags & FMD_CF_RES_CMPL)) {
1942 (void) pthread_mutex_unlock(&cip->ci_lock);
1955 (void) pthread_mutex_unlock(&cip->ci_lock);
1964 fmd_module_lock(cip->ci_mod);
1965 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
1966 fmd_module_unlock(cip->ci_mod);
1968 cip->ci_flags &= ~FMD_CF_RES_CMPL;
1969 (void) pthread_mutex_unlock(&cip->ci_lock);
1983 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
1988 (void) pthread_mutex_lock(&cip->ci_lock);
1992 (void) pthread_mutex_unlock(&cip->ci_lock);
2005 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2007 (void) pthread_mutex_lock(&cip->ci_lock);
2008 cip->ci_flags |= FMD_CF_DIRTY;
2009 (void) pthread_mutex_unlock(&cip->ci_lock);
2011 fmd_module_setcdirty(cip->ci_mod);
2017 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2019 (void) pthread_mutex_lock(&cip->ci_lock);
2020 cip->ci_flags &= ~FMD_CF_DIRTY;
2021 (void) pthread_mutex_unlock(&cip->ci_lock);
2027 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2030 (void) pthread_mutex_lock(&cip->ci_lock);
2032 if (cip->ci_flags & FMD_CF_DIRTY) {
2033 for (cit = cip->ci_items; cit != NULL; cit = cit->cit_next)
2036 if (cip->ci_principal != NULL)
2037 fmd_event_commit(cip->ci_principal);
2039 fmd_buf_hash_commit(&cip->ci_bufs);
2040 cip->ci_flags &= ~FMD_CF_DIRTY;
2043 (void) pthread_mutex_unlock(&cip->ci_lock);
2052 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2059 ASSERT(cip->ci_xprt != NULL);
2060 (void) pthread_mutex_lock(&cip->ci_lock);
2061 ba = alloca(sizeof (uint8_t) * cip->ci_nsuspects);
2062 nva = alloca(sizeof (nvlist_t *) * cip->ci_nsuspects);
2064 fcl.fcl_maxcount = cip->ci_nsuspects;
2069 (void) pthread_mutex_unlock(&cip->ci_lock);
2070 fmd_xprt_updated(cip->ci_xprt, cip->ci_uuid, ba, cip->ci_proxy_asru,
2083 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2091 faus.faus_maxcount = cip->ci_nsuspects;
2095 faus.faus_is_proxy = (cip->ci_xprt != NULL);
2096 (void) pthread_mutex_lock(&cip->ci_lock);
2099 (void) pthread_mutex_unlock(&cip->ci_lock);
2110 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2112 (void) pthread_mutex_lock(&cip->ci_lock);
2115 (void) pthread_mutex_unlock(&cip->ci_lock);
2125 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2133 facs.facs_maxcount = cip->ci_nsuspects;
2134 (void) pthread_mutex_lock(&cip->ci_lock);
2137 (void) pthread_mutex_unlock(&cip->ci_lock);
2148 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2152 (void) pthread_mutex_lock(&cip->ci_lock);
2153 cstate = cip->ci_state;
2155 if (cip->ci_state < FMD_CASE_SOLVED) {
2156 (void) pthread_mutex_unlock(&cip->ci_lock);
2160 if (cip->ci_flags & FMD_CF_REPAIRED) {
2161 (void) pthread_mutex_unlock(&cip->ci_lock);
2165 TRACE((FMD_DBG_CASE, "case update %s", cip->ci_uuid));
2167 (void) pthread_mutex_unlock(&cip->ci_lock);
2174 TRACE((FMD_DBG_CASE, "sending list.updated %s", cip->ci_uuid));
2203 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2207 TRACE((FMD_DBG_CASE, "case delete %s", cip->ci_uuid));
2208 ASSERT(fmd_module_locked(cip->ci_mod));
2209 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
2210 buftotal = fmd_buf_hash_destroy(&cip->ci_bufs);
2212 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
2213 msp = cip->ci_mod->mod_stats;
2221 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
2223 if (cip->ci_xprt == NULL)
2224 fmd_module_setcdirty(cip->ci_mod);
2226 fmd_module_rele(cip->ci_mod);
2227 cip->ci_mod = fmd.d_rmod;
2228 fmd_module_hold(cip->ci_mod);
2235 if (cip->ci_flags & FMD_CF_SOLVED) {
2236 fmd_module_lock(cip->ci_mod);
2237 fmd_list_append(&cip->ci_mod->mod_cases, cip);
2238 fmd_module_unlock(cip->ci_mod);
2250 if (cip->ci_flags & FMD_CF_REPAIRED)
2252 else if (cip->ci_flags & FMD_CF_ISOLATED) {
2254 if (cip->ci_xprt != NULL)
2255 fmd_xprt_uuclose(cip->ci_xprt, cip->ci_uuid);
2264 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2266 (void) pthread_mutex_lock(&cip->ci_mod->mod_stats_lock);
2267 cip->ci_mod->mod_stats->ms_caseopen.fmds_value.ui64--;
2268 (void) pthread_mutex_unlock(&cip->ci_mod->mod_stats_lock);
2270 ASSERT(fmd_module_locked(cip->ci_mod));
2271 fmd_list_delete(&cip->ci_mod->mod_cases, cip);
2273 (void) pthread_mutex_lock(&cip->ci_lock);
2275 (void) pthread_mutex_unlock(&cip->ci_lock);
2290 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2294 (void) pthread_mutex_lock(&cip->ci_lock);
2295 cstate = cip->ci_state;
2298 (void) pthread_mutex_unlock(&cip->ci_lock);
2302 if (cip->ci_flags & FMD_CF_REPAIRED) {
2303 (void) pthread_mutex_unlock(&cip->ci_lock);
2307 TRACE((FMD_DBG_CASE, "case repair %s", cip->ci_uuid));
2312 (void) pthread_mutex_unlock(&cip->ci_lock);
2319 if (cip->ci_xprt != NULL) {
2335 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2339 (void) pthread_mutex_lock(&cip->ci_lock);
2340 cstate = cip->ci_state;
2343 (void) pthread_mutex_unlock(&cip->ci_lock);
2347 if (cip->ci_flags & FMD_CF_REPAIRED) {
2348 (void) pthread_mutex_unlock(&cip->ci_lock);
2352 TRACE((FMD_DBG_CASE, "case acquit %s", cip->ci_uuid));
2357 (void) pthread_mutex_unlock(&cip->ci_lock);
2364 if (cip->ci_xprt != NULL) {
2380 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2385 (void) pthread_mutex_lock(&cip->ci_lock);
2387 if (cip->ci_state >= FMD_CASE_SOLVED)
2392 for (cit = cip->ci_items; cit != NULL; cit = cit->cit_next) {
2397 if (rv == 0 && cip->ci_principal != NULL)
2398 rv = fmd_event_equal(ep, cip->ci_principal);
2400 (void) pthread_mutex_unlock(&cip->ci_lock);
2431 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2433 nvlist_free(cip->ci_diag_de);
2434 cip->ci_diag_de = nvl;
2440 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2442 cip->ci_code = fmd_strdup(code, FMD_SLEEP);
2443 cip->ci_codelen = cip->ci_code ? strlen(cip->ci_code) + 1 : 0;
2456 fmd_case_impl_t *cip = (fmd_case_impl_t *)cp;
2458 if (cip->ci_state < FMD_CASE_SOLVED || cip->ci_xprt != NULL)
2461 if (cip->ci_state == FMD_CASE_RESOLVED) {
2462 cip->ci_flags |= FMD_CF_RES_CMPL;
2470 if (cip->ci_state >= FMD_CASE_REPAIRED && !faulty) {
2479 cip->ci_state = FMD_CASE_RESOLVED;
2482 cip->ci_uuid));
2490 cip->ci_uuid));
2494 cip->ci_flags |= FMD_CF_RES_CMPL;
2497 cip->ci_uuid));
2510 cip->ci_uuid));