summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/ddb/db_command.c43
-rw-r--r--sys/ddb/db_command.h5
-rw-r--r--sys/ddb/db_interface.h12
-rw-r--r--sys/kern/vfs_subr.c127
-rw-r--r--sys/sys/buf.h10
-rw-r--r--sys/sys/mount.h7
-rw-r--r--sys/sys/vnode.h14
-rw-r--r--sys/ufs/ffs/ffs_softdep.c127
-rw-r--r--sys/ufs/ffs/softdep.h6
9 files changed, 340 insertions, 11 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index d5cd1813af2..24e58cd1262 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.42 2006/05/20 18:29:23 mickey Exp $ */
+/* $OpenBSD: db_command.c,v 1.43 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -282,6 +282,18 @@ db_command(struct db_command **last_cmdp, struct db_command *cmd_table)
/*ARGSUSED*/
void
+db_buf_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+{
+ boolean_t full = FALSE;
+
+ if (modif[0] == 'f')
+ full = TRUE;
+
+ vfs_buf_print((struct buf *) addr, full, db_printf);
+}
+
+/*ARGSUSED*/
+void
db_map_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
boolean_t full = FALSE;
@@ -291,6 +303,7 @@ db_map_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
uvm_map_printit((struct vm_map *) addr, full, db_printf);
}
+
/*ARGSUSED*/
void
db_malloc_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
@@ -309,6 +322,18 @@ db_malloc_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
/*ARGSUSED*/
void
+db_mount_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+{
+ boolean_t full = FALSE;
+
+ if (modif[0] == 'f')
+ full = TRUE;
+
+ vfs_mount_print((struct mount *) addr, full, db_printf);
+}
+
+/*ARGSUSED*/
+void
db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
boolean_t full = FALSE;
@@ -331,6 +356,19 @@ db_page_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
uvm_page_printit((struct vm_page *) addr, full, db_printf);
}
+/*ARGSUSED*/
+void
+db_vnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+{
+ boolean_t full = FALSE;
+
+ if (modif[0] == 'f')
+ full = TRUE;
+
+ vfs_vnode_print((struct vnode *) addr, full, db_printf);
+}
+
+/*ARGSUSED*/
void
db_show_panic_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
@@ -385,9 +423,11 @@ struct db_command db_show_all_cmds[] = {
struct db_command db_show_cmds[] = {
{ "all", NULL, 0, db_show_all_cmds },
{ "breaks", db_listbreak_cmd, 0, NULL },
+ { "buf", db_buf_print_cmd, 0, NULL },
{ "extents", db_extent_print_cmd, 0, NULL },
{ "malloc", db_malloc_print_cmd, 0, NULL },
{ "map", db_map_print_cmd, 0, NULL },
+ { "mount", db_mount_print_cmd, 0, NULL },
{ "object", db_object_print_cmd, 0, NULL },
{ "page", db_page_print_cmd, 0, NULL },
{ "panic", db_show_panic_cmd, 0, NULL },
@@ -395,6 +435,7 @@ struct db_command db_show_cmds[] = {
{ "proc", db_proc_print_cmd, 0, NULL },
{ "registers", db_show_regs, 0, NULL },
{ "uvmexp", db_uvmexp_print_cmd, 0, NULL },
+ { "vnode", db_vnode_print_cmd, 0, NULL },
{ "watches", db_listwatch_cmd, 0, NULL },
{ NULL, NULL, 0, NULL }
};
diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h
index 8cd2db2f87c..e1413bffcbc 100644
--- a/sys/ddb/db_command.h
+++ b/sys/ddb/db_command.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.h,v 1.19 2005/01/03 16:49:56 miod Exp $ */
+/* $OpenBSD: db_command.h,v 1.20 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */
/*
@@ -38,14 +38,17 @@ struct db_command;
int db_cmd_search(char *, struct db_command *, struct db_command **);
void db_cmd_list(struct db_command *);
void db_command(struct db_command **, struct db_command *);
+void db_buf_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_map_print_cmd(db_expr_t, int, db_expr_t, char *);
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_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 *);
void db_pool_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_proc_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_uvmexp_print_cmd(db_expr_t, int, db_expr_t, char *);
+void db_vnode_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_machine_commands_install(struct db_command *);
void db_help_cmd(db_expr_t, int, db_expr_t, char *);
void db_command_loop(void);
diff --git a/sys/ddb/db_interface.h b/sys/ddb/db_interface.h
index b0e49d2e6ab..7c056354c2c 100644
--- a/sys/ddb/db_interface.h
+++ b/sys/ddb/db_interface.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.h,v 1.7 2006/05/20 18:29:23 mickey Exp $ */
+/* $OpenBSD: db_interface.h,v 1.8 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */
/*
@@ -45,9 +45,19 @@ void db_show_all_procs(db_expr_t, int, db_expr_t, char *);
/* kern/kern_timeout.c */
void db_show_callout(db_expr_t, int, db_expr_t, char *);
+/* kern/vfs_subr.c */
+void vfs_buf_print(struct buf *, int, int (*)(const char *, ...));
+void vfs_vnode_print(struct vnode *, int, int (*)(const char *, ...));
+void vfs_mount_print(struct mount *, int, int (*)(const char *, ...));
+
/* kern/subr_pool.c */
void db_show_all_pools(db_expr_t, int, db_expr_t, char *);
+/* ufs/ffs/ffs_softdep.c */
+struct worklist;
+void worklist_print(struct worklist *, int, int (*)(const char *, ...));
+void softdep_print(struct buf *, int, int (*)(const char *, ...));
+
/* arch/<arch>/<arch>/db_interface.c */
void db_machine_init(void);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 3fd157682b4..882b2724e94 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.132 2006/07/09 23:20:50 pedro Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.133 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -2265,3 +2265,128 @@ vn_isdisk(struct vnode *vp, int *errp)
return (1);
}
+
+#ifdef DDB
+#include <machine/db_machdep.h>
+#include <ddb/db_interface.h>
+#include <ddb/db_output.h>
+
+void
+vfs_buf_print(struct buf *bp, int full, int (*pr)(const char *, ...))
+{
+
+ (*pr)(" vp %p lblkno 0x%x blkno 0x%x dev 0x%x\n"
+ " proc %p error %d flags %b\n",
+ bp->b_vp, bp->b_lblkno, bp->b_blkno, bp->b_dev,
+ bp->b_proc, bp->b_error, bp->b_flags, B_BITS);
+
+ (*pr)(" bufsize 0x%lx bcount 0x%lx resid 0x%zx sync 0x%x\n"
+ " data %p saveaddr %p dep %p iodone %p\n",
+ bp->b_bufsize, bp->b_bcount, bp->b_resid, bp->b_synctime,
+ bp->b_data, bp->b_saveaddr, LIST_FIRST(&bp->b_dep), bp->b_iodone);
+
+ (*pr)(" dirty {off 0x%x end 0x%x} valid {off 0x%x end 0x%x}\n",
+ bp->b_dirtyoff, bp->b_dirtyend, bp->b_validoff, bp->b_validend);
+
+#ifdef FFS_SOFTUPDATES
+ if (full)
+ softdep_print(bp, full, pr);
+#endif
+}
+
+const char *vtypes[] = { VTYPE_NAMES };
+const char *vtags[] = { VTAG_NAMES };
+
+void
+vfs_vnode_print(struct vnode *vp, int full, int (*pr)(const char *, ...))
+{
+
+#define NENTS(n) (sizeof n / sizeof(n[0]))
+ (*pr)("tag %s(%d) type %s(%d) mount %p typedata %p\n",
+ vp->v_tag > NENTS(vtags)? "<unk>":vtags[vp->v_tag], vp->v_tag,
+ vp->v_type > NENTS(vtypes)? "<unk>":vtypes[vp->v_tag],vp->v_type,
+ vp->v_mount, vp->v_mountedhere);
+
+ (*pr)("data %p usecount %d writecount %ld holdcnt %ld numoutput %d\n",
+ vp->v_data, vp->v_usecount, vp->v_writecount,
+ vp->v_holdcnt, vp->v_numoutput);
+
+ /* uvm_object_printit(&vp->v_uobj, full, pr); */
+
+ if (full) {
+ struct buf *bp;
+
+ (*pr)("clean bufs:\n");
+ LIST_FOREACH(bp, &vp->v_cleanblkhd, b_vnbufs) {
+ (*pr)(" bp %p\n", bp);
+ vfs_buf_print(bp, full, pr);
+ }
+
+ (*pr)("dirty bufs:\n");
+ LIST_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) {
+ (*pr)(" bp %p\n", bp);
+ vfs_buf_print(bp, full, pr);
+ }
+ }
+}
+
+void
+vfs_mount_print(struct mount *mp, int full, int (*pr)(const char *, ...))
+{
+ struct vfsconf *vfc = mp->mnt_vfc;
+ struct vnode *vp;
+ int cnt = 0;
+
+ (*pr)("flags %b\nvnodecovered %p syncer %p data %p\n",
+ mp->mnt_flag, MNT_BITS,
+ mp->mnt_vnodecovered, mp->mnt_syncer, mp->mnt_data);
+
+ (*pr)("vfsconf: ops %p name \"%s\" num %d ref %d flags 0x%x\n",
+ vfc->vfc_vfsops, vfc->vfc_name, vfc->vfc_typenum,
+ vfc->vfc_refcount, vfc->vfc_flags);
+
+ (*pr)("statvfs cache: bsize %x iosize %x\nblocks %u free %u avail %u\n",
+ mp->mnt_stat.f_bsize, mp->mnt_stat.f_iosize, mp->mnt_stat.f_blocks,
+ mp->mnt_stat.f_bfree, mp->mnt_stat.f_bavail);
+
+ (*pr)(" files %u ffiles %u\n", mp->mnt_stat.f_files,
+ mp->mnt_stat.f_ffree);
+
+ (*pr)(" f_fsidx {0x%x, 0x%x} owner %u ctime 0x%x\n",
+ mp->mnt_stat.f_fsid.val[0], mp->mnt_stat.f_fsid.val[1],
+ mp->mnt_stat.f_owner, mp->mnt_stat.f_ctime);
+
+ (*pr)(" syncwrites %lu asyncwrites = %lu\n",
+ mp->mnt_stat.f_syncwrites, mp->mnt_stat.f_asyncwrites);
+
+ (*pr)(" fstype \"%s\" mnton \"%s\" mntfrom \"%s\"\n",
+ mp->mnt_stat.f_fstypename, mp->mnt_stat.f_mntonname,
+ mp->mnt_stat.f_mntfromname);
+
+ (*pr)("locked vnodes:");
+ /* XXX would take mountlist lock, except ddb has no context */
+ LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes)
+ if (VOP_ISLOCKED(vp)) {
+ if (!LIST_NEXT(vp, v_mntvnodes))
+ (*pr)(" %p", vp);
+ else if (!(cnt++ % (72 / (sizeof(void *) * 2 + 4))))
+ (*pr)("\n\t%p", vp);
+ else
+ (*pr)(", %p", vp);
+ }
+ (*pr)("\n");
+
+ if (full) {
+ (*pr)("all vnodes:\n\t");
+ /* XXX would take mountlist lock, except ddb has no context */
+ LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes)
+ if (!LIST_NEXT(vp, v_mntvnodes))
+ (*pr)(" %p", vp);
+ else if (!(cnt++ % (72 / (sizeof(void *) * 2 + 4))))
+ (*pr)(" %p,\n\t", vp);
+ else
+ (*pr)(" %p,", vp);
+ (*pr)("\n", vp);
+ }
+}
+#endif /* DDB */
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 60bb0a77389..559a3fb1596 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.h,v 1.46 2004/11/30 12:39:43 pedro Exp $ */
+/* $OpenBSD: buf.h,v 1.47 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */
/*
@@ -168,7 +168,13 @@ struct buf *bufq_default_get(struct bufq *);
#define B_XXX 0x02000000 /* Debugging flag. */
#define B_DEFERRED 0x04000000 /* Skipped over for cleaning */
#define B_SCANNED 0x08000000 /* Block already pushed during sync */
-#define B_PDAEMON 0x10000000 /* I/O started by pagedaemon */
+#define B_PDAEMON 0x10000000 /* I/O started by pagedaemon */
+
+#define B_BITS "\010\001AGE\002NEEDCOMMIT\003ASYNC\004BAD\005BUSY\006CACHE" \
+ "\007CALL\010DELWRI\011DIRTY\012DONE\013EINTR\014ERROR\015GATHERED" \
+ "\016INVAL\017LOCKED\020NOCACHE\021PAGET\022PGIN\023PHYS\024RAW\025READ" \
+ "\026TAPE\027UAREA\030WANTED\031WRITEINPROG\032XXX\033DEFERRED" \
+ "\034SCANNED\035PDAEMON"
/*
* This structure describes a clustered I/O. It is stored in the b_saveaddr
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 6acd3d1161c..6583c14e9db 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.h,v 1.74 2006/07/11 16:24:09 pedro Exp $ */
+/* $OpenBSD: mount.h,v 1.75 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
@@ -416,6 +416,11 @@ struct mount {
*/
#define MNT_VISFLAGMASK 0x0400ffff
+#define MNT_BITS \
+ "\010\001RDONLY\002SYNCHRONOUS\003NOEXEC\004NOSUID\005NODEV" \
+ "\007ASYNC\010EXRDONLY\011EXPORTED\012DEFEXPORTED\013EXPORTANON" \
+ "\014EXKERB\015LOCAL\016QUOTA\017ROOTFS"
+
/*
* filesystem control flags.
*/
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index a51a2d9466c..128d7629029 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.69 2006/06/02 20:25:09 pedro Exp $ */
+/* $OpenBSD: vnode.h,v 1.70 2006/07/11 21:17:58 mickey Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -51,6 +51,9 @@
*/
enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
+#define VTYPE_NAMES \
+ "VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD"
+
/*
* Vnode tag types.
* These are for the benefit of external programs only (e.g., pstat)
@@ -65,6 +68,11 @@ enum vtagtype {
VT_NCPFS, VT_VFS, VT_XFS, VT_NTFS, VT_UDF
};
+#define VTAG_NAMES \
+ "NON", "UFS", "NFS", "MFS", "MSDOSFS", "LFS", "LOFS", \
+ "FDESC", "PORTAL", "KERNFS", "PROCFS", "AFS", "ISOFS", \
+ "ADOSFS", "EXT2FS", "NCPFS", "VFS", "XFS", "NTFS", "UDF"
+
/*
* Each underlying filesystem allocates its own private area and hangs
* it from v_data. If non-null, this area is freed in getnewvnode().
@@ -129,7 +137,9 @@ struct vnode {
#define VXWANT 0x0200 /* process is waiting for vnode */
#define VCLONED 0x0400 /* vnode was cloned */
#define VALIASED 0x0800 /* vnode has an alias */
-#define VLOCKSWORK 0x4000 /* FS supports locking discipline */
+#define VLOCKSWORK 0x4000 /* FS supports locking discipline */
+#define VBITS "\010\001ROOT\002TEXT\003SYSTEM\004ISTTY\010XLOCK" \
+ "\011XWANT\013ALIASED\016LOCKSWORK"
/*
* (v_bioflag) Flags that may be manipulated by interrupt handlers
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 66108fa5935..b03dc37a5bb 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.71 2006/06/28 14:17:07 mickey Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.72 2006/07/11 21:17:58 mickey Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -5634,3 +5634,128 @@ softdep_error(func, error)
/* XXX should do something better! */
printf("%s: got error %d while accessing filesystem\n", func, error);
}
+
+#ifdef DDB
+#include <machine/db_machdep.h>
+#include <ddb/db_interface.h>
+#include <ddb/db_output.h>
+
+void
+softdep_print(struct buf *bp, int full, int (*pr)(const char *, ...))
+{
+ struct worklist *wk;
+
+ (*pr)(" deps:\n");
+ LIST_FOREACH(wk, &bp->b_dep, wk_list)
+ worklist_print(wk, full, pr);
+}
+
+void
+worklist_print(struct worklist *wk, int full, int (*pr)(const char *, ...))
+{
+ struct pagedep *pagedep;
+ struct inodedep *inodedep;
+ struct newblk *newblk;
+ struct bmsafemap *bmsafemap;
+ struct allocdirect *adp;
+ struct indirdep *indirdep;
+ struct allocindir *aip;
+ struct freefrag *freefrag;
+ struct freeblks *freeblks;
+ struct freefile *freefile;
+ struct diradd *dap;
+ struct mkdir *mkdir;
+ struct dirrem *dirrem;
+ struct newdirblk *newdirblk;
+ char prefix[33];
+ int i;
+
+ for (prefix[i = 2 * MIN(16, full)] = '\0'; i--; prefix[i] = ' ')
+ ;
+
+ (*pr)("%s%s(%p) state %b\n%s", prefix, TYPENAME(wk->wk_type), wk,
+ wk->wk_state, DEP_BITS, prefix);
+ switch (wk->wk_type) {
+ case D_PAGEDEP:
+ pagedep = WK_PAGEDEP(wk);
+ (*pr)("mount %p ino %u lbn %lld\n", pagedep->pd_mnt,
+ pagedep->pd_ino, pagedep->pd_lbn);
+ break;
+ case D_INODEDEP:
+ inodedep = WK_INODEDEP(wk);
+ (*pr)("fs %p ino %u nlinkdelta %u dino %p\n%s"
+ "%s bp %p savsz %lld", inodedep->id_fs,
+ inodedep->id_ino, inodedep->id_nlinkdelta,
+ inodedep->id_un.idu_savedino1,
+ prefix, inodedep->id_buf, inodedep->id_savedsize);
+ break;
+ case D_NEWBLK:
+ newblk = WK_NEWBLK(wk);
+ (*pr)("fs %p newblk %d state %d bmsafemap %p\n",
+ newblk->nb_fs, newblk->nb_newblkno, newblk->nb_state,
+ newblk->nb_bmsafemap);
+ break;
+ case D_BMSAFEMAP:
+ bmsafemap = WK_BMSAFEMAP(wk);
+ (*pr)("buf %p\n", bmsafemap->sm_buf);
+ break;
+ case D_ALLOCDIRECT:
+ adp = WK_ALLOCDIRECT(wk);
+ (*pr)("lbn %lld newlbk %d oldblk %d newsize %lu olsize %lu\n"
+ "%s bp %p inodedep %p freefrag %p\n", adp->ad_lbn,
+ adp->ad_newblkno, adp->ad_oldblkno, adp->ad_newsize,
+ adp->ad_oldsize,
+ prefix, adp->ad_buf, adp->ad_inodedep, adp->ad_freefrag);
+ break;
+ case D_INDIRDEP:
+ indirdep = WK_INDIRDEP(wk);
+ (*pr)("savedata %p savebp %p\n", indirdep->ir_saveddata,
+ indirdep->ir_savebp);
+ break;
+ case D_ALLOCINDIR:
+ aip = WK_ALLOCINDIR(wk);
+ (*pr)("off %d newblk %d oldblk %d freefrag %p\n"
+ "%s indirdep %p buf %p\n", aip->ai_offset,
+ aip->ai_newblkno, aip->ai_oldblkno, aip->ai_freefrag,
+ prefix, aip->ai_indirdep, aip->ai_buf);
+ break;
+ case D_FREEFRAG:
+ freefrag = WK_FREEFRAG(wk);
+ (*pr)("vnode %p mp %p blkno %d fsize %ld ino %u\n",
+ freefrag->ff_devvp, freefrag->ff_mnt, freefrag->ff_blkno,
+ freefrag->ff_fragsize, freefrag->ff_inum);
+ break;
+ case D_FREEBLKS:
+ freeblks = WK_FREEBLKS(wk);
+ (*pr)("previno %u devvp %p mp %p oldsz %lld newsz %lld\n"
+ "%s chkcnt %d uid %d\n", freeblks->fb_previousinum,
+ freeblks->fb_devvp, freeblks->fb_mnt, freeblks->fb_oldsize,
+ freeblks->fb_newsize,
+ prefix, freeblks->fb_chkcnt, freeblks->fb_uid);
+ break;
+ case D_FREEFILE:
+ freefile = WK_FREEFILE(wk);
+ (*pr)("mode %x oldino %u vnode %p mp %p\n", freefile->fx_mode,
+ freefile->fx_oldinum, freefile->fx_devvp, freefile->fx_mnt);
+ break;
+ case D_DIRADD:
+ dap = WK_DIRADD(wk);
+ (*pr)("off %ld ino %u da_un %p\n", dap->da_offset,
+ dap->da_newinum, dap->da_un.dau_previous);
+ break;
+ case D_MKDIR:
+ mkdir = WK_MKDIR(wk);
+ (*pr)("diradd %p bp %p\n", mkdir->md_diradd, mkdir->md_buf);
+ break;
+ case D_DIRREM:
+ dirrem = WK_DIRREM(wk);
+ (*pr)("mp %p ino %u dm_un %p\n", dirrem->dm_mnt,
+ dirrem->dm_oldinum, dirrem->dm_un.dmu_pagedep);
+ break;
+ case D_NEWDIRBLK:
+ newdirblk = WK_NEWDIRBLK(wk);
+ (*pr)("pagedep %p\n", newdirblk->db_pagedep);
+ break;
+ }
+}
+#endif
diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h
index f2fb6808241..77d80c334df 100644
--- a/sys/ufs/ffs/softdep.h
+++ b/sys/ufs/ffs/softdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softdep.h,v 1.11 2006/01/03 23:34:39 pedro Exp $ */
+/* $OpenBSD: softdep.h,v 1.12 2006/07/11 21:17:58 mickey Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -109,6 +109,10 @@
#define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE)
+#define DEP_BITS "\020\01ATTACHED\02UNDONE\03COMPLETE\04DEPCOMPLETE" \
+ "\05MKDIR_PARENT\06MKDIR_BODY\07RMDIR\010DIRCHG\011GOINGAWAY" \
+ "\012IOSTARTED\013SPACECOUNTED\014NEWBLOCK\016UFS1FMT\020ONWORKLIST"
+
/*
* The workitem queue.
*