summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_softdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs/ffs/ffs_softdep.c')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index ae532b6..3c9a906 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -41,6 +41,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ffs.h"
+#include "opt_ddb.h"
+
/*
* For now we want the safety net that the DEBUG flag provides.
*/
@@ -77,7 +80,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
-#include "opt_ffs.h"
+#include <ddb/ddb.h>
#ifndef SOFTUPDATES
@@ -6334,4 +6337,30 @@ softdep_error(func, error)
printf("%s: got error %d while accessing filesystem\n", func, error);
}
+#ifdef DDB
+
+DB_SHOW_COMMAND(inodedeps, db_show_inodedeps)
+{
+ struct inodedep_hashhead *inodedephd;
+ struct inodedep *inodedep;
+ struct fs *fs;
+ int cnt;
+
+ fs = have_addr ? (struct fs *)addr : NULL;
+ for (cnt = 0; cnt < inodedep_hash; cnt++) {
+ inodedephd = &inodedep_hashtbl[cnt];
+ LIST_FOREACH(inodedep, inodedephd, id_hash) {
+ if (fs != NULL && fs != inodedep->id_fs)
+ continue;
+ db_printf("%p fs %p st %x ino %jd inoblk %jd\n",
+ inodedep, inodedep->id_fs, inodedep->id_state,
+ (intmax_t)inodedep->id_ino,
+ (intmax_t)fsbtodb(inodedep->id_fs,
+ ino_to_fsba(inodedep->id_fs, inodedep->id_ino)));
+ }
+ }
+}
+
+#endif /* DDB */
+
#endif /* SOFTUPDATES */
OpenPOWER on IntegriCloud