From b5fca8f855054d167d04d3b4de5210c83ed2083c Mon Sep 17 00:00:00 2001 From: tomee Date: Mon, 26 May 2008 17:53:26 -0700 Subject: 6554564 slab allocator cannot release slabs with lonely buffers 6676406 kmem client constructors and destructors need some cleanup --- usr/src/uts/common/fs/dev/sdev_subr.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'usr/src/uts/common/fs/dev/sdev_subr.c') diff --git a/usr/src/uts/common/fs/dev/sdev_subr.c b/usr/src/uts/common/fs/dev/sdev_subr.c index e1b1abea0d..40d2b7962e 100644 --- a/usr/src/uts/common/fs/dev/sdev_subr.c +++ b/usr/src/uts/common/fs/dev/sdev_subr.c @@ -184,9 +184,7 @@ sdev_prof_free(struct sdev_node *dv) bzero(&dv->sdev_prof, sizeof (dv->sdev_prof)); } -/* - * sdev_node cache constructor - */ +/* sdev_node cache constructor */ /*ARGSUSED1*/ static int i_sdev_node_ctor(void *buf, void *cfarg, int flag) @@ -194,17 +192,17 @@ i_sdev_node_ctor(void *buf, void *cfarg, int flag) struct sdev_node *dv = (struct sdev_node *)buf; struct vnode *vp; - ASSERT(flag == KM_SLEEP); - bzero(buf, sizeof (struct sdev_node)); + vp = dv->sdev_vnode = vn_alloc(flag); + if (vp == NULL) { + return (-1); + } + vp->v_data = dv; rw_init(&dv->sdev_contents, NULL, RW_DEFAULT, NULL); - dv->sdev_vnode = vn_alloc(KM_SLEEP); - vp = SDEVTOV(dv); - vp->v_data = (caddr_t)dv; return (0); } -/* sdev_node destructor for kmem cache */ +/* sdev_node cache destructor */ /*ARGSUSED1*/ static void i_sdev_node_dtor(void *buf, void *arg) -- cgit v1.2.3