Initialize pnode to 0 after fetching it from the pool. At least

one effect is poll() working much better, as selinfo doesn't contain
random bits.
This commit is contained in:
pooka 2007-07-19 19:04:47 +00:00
parent 5ddbe8d764
commit d5a9a344fd
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_subr.c,v 1.40 2007/07/09 21:10:49 ad Exp $ */
/* $NetBSD: puffs_subr.c,v 1.41 2007/07/19 19:04:47 pooka Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_subr.c,v 1.40 2007/07/09 21:10:49 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_subr.c,v 1.41 2007/07/19 19:04:47 pooka Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -187,13 +187,13 @@ puffs_getvnode(struct mount *mp, void *cookie, enum vtype type,
}
pnode = pool_get(&puffs_pnpool, PR_WAITOK);
memset(pnode, 0, sizeof(struct puffs_node));
pnode->pn_cookie = cookie;
pnode->pn_stat = 0;
pnode->pn_refcount = 1;
mutex_init(&pnode->pn_mtx, MUTEX_DEFAULT, IPL_NONE);
SLIST_INIT(&pnode->pn_sel.sel_klist);
pnode->pn_revents = 0;
plist = puffs_cookie2hashlist(pmp, cookie);
LIST_INSERT_HEAD(plist, pnode, pn_hashent);