Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2010 09:03:44 +0300
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        freebsd-fs@freebsd.org
Subject:   '#ifndef DIAGNOSTIC' in nfsclient code looks like a typo
Message-ID:  <86mxv22ji7.fsf@zhuzha.ua1>

next in thread | raw e-mail | index | archive | help
--=-=-=

Hi:

'#ifndef DIAGNOSTIC' in sys/nfsclient/nfs_vnops.c and
sys/fs/nfsclient/nfs_clvnops.c looks like a typo and '#ifdef' should be used
instead (see the attached patch).

-- 
Mikolaj Golub


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=nfsclient.ifdef_DIAGNOSTIC.patch

Index: sys/nfsclient/nfs_vnops.c
===================================================================
--- sys/nfsclient/nfs_vnops.c	(revision 209021)
+++ sys/nfsclient/nfs_vnops.c	(working copy)
@@ -1348,7 +1348,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, s
 	int v3 = NFS_ISV3(vp), committed = NFSV3WRITE_FILESYNC;
 	int wsize;
 	
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (uiop->uio_iovcnt != 1)
 		panic("nfs: writerpc iovcnt > 1");
 #endif
@@ -1708,7 +1708,7 @@ nfs_remove(struct vop_remove_args *ap)
 	int error = 0;
 	struct vattr vattr;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if ((cnp->cn_flags & HASBUF) == 0)
 		panic("nfs_remove: no name");
 	if (vrefcnt(vp) < 1)
@@ -1814,7 +1814,7 @@ nfs_rename(struct vop_rename_args *ap)
 	struct componentname *fcnp = ap->a_fcnp;
 	int error;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if ((tcnp->cn_flags & HASBUF) == 0 ||
 	    (fcnp->cn_flags & HASBUF) == 0)
 		panic("nfs_rename: no name");
@@ -2277,7 +2277,7 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop,
 	int attrflag;
 	int v3 = NFS_ISV3(vp);
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
 		(uiop->uio_resid & (DIRBLKSIZ - 1)))
 		panic("nfs readdirrpc bad uio");
@@ -2482,7 +2482,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *u
 #ifndef nolint
 	dp = NULL;
 #endif
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
 		(uiop->uio_resid & (DIRBLKSIZ - 1)))
 		panic("nfs readdirplusrpc bad uio");
@@ -2752,7 +2752,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *v
 
 	cache_purge(dvp);
 	np = VTONFS(vp);
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (vp->v_type == VDIR)
 		panic("nfs: sillyrename dir");
 #endif
Index: sys/fs/nfsclient/nfs_clvnops.c
===================================================================
--- sys/fs/nfsclient/nfs_clvnops.c	(revision 209021)
+++ sys/fs/nfsclient/nfs_clvnops.c	(working copy)
@@ -1564,7 +1564,7 @@ nfs_remove(struct vop_remove_args *ap)
 	int error = 0;
 	struct vattr vattr;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if ((cnp->cn_flags & HASBUF) == 0)
 		panic("nfs_remove: no name");
 	if (vrefcnt(vp) < 1)
@@ -1676,7 +1676,7 @@ nfs_rename(struct vop_rename_args *ap)
 	struct nfsv4node *newv4 = NULL;
 	int error;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if ((tcnp->cn_flags & HASBUF) == 0 ||
 	    (fcnp->cn_flags & HASBUF) == 0)
 		panic("nfs_rename: no name");
@@ -2137,7 +2137,7 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop,
 	struct nfsmount *nmp = VFSTONFS(vp->v_mount);
 	int error = 0, eof, attrflag;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
 		(uiop->uio_resid & (DIRBLKSIZ - 1)))
 		panic("nfs readdirrpc bad uio");
@@ -2198,7 +2198,7 @@ ncl_readdirplusrpc(struct vnode *vp, struct uio *u
 	struct nfsmount *nmp = VFSTONFS(vp->v_mount);
 	int error = 0, attrflag, eof;
 
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
 		(uiop->uio_resid & (DIRBLKSIZ - 1)))
 		panic("nfs readdirplusrpc bad uio");
@@ -2264,7 +2264,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *v
 
 	cache_purge(dvp);
 	np = VTONFS(vp);
-#ifndef DIAGNOSTIC
+#ifdef DIAGNOSTIC
 	if (vp->v_type == VDIR)
 		panic("nfs: sillyrename dir");
 #endif

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86mxv22ji7.fsf>