Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/coda comment out debugging printfs
details: https://anonhg.NetBSD.org/src/rev/dd660ce8610d
branches: trunk
changeset: 779117:dd660ce8610d
user: christos <christos%NetBSD.org@localhost>
date: Fri May 04 17:57:22 2012 +0000
description:
comment out debugging printfs
diffstat:
sys/coda/coda_vnops.c | 78 ++++++++++++++++++++++++++++++--------------------
1 files changed, 46 insertions(+), 32 deletions(-)
diffs (219 lines):
diff -r c81f4301194b -r dd660ce8610d sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c Fri May 04 16:45:05 2012 +0000
+++ b/sys/coda/coda_vnops.c Fri May 04 17:57:22 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coda_vnops.c,v 1.87 2012/05/04 01:40:13 christos Exp $ */
+/* $NetBSD: coda_vnops.c,v 1.88 2012/05/04 17:57:22 christos Exp $ */
/*
*
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.87 2012/05/04 01:40:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.88 2012/05/04 17:57:22 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -422,8 +422,10 @@
* it's completely written.
*/
if (cp->c_inode != 0 && !(p && (p->p_acflag & ACORE))) {
+#ifdef CODA_VERBOSE
printf("%s: grabbing container vnode, losing reference\n",
__func__);
+#endif
/* Get locked and refed vnode. */
error = coda_grab_vnode(vp, cp->c_device, cp->c_inode, &cfvp);
if (error) {
@@ -437,7 +439,9 @@
VOP_UNLOCK(cfvp);
}
else {
+#ifdef CODA_VERBOSE
printf("%s: internal VOP_OPEN\n", __func__);
+#endif
opened_internally = 1;
MARK_INT_GEN(CODA_OPEN_STATS);
error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), cred);
@@ -849,25 +853,17 @@
panic("badness in coda_inactive");
}
- if (IS_UNMOUNTING(cp)) {
- /* XXX Do we need to VOP_CLOSE container vnodes? */
- if (vp->v_usecount > 1)
- printf("%s: IS_UNMOUNTING %p usecount %d\n",
- __func__, vp, vp->v_usecount);
- if (cp->c_ovp != NULL)
- printf("%s: %p ovp != NULL\n", __func__, vp);
- VOP_UNLOCK(vp);
- } else {
- /* Sanity checks that perhaps should be panic. */
- if (vp->v_usecount > 1) {
- printf("%s: %p usecount %d\n", __func__, vp, vp->v_usecount);
- }
- if (cp->c_ovp != NULL) {
- printf("%s: %p ovp != NULL\n", __func__, vp);
- }
- VOP_UNLOCK(vp);
+#ifdef CODA_VERBOSE
+ /* Sanity checks that perhaps should be panic. */
+ if (vp->v_usecount > 1)
+ printf("%s: %p usecount %d\n", __func__, vp, vp->v_usecount);
+ if (cp->c_ovp != NULL)
+ printf("%s: %p ovp != NULL\n", __func__, vp);
+#endif
+ /* XXX Do we need to VOP_CLOSE container vnodes? */
+ VOP_UNLOCK(vp);
+ if (!IS_UNMOUNTING(cp))
*ap->a_recycle = true;
- }
MARK_INT_SAT(CODA_INACTIVE_STATS);
return(0);
@@ -955,12 +951,13 @@
myprintf(("lookup result %d vpp %p\n",error,*vpp));)
} else {
/* The name wasn't cached, so ask Venus. */
- error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, l, &VFid, &vtype);
+ error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, l, &VFid,
+ &vtype);
if (error) {
MARK_INT_FAIL(CODA_LOOKUP_STATS);
- CODADEBUG(CODA_LOOKUP, myprintf(("lookup error on %s (%s)%d\n",
- coda_f2s(&dcp->c_fid), nm, error));)
+ CODADEBUG(CODA_LOOKUP, myprintf(("%s: lookup error on %s (%s)%d\n",
+ __func__, coda_f2s(&dcp->c_fid), nm, error));)
*vpp = (vnode_t *)0;
} else {
MARK_INT_SAT(CODA_LOOKUP_STATS);
@@ -1098,7 +1095,8 @@
coda_f2s(&VFid), error)); )
} else {
*vpp = (vnode_t *)0;
- CODADEBUG(CODA_CREATE, myprintf(("create error %d\n", error));)
+ CODADEBUG(CODA_CREATE, myprintf(("%s: create error %d\n", __func__,
+ error));)
}
/*
@@ -1107,15 +1105,15 @@
*/
vput(dvp);
if (!error) {
- if ((cnp->cn_flags & LOCKLEAF) == 0) {
+#ifdef CODA_VERBOSE
+ if ((cnp->cn_flags & LOCKLEAF) == 0)
/* This should not happen; flags are for lookup only. */
printf("%s: LOCKLEAF not set!\n", __func__);
- }
- if ((error = vn_lock(*ap->a_vpp, LK_EXCLUSIVE))) {
+ if ((error = vn_lock(*ap->a_vpp, LK_EXCLUSIVE)))
/* XXX Perhaps avoid this panic. */
panic("%s: couldn't lock child", __func__);
- }
+#endif
}
return(error);
@@ -1234,14 +1232,18 @@
/* If linking . to a name, error out earlier. */
if (vp == dvp) {
- printf("coda_link vp==dvp\n");
+#ifdef CODA_VERBOSE
+ printf("%s coda_link vp==dvp\n", __func__);
+#endif
error = EISDIR;
goto exit;
}
/* XXX Why does venus_link need the vnode to be locked?*/
if ((error = vn_lock(vp, LK_EXCLUSIVE)) != 0) {
+#ifdef CODA_VERBOSE
printf("%s: couldn't lock vnode %p\n", __func__, vp);
+#endif
error = EFAULT; /* XXX better value */
goto exit;
}
@@ -1464,7 +1466,9 @@
/* Can't remove . in self. */
if (dvp == vp) {
+#ifdef CODA_VERBOSE
printf("%s: dvp == vp\n", __func__);
+#endif
error = EINVAL;
goto exit;
}
@@ -1965,7 +1969,9 @@
/* Check for control object. */
if (IS_CTL_VP(vp)) {
+#ifdef CODA_VERBOSE
printf("%s: control object %p\n", __func__, vp);
+#endif
return(EINVAL);
}
@@ -1992,11 +1998,13 @@
mutex_exit(vp->v_interlock);
cerror = vn_lock(vp, LK_EXCLUSIVE);
if (cerror) {
+#ifdef CODA_VERBOSE
printf("%s: can't lock vnode %p\n",
__func__, vp);
+#endif
return cerror;
}
-#if 0
+#ifdef CODA_VERBOSE
printf("%s: locked vnode %p\n", __func__, vp);
#endif
}
@@ -2010,14 +2018,16 @@
cerror = VOP_OPEN(vp, FREAD, cred);
if (cerror) {
+#ifdef CODA_VERBOSE
printf("%s: cannot open vnode %p => %d\n", __func__,
- vp, cerror);
+ vp, cerror);
+#endif
if (waslocked == 0)
VOP_UNLOCK(vp);
return cerror;
}
-#if 0
+#ifdef CODA_VERBOSE
printf("%s: opened vnode %p\n", __func__, vp);
#endif
cvp = cp->c_ovp;
@@ -2041,10 +2051,12 @@
* holding the lock (or riding a caller's lock).
*/
cerror = VOP_CLOSE(vp, FREAD, cred);
+#ifdef CODA_VERBOSE
if (cerror != 0)
/* XXX How should we handle this? */
printf("%s: closed vnode %p -> %d\n", __func__,
vp, cerror);
+#endif
/* If we obtained a lock, drop it. */
if (waslocked == 0)
@@ -2075,7 +2087,9 @@
/* Check for control object. */
if (IS_CTL_VP(vp)) {
mutex_exit(vp->v_interlock);
+#ifdef CODA_VERBOSE
printf("%s: control object %p\n", __func__, vp);
+#endif
return(EINVAL);
}
Home |
Main Index |
Thread Index |
Old Index