diff options
| author | 2009-08-13 13:49:20 +0000 | |
|---|---|---|
| committer | 2009-08-13 13:49:20 +0000 | |
| commit | 4c6830d607a113f4221e9e95431ee8aef0b6c9d3 (patch) | |
| tree | 1ea5b48abc05a0991767db833172bd66adfd05e7 /sys/ddb/db_command.c | |
| parent | sync synopsis and usage(); (diff) | |
| download | wireguard-openbsd-4c6830d607a113f4221e9e95431ee8aef0b6c9d3.tar.xz wireguard-openbsd-4c6830d607a113f4221e9e95431ee8aef0b6c9d3.zip | |
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.c | 17 |
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 |
