diff options
-rw-r--r-- | sys/ddb/db_command.c | 17 | ||||
-rw-r--r-- | sys/ddb/db_command.h | 3 | ||||
-rw-r--r-- | sys/ddb/db_interface.h | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 5 |
4 files changed, 22 insertions, 7 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 1115a45d70b..9d09f4cd4e7 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.59 2009/08/14 21:16:13 thib Exp $ */ +/* $OpenBSD: db_command.c,v 1.60 2009/08/17 13:11:58 jasper Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -291,7 +291,7 @@ db_buf_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) if (modif[0] == 'f') full = TRUE; - vfs_buf_print((struct buf *) addr, full, db_printf); + vfs_buf_print((void *) addr, full, db_printf); } /*ARGSUSED*/ @@ -359,6 +359,18 @@ db_show_all_vnodes(db_expr_t addr, int have_addr, db_expr_t count, char *modif) pool_walk(&vnode_pool, full, db_printf, vfs_vnode_print); } +extern struct pool bufpool; +void +db_show_all_bufs(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(&bufpool, full, db_printf, vfs_buf_print); +} + /*ARGSUSED*/ void db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) @@ -484,6 +496,7 @@ struct db_command db_show_all_cmds[] = { { "pools", db_show_all_pools, 0, NULL }, { "mounts", db_show_all_mounts, 0, NULL }, { "vnodes", db_show_all_vnodes, 0, NULL }, + { "bufs", db_show_all_bufs, 0, NULL }, #ifdef NFSCLIENT { "nfsreqs", db_show_all_nfsreqs, 0, NULL }, { "nfsnodes", db_show_all_nfsnodes, 0, NULL }, diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index 13ef6ccaab1..db97043cecf 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.h,v 1.28 2009/08/14 21:16:13 thib Exp $ */ +/* $OpenBSD: db_command.h,v 1.29 2009/08/17 13:11:58 jasper Exp $ */ /* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */ /* @@ -44,6 +44,7 @@ void db_malloc_print_cmd(db_expr_t, int, db_expr_t, char *); void db_mount_print_cmd(db_expr_t, int, db_expr_t, char *); void db_show_all_mounts(db_expr_t, int, db_expr_t, char *); void db_show_all_vnodes(db_expr_t, int, db_expr_t, char *); +void db_show_all_bufs(db_expr_t, int, db_expr_t, char *); void db_object_print_cmd(db_expr_t, int, db_expr_t, char *); void db_page_print_cmd(db_expr_t, int, db_expr_t, char *); void db_extent_print_cmd(db_expr_t, int, db_expr_t, char *); diff --git a/sys/ddb/db_interface.h b/sys/ddb/db_interface.h index 7b25667d3c6..8be1e9b3d75 100644 --- a/sys/ddb/db_interface.h +++ b/sys/ddb/db_interface.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.h,v 1.14 2009/08/14 21:16:13 thib Exp $ */ +/* $OpenBSD: db_interface.h,v 1.15 2009/08/17 13:11:58 jasper Exp $ */ /* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */ /* @@ -48,7 +48,7 @@ void db_show_callout(db_expr_t, int, db_expr_t, char *); struct mount; /* kern/vfs_subr.c */ -void vfs_buf_print(struct buf *, int, int (*)(const char *, ...)); +void vfs_buf_print(void *, int, int (*)(const char *, ...)); void vfs_vnode_print(void *, int, int (*)(const char *, ...)); void vfs_mount_print(struct mount *, int, int (*)(const char *, ...)); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9afdaa75496..698a523b42f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.182 2009/08/13 13:49:20 thib Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.183 2009/08/17 13:11:58 jasper Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -2162,8 +2162,9 @@ vn_isdisk(struct vnode *vp, int *errp) #include <ddb/db_output.h> void -vfs_buf_print(struct buf *bp, int full, int (*pr)(const char *, ...)) +vfs_buf_print(void *b, int full, int (*pr)(const char *, ...)) { + struct buf *bp = b; (*pr)(" vp %p lblkno 0x%llx blkno 0x%llx dev 0x%x\n" " proc %p error %d flags %b\n", |