Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern vn_lock: assert that only a limited set of LK_* fla...



details:   https://anonhg.NetBSD.org/src/rev/5fbc15bf4186
branches:  trunk
changeset: 586771:5fbc15bf4186
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Dec 31 14:33:13 2005 +0000

description:
vn_lock: assert that only a limited set of LK_* flags is used.

diffstat:

 sys/kern/vfs_vnops.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 00cd99aee78b -r 5fbc15bf4186 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Sat Dec 31 14:09:02 2005 +0000
+++ b/sys/kern/vfs_vnops.c      Sat Dec 31 14:33:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.102 2005/12/12 16:26:33 elad Exp $     */
+/*     $NetBSD: vfs_vnops.c,v 1.103 2005/12/31 14:33:13 yamt Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.102 2005/12/12 16:26:33 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.103 2005/12/31 14:33:13 yamt Exp $");
 
 #include "opt_verified_exec.h"
 
@@ -705,6 +705,10 @@
        KASSERT(vp->v_usecount > 0 || (flags & LK_INTERLOCK) != 0
            || (vp->v_flag & VONWORKLST) != 0);
 #endif
+       KASSERT((flags &
+           ~(LK_INTERLOCK|LK_SHARED|LK_EXCLUSIVE|LK_DRAIN|LK_NOWAIT|LK_RETRY|
+           LK_SETRECURSE))
+           == 0);
 
        do {
                if ((flags & LK_INTERLOCK) == 0)



Home | Main Index | Thread Index | Old Index