Module Name:    src
Committed By:   pooka
Date:           Wed Jul 22 21:06:56 UTC 2009

Modified Files:
        src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Since rumpfs can now be used from publically exported routines,
convert unsupported checking KASSERTs to return EOPNOTSUPP.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpvfs/rumpfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.19 src/sys/rump/librump/rumpvfs/rumpfs.c:1.20
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.19	Wed Jun 10 12:12:23 2009
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Wed Jul 22 21:06:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.19 2009/06/10 12:12:23 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.20 2009/07/22 21:06:56 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.19 2009/06/10 12:12:23 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.20 2009/07/22 21:06:56 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -230,10 +230,13 @@
 	int rv, error, ft;
 
 	/* we handle only some "non-special" cases */
-	KASSERT(((cnp->cn_flags & ISLASTCN) == 0)
-	    || (cnp->cn_nameiop == LOOKUP || cnp->cn_nameiop == CREATE));
-	KASSERT((cnp->cn_flags & ISDOTDOT) == 0);
-	KASSERT(cnp->cn_namelen != 0 && cnp->cn_pnbuf[0] != '.');
+	if (!(((cnp->cn_flags & ISLASTCN) == 0)
+	    || (cnp->cn_nameiop == LOOKUP || cnp->cn_nameiop == CREATE)))
+		return EOPNOTSUPP;
+	if (!((cnp->cn_flags & ISDOTDOT) == 0))
+		return EOPNOTSUPP;
+	if (!(cnp->cn_namelen != 0 && cnp->cn_pnbuf[0] != '.'))
+		return EOPNOTSUPP;
 
 	/* check if we are returning a faked block device */
 	if (dvp == rootvnode && cnp->cn_nameiop == LOOKUP) {

Reply via email to