From 9e8164f5f5658c6e38a931780d499f5cb622908a Mon Sep 17 00:00:00 2001 From: ahl Date: Fri, 29 Jun 2007 11:12:38 -0700 Subject: PSARC 2007/153 iSCSI target provider 6498786 the iSCSI target's SMF stop method takes too long 6573073 usdt args[] are incorrectly translated 6573074 PSARC 2007/153 iSCSI target provider 6573077 iscsitgtd should be compiled with CTF data 6574850 dt_idhash_iter() needs to cache the array length --- usr/src/lib/libdtrace/common/dt_ident.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr/src/lib/libdtrace/common/dt_ident.c') diff --git a/usr/src/lib/libdtrace/common/dt_ident.c b/usr/src/lib/libdtrace/common/dt_ident.c index 50f00026b4..c437e0ab03 100644 --- a/usr/src/lib/libdtrace/common/dt_ident.c +++ b/usr/src/lib/libdtrace/common/dt_ident.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -840,13 +840,14 @@ dt_idhash_iter(dt_idhash_t *dhp, dt_idhash_f *func, void *data) { dt_ident_t **ids; dt_ident_t *idp; - ulong_t i, j; + ulong_t i, j, n; int rv; if (dhp->dh_tmpl != NULL) dt_idhash_populate(dhp); /* fill hash w/ initial population */ - ids = alloca(sizeof (dt_ident_t *) * dhp->dh_nelems); + n = dhp->dh_nelems; + ids = alloca(sizeof (dt_ident_t *) * n); for (i = 0, j = 0; i < dhp->dh_hashsz; i++) { for (idp = dhp->dh_hash[i]; idp != NULL; idp = idp->di_next) @@ -855,7 +856,7 @@ dt_idhash_iter(dt_idhash_t *dhp, dt_idhash_f *func, void *data) qsort(ids, dhp->dh_nelems, sizeof (dt_ident_t *), dt_idhash_comp); - for (i = 0; i < dhp->dh_nelems; i++) { + for (i = 0; i < n; i++) { if ((rv = func(dhp, ids[i], data)) != 0) return (rv); } -- cgit v1.2.3