diff options
author | Eric Schrock <Eric.Schrock@Sun.COM> | 2009-05-26 19:24:50 -0700 |
---|---|---|
committer | Eric Schrock <Eric.Schrock@Sun.COM> | 2009-05-26 19:24:50 -0700 |
commit | 07312882d9573a94daa8260c0744011540574003 (patch) | |
tree | 65d4ca838ad2f401d6aca7cb6795741a22801435 | |
parent | 65a41de728a87c70857297eb630061395f92f746 (diff) | |
download | illumos-gate-07312882d9573a94daa8260c0744011540574003.tar.gz |
6844880 fmd_asru_hash_apply_*() should take const char pointer
6844881 fmd should update topo snapshot on EC_DEV_{ADD, REMOVE}
6844882 fmd should be more careful with topo timestamps
-rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_asru.c | 10 | ||||
-rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_asru.h | 8 | ||||
-rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_dr.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_topo.c | 12 | ||||
-rw-r--r-- | usr/src/cmd/fm/fmd/common/fmd_topo.h | 7 |
5 files changed, 22 insertions, 21 deletions
diff --git a/usr/src/cmd/fm/fmd/common/fmd_asru.c b/usr/src/cmd/fm/fmd/common/fmd_asru.c index 04b97efe6e..a5740f6fdf 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_asru.c +++ b/usr/src/cmd/fm/fmd/common/fmd_asru.c @@ -870,7 +870,7 @@ fmd_asru_al_hash_apply(fmd_asru_hash_t *ahp, } static void -fmd_asru_do_hash_apply(fmd_asru_hash_t *ahp, char *name, +fmd_asru_do_hash_apply(fmd_asru_hash_t *ahp, const char *name, void (*func)(fmd_asru_link_t *, void *), void *arg, fmd_asru_link_t **hash, size_t match_offset, size_t next_offset) { @@ -912,7 +912,7 @@ fmd_asru_do_hash_apply(fmd_asru_hash_t *ahp, char *name, } void -fmd_asru_hash_apply_by_asru(fmd_asru_hash_t *ahp, char *name, +fmd_asru_hash_apply_by_asru(fmd_asru_hash_t *ahp, const char *name, void (*func)(fmd_asru_link_t *, void *), void *arg) { fmd_asru_do_hash_apply(ahp, name, func, arg, ahp->ah_asru_hash, @@ -930,7 +930,7 @@ fmd_asru_hash_apply_by_case(fmd_asru_hash_t *ahp, fmd_case_t *cp, } void -fmd_asru_hash_apply_by_fru(fmd_asru_hash_t *ahp, char *name, +fmd_asru_hash_apply_by_fru(fmd_asru_hash_t *ahp, const char *name, void (*func)(fmd_asru_link_t *, void *), void *arg) { fmd_asru_do_hash_apply(ahp, name, func, arg, ahp->ah_fru_hash, @@ -939,7 +939,7 @@ fmd_asru_hash_apply_by_fru(fmd_asru_hash_t *ahp, char *name, } void -fmd_asru_hash_apply_by_rsrc(fmd_asru_hash_t *ahp, char *name, +fmd_asru_hash_apply_by_rsrc(fmd_asru_hash_t *ahp, const char *name, void (*func)(fmd_asru_link_t *, void *), void *arg) { fmd_asru_do_hash_apply(ahp, name, func, arg, ahp->ah_rsrc_hash, @@ -948,7 +948,7 @@ fmd_asru_hash_apply_by_rsrc(fmd_asru_hash_t *ahp, char *name, } void -fmd_asru_hash_apply_by_label(fmd_asru_hash_t *ahp, char *name, +fmd_asru_hash_apply_by_label(fmd_asru_hash_t *ahp, const char *name, void (*func)(fmd_asru_link_t *, void *), void *arg) { fmd_asru_do_hash_apply(ahp, name, func, arg, ahp->ah_label_hash, diff --git a/usr/src/cmd/fm/fmd/common/fmd_asru.h b/usr/src/cmd/fm/fmd/common/fmd_asru.h index c350c801c0..18a8e073e6 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_asru.h +++ b/usr/src/cmd/fm/fmd/common/fmd_asru.h @@ -147,13 +147,13 @@ extern void fmd_asru_hash_apply(fmd_asru_hash_t *, void (*)(fmd_asru_t *, void *), void *); extern void fmd_asru_al_hash_apply(fmd_asru_hash_t *, void (*)(fmd_asru_link_t *, void *), void *); -extern void fmd_asru_hash_apply_by_asru(fmd_asru_hash_t *, char *, +extern void fmd_asru_hash_apply_by_asru(fmd_asru_hash_t *, const char *, void (*)(fmd_asru_link_t *, void *), void *); -extern void fmd_asru_hash_apply_by_label(fmd_asru_hash_t *, char *, +extern void fmd_asru_hash_apply_by_label(fmd_asru_hash_t *, const char *, void (*)(fmd_asru_link_t *, void *), void *); -extern void fmd_asru_hash_apply_by_fru(fmd_asru_hash_t *, char *, +extern void fmd_asru_hash_apply_by_fru(fmd_asru_hash_t *, const char *, void (*)(fmd_asru_link_t *, void *), void *); -extern void fmd_asru_hash_apply_by_rsrc(fmd_asru_hash_t *, char *, +extern void fmd_asru_hash_apply_by_rsrc(fmd_asru_hash_t *, const char *, void (*)(fmd_asru_link_t *, void *), void *); extern void fmd_asru_hash_apply_by_case(fmd_asru_hash_t *, fmd_case_t *, void (*)(fmd_asru_link_t *, void *), void *); diff --git a/usr/src/cmd/fm/fmd/common/fmd_dr.c b/usr/src/cmd/fm/fmd/common/fmd_dr.c index 415ff9bce8..b95e52da22 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_dr.c +++ b/usr/src/cmd/fm/fmd/common/fmd_dr.c @@ -123,6 +123,8 @@ fmd_dr_event(sysevent_t *sep) strcmp(class, EC_DEV_REMOVE) == 0) { if (strcmp(subclass, ESC_DISK) != 0) return; + + update_topo = B_TRUE; } /* @@ -144,7 +146,7 @@ fmd_dr_event(sysevent_t *sep) */ sysevent_get_time(sep, &evtime); prev = fmd_topo_hold(); - if (evtime <= prev->ft_time && + if (evtime <= prev->ft_time_begin && fmd.d_clockops == &fmd_timeops_native) { fmd_topo_rele(prev); return; @@ -155,6 +157,6 @@ fmd_dr_event(sysevent_t *sep) fmd_topo_update(); ftp = fmd_topo_hold(); - e = fmd_event_create(FMD_EVT_TOPO, ftp->ft_time, NULL, ftp); + e = fmd_event_create(FMD_EVT_TOPO, ftp->ft_time_end, NULL, ftp); fmd_modhash_dispatch(fmd.d_mod_hash, e); } diff --git a/usr/src/cmd/fm/fmd/common/fmd_topo.c b/usr/src/cmd/fm/fmd/common/fmd_topo.c index 2f76fccaeb..b6f2ba0ff5 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_topo.c +++ b/usr/src/cmd/fm/fmd/common/fmd_topo.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * FMD Topology Handling * @@ -85,15 +83,17 @@ fmd_topo_update(void) fmd_panic("failed to open topology library: %s", topo_strerror(err)); + ftp = fmd_alloc(sizeof (fmd_topo_t), FMD_SLEEP); + ftp->ft_hdl = tp; + ftp->ft_time_begin = fmd_time_gethrtime(); + if ((id = topo_snap_hold(tp, NULL, &err)) == NULL) fmd_panic("failed to get topology snapshot: %s", topo_strerror(err)); topo_hdl_strfree(tp, id); - ftp = fmd_alloc(sizeof (fmd_topo_t), FMD_SLEEP); - ftp->ft_hdl = tp; - ftp->ft_time = fmd_time_gethrtime(); + ftp->ft_time_end = fmd_time_gethrtime(); fmd.d_stats->ds_topo_gen.fmds_value.ui64++; /* diff --git a/usr/src/cmd/fm/fmd/common/fmd_topo.h b/usr/src/cmd/fm/fmd/common/fmd_topo.h index 6bb84d7f92..feb211da87 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_topo.h +++ b/usr/src/cmd/fm/fmd/common/fmd_topo.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _FMD_TOPO_H #define _FMD_TOPO_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -43,7 +41,8 @@ typedef struct fmd_topo { fmd_list_t ft_list; topo_hdl_t *ft_hdl; uint32_t ft_refcount; - hrtime_t ft_time; + hrtime_t ft_time_begin; + hrtime_t ft_time_end; } fmd_topo_t; extern void fmd_topo_update(void); |