From 2fb0334ca1c63dafcbe85f1c33349da49a8ad06c Mon Sep 17 00:00:00 2001 From: yamt Date: Sat, 25 Oct 2008 14:18:18 +0000 Subject: [PATCH] add assertions. --- sys/kern/vfs_cache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 4d75599609ae..43ed181266ca 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -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 -__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);