]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/ubc_subr.c
xnu-344.tar.gz
[apple/xnu.git] / bsd / kern / ubc_subr.c
index c82fd94a2b5fe84f4bc16b7a0ddffea6e2a17d93..955b6b638e5702d987244782c36e872475bcfb14 100644 (file)
@@ -55,7 +55,7 @@
 #undef assert()
 #endif
 #define assert(cond)    \
-    if (!(cond)) panic("%s:%d (%s)", __FILE__, __LINE__, # cond)
+    ((void) ((cond) ? 0 : panic("%s:%d (%s)", __FILE__, __LINE__, # cond)))
 #else
 #include <kern/assert.h>
 #endif /* DIAGNOSTIC */
@@ -1023,6 +1023,13 @@ ubc_isinuse(struct vnode *vp, int tookref)
        if (!UBCINFOEXISTS(vp))
                return (0);
 
+       if (tookref == 0) {
+               printf("ubc_isinuse: called without a valid reference"
+                   ": v_tag = %d\v", vp->v_tag);
+               vprint("ubc_isinuse", vp);
+               return (0);
+       }
+
        if (vp->v_usecount > busycount)
                return (1);