MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vn_printf

Function vn_printf

freebsd/kern/vfs_subr.c:4076–4205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4074 "new hold count flag not added to vn_printf");
4075
4076void
4077vn_printf(struct vnode *vp, const char *fmt, ...)
4078{
4079 va_list ap;
4080 char buf[256], buf2[16];
4081 u_long flags;
4082 u_int holdcnt;
4083 short irflag;
4084
4085 va_start(ap, fmt);
4086 vprintf(fmt, ap);
4087 va_end(ap);
4088 printf("%p: ", (void *)vp);
4089 printf("type %s\n", typename[vp->v_type]);
4090 holdcnt = atomic_load_int(&vp->v_holdcnt);
4091 printf(" usecount %d, writecount %d, refcount %d seqc users %d",
4092 vp->v_usecount, vp->v_writecount, holdcnt & ~VHOLD_ALL_FLAGS,
4093 vp->v_seqc_users);
4094 switch (vp->v_type) {
4095 case VDIR:
4096 printf(" mountedhere %p\n", vp->v_mountedhere);
4097 break;
4098 case VCHR:
4099 printf(" rdev %p\n", vp->v_rdev);
4100 break;
4101 case VSOCK:
4102 printf(" socket %p\n", vp->v_unpcb);
4103 break;
4104 case VFIFO:
4105 printf(" fifoinfo %p\n", vp->v_fifoinfo);
4106 break;
4107 default:
4108 printf("\n");
4109 break;
4110 }
4111 buf[0] = '\0';
4112 buf[1] = '\0';
4113 if (holdcnt & VHOLD_NO_SMR)
4114 strlcat(buf, "|VHOLD_NO_SMR", sizeof(buf));
4115 printf(" hold count flags (%s)\n", buf + 1);
4116
4117 buf[0] = '\0';
4118 buf[1] = '\0';
4119 irflag = vn_irflag_read(vp);
4120 if (irflag & VIRF_DOOMED)
4121 strlcat(buf, "|VIRF_DOOMED", sizeof(buf));
4122 if (irflag & VIRF_PGREAD)
4123 strlcat(buf, "|VIRF_PGREAD", sizeof(buf));
4124 if (irflag & VIRF_MOUNTPOINT)
4125 strlcat(buf, "|VIRF_MOUNTPOINT", sizeof(buf));
4126 flags = irflag & ~(VIRF_DOOMED | VIRF_PGREAD | VIRF_MOUNTPOINT);
4127 if (flags != 0) {
4128 snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags);
4129 strlcat(buf, buf2, sizeof(buf));
4130 }
4131 if (vp->v_vflag & VV_ROOT)
4132 strlcat(buf, "|VV_ROOT", sizeof(buf));
4133 if (vp->v_vflag & VV_ISTTY)

Callers 10

bufshutdownFunction · 0.85
vn_fsync_bufFunction · 0.85
vop_nostrategyFunction · 0.85
vflushFunction · 0.85
vfs_subr.cFile · 0.85
vfs_badlockFunction · 0.85
vfs_mount_destroyFunction · 0.85
lookupFunction · 0.85
relookupFunction · 0.85

Calls 5

snprintfFunction · 0.85
lockmgr_printinfoFunction · 0.85
vprintfFunction · 0.70
printfFunction · 0.70
strlcatFunction · 0.50

Tested by

no test coverage detected