diff options
author | phk <phk@FreeBSD.org> | 2005-01-24 13:58:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-24 13:58:08 +0000 |
commit | dc1cfea3cd94826bb9e1670c047671ff34d6ec7d (patch) | |
tree | 3cf8320ec92ec9cea2d07c0f9f105d6691a937fd /sys/kern/vfs_subr.c | |
parent | 3c24c38d30f3535b6fb6b9e76e13109f0ee6b5e4 (diff) | |
download | FreeBSD-src-dc1cfea3cd94826bb9e1670c047671ff34d6ec7d.zip FreeBSD-src-dc1cfea3cd94826bb9e1670c047671ff34d6ec7d.tar.gz |
Change vprint() to vn_printf() which takes varargs.
Add #define for vprint() to call vn_printf().
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9367fd3..5c48ac5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); #include <sys/vmmeter.h> #include <sys/vnode.h> +#include <machine/stdarg.h> + #include <vm/vm.h> #include <vm/vm_object.h> #include <vm/vm_extern.h> @@ -2482,20 +2484,20 @@ static char *typename[] = {"VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD"}; void -vprint(label, vp) - char *label; - struct vnode *vp; +vn_printf(struct vnode *vp, const char *fmt, ...) { + va_list ap; char buf[96]; - if (label != NULL) - printf("%s: %p: ", label, (void *)vp); - else - 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", + va_start(ap, fmt); + vprintf(fmt, ap); + 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); buf[0] = '\0'; + buf[1] = '\0'; if (vp->v_vflag & VV_ROOT) strcat(buf, "|VV_ROOT"); if (vp->v_vflag & VV_TEXT) @@ -2510,11 +2512,12 @@ vprint(label, vp) strcat(buf, "|VI_DOOMED"); if (vp->v_iflag & VI_FREE) strcat(buf, "|VI_FREE"); - if (buf[0] != '\0') - printf(" flags (%s)", &buf[1]); + printf(" flags (%s)\n", buf + 1); if (mtx_owned(VI_MTX(vp))) printf(" VI_LOCKed"); - printf("\n "); + if (vp->v_object != NULL); + printf(" v_object %p\n", vp->v_object); + printf(" "); lockmgr_printinfo(vp->v_vnlock); printf("\n"); if (vp->v_data != NULL) |