xref: /illumos-gate/usr/src/cmd/fm/fmd/common/fmd_serd.c (revision 1743a90d)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #include <fmd_alloc.h>
287c478bd9Sstevel@tonic-gate #include <fmd_string.h>
297c478bd9Sstevel@tonic-gate #include <fmd_subr.h>
307c478bd9Sstevel@tonic-gate #include <fmd_api.h>
317c478bd9Sstevel@tonic-gate #include <fmd_serd.h>
327c478bd9Sstevel@tonic-gate #include <fmd.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate static fmd_serd_eng_t *
fmd_serd_eng_alloc(const char * name,uint64_t n,hrtime_t t)357c478bd9Sstevel@tonic-gate fmd_serd_eng_alloc(const char *name, uint64_t n, hrtime_t t)
367c478bd9Sstevel@tonic-gate {
377c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp = fmd_zalloc(sizeof (fmd_serd_eng_t), FMD_SLEEP);
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate 	sgp->sg_name = fmd_strdup(name, FMD_SLEEP);
407c478bd9Sstevel@tonic-gate 	sgp->sg_flags = FMD_SERD_DIRTY;
417c478bd9Sstevel@tonic-gate 	sgp->sg_n = n;
427c478bd9Sstevel@tonic-gate 	sgp->sg_t = t;
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate 	return (sgp);
457c478bd9Sstevel@tonic-gate }
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate static void
fmd_serd_eng_free(fmd_serd_eng_t * sgp)487c478bd9Sstevel@tonic-gate fmd_serd_eng_free(fmd_serd_eng_t *sgp)
497c478bd9Sstevel@tonic-gate {
507c478bd9Sstevel@tonic-gate 	fmd_serd_eng_reset(sgp);
517c478bd9Sstevel@tonic-gate 	fmd_strfree(sgp->sg_name);
527c478bd9Sstevel@tonic-gate 	fmd_free(sgp, sizeof (fmd_serd_eng_t));
537c478bd9Sstevel@tonic-gate }
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate void
fmd_serd_hash_create(fmd_serd_hash_t * shp)567c478bd9Sstevel@tonic-gate fmd_serd_hash_create(fmd_serd_hash_t *shp)
577c478bd9Sstevel@tonic-gate {
587c478bd9Sstevel@tonic-gate 	shp->sh_hashlen = fmd.d_str_buckets;
597c478bd9Sstevel@tonic-gate 	shp->sh_hash = fmd_zalloc(sizeof (void *) * shp->sh_hashlen, FMD_SLEEP);
607c478bd9Sstevel@tonic-gate 	shp->sh_count = 0;
617c478bd9Sstevel@tonic-gate }
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate void
fmd_serd_hash_destroy(fmd_serd_hash_t * shp)647c478bd9Sstevel@tonic-gate fmd_serd_hash_destroy(fmd_serd_hash_t *shp)
657c478bd9Sstevel@tonic-gate {
667c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp, *ngp;
677c478bd9Sstevel@tonic-gate 	uint_t i;
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate 	for (i = 0; i < shp->sh_hashlen; i++) {
707c478bd9Sstevel@tonic-gate 		for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = ngp) {
717c478bd9Sstevel@tonic-gate 			ngp = sgp->sg_next;
727c478bd9Sstevel@tonic-gate 			fmd_serd_eng_free(sgp);
737c478bd9Sstevel@tonic-gate 		}
747c478bd9Sstevel@tonic-gate 	}
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate 	fmd_free(shp->sh_hash, sizeof (void *) * shp->sh_hashlen);
777c478bd9Sstevel@tonic-gate 	bzero(shp, sizeof (fmd_serd_hash_t));
787c478bd9Sstevel@tonic-gate }
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate void
fmd_serd_hash_apply(fmd_serd_hash_t * shp,fmd_serd_eng_f * func,void * arg)817c478bd9Sstevel@tonic-gate fmd_serd_hash_apply(fmd_serd_hash_t *shp, fmd_serd_eng_f *func, void *arg)
827c478bd9Sstevel@tonic-gate {
837c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp;
847c478bd9Sstevel@tonic-gate 	uint_t i;
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate 	for (i = 0; i < shp->sh_hashlen; i++) {
877c478bd9Sstevel@tonic-gate 		for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = sgp->sg_next)
887c478bd9Sstevel@tonic-gate 			func(sgp, arg);
897c478bd9Sstevel@tonic-gate 	}
907c478bd9Sstevel@tonic-gate }
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate uint_t
fmd_serd_hash_count(fmd_serd_hash_t * shp)937c478bd9Sstevel@tonic-gate fmd_serd_hash_count(fmd_serd_hash_t *shp)
947c478bd9Sstevel@tonic-gate {
957c478bd9Sstevel@tonic-gate 	return (shp->sh_count);
967c478bd9Sstevel@tonic-gate }
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate int
fmd_serd_hash_contains(fmd_serd_hash_t * shp,fmd_event_t * ep)997c478bd9Sstevel@tonic-gate fmd_serd_hash_contains(fmd_serd_hash_t *shp, fmd_event_t *ep)
1007c478bd9Sstevel@tonic-gate {
1017c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp;
1027c478bd9Sstevel@tonic-gate 	uint_t i;
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate 	for (i = 0; i < shp->sh_hashlen; i++) {
1057c478bd9Sstevel@tonic-gate 		for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = sgp->sg_next) {
1067c478bd9Sstevel@tonic-gate 			if (fmd_serd_eng_contains(sgp, ep)) {
1077c478bd9Sstevel@tonic-gate 				fmd_event_transition(ep, FMD_EVS_ACCEPTED);
1087c478bd9Sstevel@tonic-gate 				return (1);
1097c478bd9Sstevel@tonic-gate 			}
1107c478bd9Sstevel@tonic-gate 		}
1117c478bd9Sstevel@tonic-gate 	}
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate 	return (0);
1147c478bd9Sstevel@tonic-gate }
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate fmd_serd_eng_t *
fmd_serd_eng_insert(fmd_serd_hash_t * shp,const char * name,uint_t n,hrtime_t t)1177c478bd9Sstevel@tonic-gate fmd_serd_eng_insert(fmd_serd_hash_t *shp,
1187c478bd9Sstevel@tonic-gate     const char *name, uint_t n, hrtime_t t)
1197c478bd9Sstevel@tonic-gate {
1207c478bd9Sstevel@tonic-gate 	uint_t h = fmd_strhash(name) % shp->sh_hashlen;
1217c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp = fmd_serd_eng_alloc(name, n, t);
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate 	sgp->sg_next = shp->sh_hash[h];
1247c478bd9Sstevel@tonic-gate 	shp->sh_hash[h] = sgp;
1257c478bd9Sstevel@tonic-gate 	shp->sh_count++;
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate 	return (sgp);
1287c478bd9Sstevel@tonic-gate }
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate fmd_serd_eng_t *
fmd_serd_eng_lookup(fmd_serd_hash_t * shp,const char * name)1317c478bd9Sstevel@tonic-gate fmd_serd_eng_lookup(fmd_serd_hash_t *shp, const char *name)
1327c478bd9Sstevel@tonic-gate {
1337c478bd9Sstevel@tonic-gate 	uint_t h = fmd_strhash(name) % shp->sh_hashlen;
1347c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp;
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate 	for (sgp = shp->sh_hash[h]; sgp != NULL; sgp = sgp->sg_next) {
1377c478bd9Sstevel@tonic-gate 		if (strcmp(name, sgp->sg_name) == 0)
1387c478bd9Sstevel@tonic-gate 			return (sgp);
1397c478bd9Sstevel@tonic-gate 	}
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate 	return (NULL);
1427c478bd9Sstevel@tonic-gate }
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate void
fmd_serd_eng_delete(fmd_serd_hash_t * shp,const char * name)1457c478bd9Sstevel@tonic-gate fmd_serd_eng_delete(fmd_serd_hash_t *shp, const char *name)
1467c478bd9Sstevel@tonic-gate {
1477c478bd9Sstevel@tonic-gate 	uint_t h = fmd_strhash(name) % shp->sh_hashlen;
1487c478bd9Sstevel@tonic-gate 	fmd_serd_eng_t *sgp, **pp = &shp->sh_hash[h];
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate 	for (sgp = *pp; sgp != NULL; sgp = sgp->sg_next) {
1517c478bd9Sstevel@tonic-gate 		if (strcmp(sgp->sg_name, name) != 0)
1527c478bd9Sstevel@tonic-gate 			pp = &sgp->sg_next;
1537c478bd9Sstevel@tonic-gate 		else
1547c478bd9Sstevel@tonic-gate 			break;
1557c478bd9Sstevel@tonic-gate 	}
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate 	if (sgp != NULL) {
1587c478bd9Sstevel@tonic-gate 		*pp = sgp->sg_next;
1597c478bd9Sstevel@tonic-gate 		fmd_serd_eng_free(sgp);
1607c478bd9Sstevel@tonic-gate 		ASSERT(shp->sh_count != 0);
1617c478bd9Sstevel@tonic-gate 		shp->sh_count--;
1627c478bd9Sstevel@tonic-gate 	}
1637c478bd9Sstevel@tonic-gate }
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate static void
fmd_serd_eng_discard(fmd_serd_eng_t * sgp,fmd_serd_elem_t * sep)1667c478bd9Sstevel@tonic-gate fmd_serd_eng_discard(fmd_serd_eng_t *sgp, fmd_serd_elem_t *sep)
1677c478bd9Sstevel@tonic-gate {
1687c478bd9Sstevel@tonic-gate 	fmd_list_delete(&sgp->sg_list, sep);
1697c478bd9Sstevel@tonic-gate 	sgp->sg_count--;
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate 	fmd_event_rele(sep->se_event);
1727c478bd9Sstevel@tonic-gate 	fmd_free(sep, sizeof (fmd_serd_elem_t));
1737c478bd9Sstevel@tonic-gate }
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate int
fmd_serd_eng_contains(fmd_serd_eng_t * sgp,fmd_event_t * ep)1767c478bd9Sstevel@tonic-gate fmd_serd_eng_contains(fmd_serd_eng_t *sgp, fmd_event_t *ep)
1777c478bd9Sstevel@tonic-gate {
1787c478bd9Sstevel@tonic-gate 	fmd_serd_elem_t *sep;
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate 	for (sep = fmd_list_next(&sgp->sg_list);
1817c478bd9Sstevel@tonic-gate 	    sep != NULL; sep = fmd_list_next(sep)) {
1827c478bd9Sstevel@tonic-gate 		if (fmd_event_equal(sep->se_event, ep))
1837c478bd9Sstevel@tonic-gate 			return (1);
1847c478bd9Sstevel@tonic-gate 	}
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate 	return (0);
1877c478bd9Sstevel@tonic-gate }
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate int
fmd_serd_eng_record(void * ptr,fmd_event_t * ep)190*1743a90dSToomas Soome fmd_serd_eng_record(void *ptr, fmd_event_t *ep)
1917c478bd9Sstevel@tonic-gate {
192*1743a90dSToomas Soome 	fmd_serd_eng_t *sgp = ptr;
1937c478bd9Sstevel@tonic-gate 	fmd_serd_elem_t *sep, *oep;
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate 	/*
1967c478bd9Sstevel@tonic-gate 	 * If the fired flag is already set, return false and discard the
1977c478bd9Sstevel@tonic-gate 	 * event.  This means that the caller will only see the engine "fire"
1987c478bd9Sstevel@tonic-gate 	 * once until fmd_serd_eng_reset() is called.  The fmd_serd_eng_fired()
1997c478bd9Sstevel@tonic-gate 	 * function can also be used in combination with fmd_serd_eng_record().
2007c478bd9Sstevel@tonic-gate 	 */
2017c478bd9Sstevel@tonic-gate 	if (sgp->sg_flags & FMD_SERD_FIRED)
2027c478bd9Sstevel@tonic-gate 		return (FMD_B_FALSE);
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate 	while (sgp->sg_count > sgp->sg_n)
2057c478bd9Sstevel@tonic-gate 		fmd_serd_eng_discard(sgp, fmd_list_next(&sgp->sg_list));
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate 	fmd_event_hold(ep);
2087c478bd9Sstevel@tonic-gate 	fmd_event_transition(ep, FMD_EVS_ACCEPTED);
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate 	sep = fmd_alloc(sizeof (fmd_serd_elem_t), FMD_SLEEP);
2117c478bd9Sstevel@tonic-gate 	sep->se_event = ep;
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate 	fmd_list_append(&sgp->sg_list, sep);
2147c478bd9Sstevel@tonic-gate 	sgp->sg_count++;
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate 	/*
2177c478bd9Sstevel@tonic-gate 	 * Pick up the oldest element pointer for comparison to 'sep'.  We must
2187c478bd9Sstevel@tonic-gate 	 * do this after adding 'sep' because 'oep' and 'sep' can be the same.
2197c478bd9Sstevel@tonic-gate 	 */
2207c478bd9Sstevel@tonic-gate 	oep = fmd_list_next(&sgp->sg_list);
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate 	if (sgp->sg_count > sgp->sg_n &&
2237c478bd9Sstevel@tonic-gate 	    fmd_event_delta(oep->se_event, sep->se_event) <= sgp->sg_t) {
2247c478bd9Sstevel@tonic-gate 		sgp->sg_flags |= FMD_SERD_FIRED | FMD_SERD_DIRTY;
2257c478bd9Sstevel@tonic-gate 		return (FMD_B_TRUE);
2267c478bd9Sstevel@tonic-gate 	}
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate 	sgp->sg_flags |= FMD_SERD_DIRTY;
2297c478bd9Sstevel@tonic-gate 	return (FMD_B_FALSE);
2307c478bd9Sstevel@tonic-gate }
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate int
fmd_serd_eng_fired(fmd_serd_eng_t * sgp)2337c478bd9Sstevel@tonic-gate fmd_serd_eng_fired(fmd_serd_eng_t *sgp)
2347c478bd9Sstevel@tonic-gate {
2357c478bd9Sstevel@tonic-gate 	return (sgp->sg_flags & FMD_SERD_FIRED);
2367c478bd9Sstevel@tonic-gate }
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate int
fmd_serd_eng_empty(fmd_serd_eng_t * sgp)2397c478bd9Sstevel@tonic-gate fmd_serd_eng_empty(fmd_serd_eng_t *sgp)
2407c478bd9Sstevel@tonic-gate {
2417c478bd9Sstevel@tonic-gate 	return (sgp->sg_count == 0);
2427c478bd9Sstevel@tonic-gate }
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate void
fmd_serd_eng_reset(fmd_serd_eng_t * sgp)2457c478bd9Sstevel@tonic-gate fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
2467c478bd9Sstevel@tonic-gate {
2477c478bd9Sstevel@tonic-gate 	while (sgp->sg_count != 0)
2487c478bd9Sstevel@tonic-gate 		fmd_serd_eng_discard(sgp, fmd_list_next(&sgp->sg_list));
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate 	sgp->sg_flags &= ~FMD_SERD_FIRED;
2517c478bd9Sstevel@tonic-gate 	sgp->sg_flags |= FMD_SERD_DIRTY;
2527c478bd9Sstevel@tonic-gate }
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate void
fmd_serd_eng_gc(fmd_serd_eng_t * sgp,void * arg __unused)255*1743a90dSToomas Soome fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg __unused)
2567c478bd9Sstevel@tonic-gate {
2577c478bd9Sstevel@tonic-gate 	fmd_serd_elem_t *sep, *nep;
2587c478bd9Sstevel@tonic-gate 	hrtime_t hrt;
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate 	if (sgp->sg_count == 0 || (sgp->sg_flags & FMD_SERD_FIRED))
2617c478bd9Sstevel@tonic-gate 		return; /* no garbage collection needed if empty or fired */
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate 	sep = fmd_list_prev(&sgp->sg_list);
2647c478bd9Sstevel@tonic-gate 	hrt = fmd_event_hrtime(sep->se_event) - sgp->sg_t;
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate 	for (sep = fmd_list_next(&sgp->sg_list); sep != NULL; sep = nep) {
2677c478bd9Sstevel@tonic-gate 		if (fmd_event_hrtime(sep->se_event) >= hrt)
2687c478bd9Sstevel@tonic-gate 			break; /* sep and subsequent events are all within T */
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate 		nep = fmd_list_next(sep);
2717c478bd9Sstevel@tonic-gate 		fmd_serd_eng_discard(sgp, sep);
2727c478bd9Sstevel@tonic-gate 		sgp->sg_flags |= FMD_SERD_DIRTY;
2737c478bd9Sstevel@tonic-gate 	}
2747c478bd9Sstevel@tonic-gate }
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate void
fmd_serd_eng_commit(fmd_serd_eng_t * sgp,void * arg __unused)277*1743a90dSToomas Soome fmd_serd_eng_commit(fmd_serd_eng_t *sgp, void *arg __unused)
2787c478bd9Sstevel@tonic-gate {
2797c478bd9Sstevel@tonic-gate 	fmd_serd_elem_t *sep;
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate 	if (!(sgp->sg_flags & FMD_SERD_DIRTY))
2827c478bd9Sstevel@tonic-gate 		return; /* engine has not changed since last commit */
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate 	for (sep = fmd_list_next(&sgp->sg_list); sep != NULL;
2857c478bd9Sstevel@tonic-gate 	    sep = fmd_list_next(sep))
2867c478bd9Sstevel@tonic-gate 		fmd_event_commit(sep->se_event);
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate 	sgp->sg_flags &= ~FMD_SERD_DIRTY;
2897c478bd9Sstevel@tonic-gate }
2907c478bd9Sstevel@tonic-gate 
2917c478bd9Sstevel@tonic-gate void
fmd_serd_eng_clrdirty(fmd_serd_eng_t * sgp,void * arg __unused)292*1743a90dSToomas Soome fmd_serd_eng_clrdirty(fmd_serd_eng_t *sgp, void *arg __unused)
2937c478bd9Sstevel@tonic-gate {
2947c478bd9Sstevel@tonic-gate 	sgp->sg_flags &= ~FMD_SERD_DIRTY;
2957c478bd9Sstevel@tonic-gate }
296