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
This commit is contained in:
mckusick 2018-01-31 22:49:50 +00:00
parent 450f8da6d5
commit dca0cf2869

View File

@ -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)