add assertions.

This commit is contained in:
yamt 2008-10-25 14:18:18 +00:00
parent e11d976a7b
commit 2fb0334ca1
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_cache.c,v 1.78 2008/08/20 15:34:59 pooka Exp $ */
/* $NetBSD: vfs_cache.c,v 1.79 2008/10/25 14:18:18 yamt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.78 2008/08/20 15:34:59 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.79 2008/10/25 14:18:18 yamt Exp $");
#include "opt_ddb.h"
#include "opt_revcache.h"
@ -341,6 +341,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
/*
* Restore the ISWHITEOUT flag saved earlier.
*/
KASSERT((ncp->nc_flags & ~ISWHITEOUT) == 0);
cnp->cn_flags |= ncp->nc_flags;
if (__predict_true(cnp->cn_nameiop != CREATE ||
(cnp->cn_flags & ISLASTCN) == 0)) {
@ -456,6 +457,7 @@ cache_lookup_raw(struct vnode *dvp, struct vnode **vpp,
/*
* Restore the ISWHITEOUT flag saved earlier.
*/
KASSERT((ncp->nc_flags & ~ISWHITEOUT) == 0);
cnp->cn_flags |= ncp->nc_flags;
COUNT(cpup->cpu_stats, ncs_neghits);
mutex_exit(&ncp->nc_lock);