summaryrefslogtreecommitdiff
path: root/sys/ddb/db_command.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-08-13 13:49:21 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-08-13 13:49:21 +0000
commit74a6604beb400e6cc433d7fda8960ce8bb0ca9ba (patch)
tree5d65e26b5bc5085f750f7b7e0e479a64fd078070 /sys/ddb/db_command.c
parent629efe026cb80764f620bf4e2253c0ca759cb290 (diff)
add a show all vnodes command, use dlg's nice pool_walk() to accomplish
this. ok beck@, dlg@
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r--sys/ddb/db_command.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index cdfbb648979..1ba56005ab8 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.56 2009/08/09 23:04:49 miod Exp $ */
+/* $OpenBSD: db_command.c,v 1.57 2009/08/13 13:49:20 thib Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -347,6 +347,18 @@ db_show_all_mounts(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
vfs_mount_print(mp, full, db_printf);
}
+extern struct pool vnode_pool;
+void
+db_show_all_vnodes(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+{
+ boolean_t full = FALSE;
+
+ if (modif[0] == 'f')
+ full = TRUE;
+
+ pool_walk(&vnode_pool, full, db_printf, vfs_vnode_print);
+}
+
/*ARGSUSED*/
void
db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
@@ -380,7 +392,7 @@ db_vnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
if (modif[0] == 'f')
full = TRUE;
- vfs_vnode_print((struct vnode *) addr, full, db_printf);
+ vfs_vnode_print((void *)addr, full, db_printf);
}
#ifdef NFSCLIENT
@@ -457,6 +469,7 @@ struct db_command db_show_all_cmds[] = {
{ "callout", db_show_callout, 0, NULL },
{ "pools", db_show_all_pools, 0, NULL },
{ "mounts", db_show_all_mounts, 0, NULL },
+ { "vnodes,", db_show_all_vnodes, 0, NULL },
#ifdef NFSCLIENT
{ "nfsreq", db_show_all_nfsreqs, 0, NULL },
#endif