svn commit: r328643 - head/sys/kern

Kirk McKusick mckusick at FreeBSD.org
Wed Jan 31 22:49:51 UTC 2018


Author: mckusick
Date: Wed Jan 31 22:49:50 2018
New Revision: 328643
URL: https://svnweb.freebsd.org/changeset/base/328643

Log:
  One of the vnode fields listed by vn_printf is the union of pointers
  whose type depends on the type of vnode. Correct vn_printf so that
  it correctly identifies the name of the pointer that it is printing.
  
  Submitted by: Andreas Longwitz <longwitz at incore.de>
  MFC after: 1 week

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Jan 31 22:46:05 2018	(r328642)
+++ head/sys/kern/vfs_subr.c	Wed Jan 31 22:49:50 2018	(r328643)
@@ -3467,8 +3467,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...)
 	va_end(ap);
 	printf("%p: ", (void *)vp);
 	printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]);
-	printf("    usecount %d, writecount %d, refcount %d mountedhere %p\n",
-	    vp->v_usecount, vp->v_writecount, vp->v_holdcnt, vp->v_mountedhere);
+	printf("    usecount %d, writecount %d, refcount %d",
+	    vp->v_usecount, vp->v_writecount, vp->v_holdcnt);
+	switch (vp->v_type) {
+	case VDIR:
+		printf(" mountedhere %p\n", vp->v_mountedhere);
+		break;
+	case VCHR:
+		printf(" rdev %p\n", vp->v_rdev);
+		break;
+	case VSOCK:
+		printf(" socket %p\n", vp->v_unpcb);
+		break;
+	case VFIFO:
+		printf(" fifoinfo %p\n", vp->v_fifoinfo);
+		break;
+	default:
+		printf("\n");
+		break;
+	}
 	buf[0] = '\0';
 	buf[1] = '\0';
 	if (vp->v_vflag & VV_ROOT)


More information about the svn-src-all mailing list