From aef00d7b03f89c7d8af36bdb3e202d410ad5a911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 25 Jan 2004 14:46:24 +0000 Subject: [PATCH] Cleaned up the debug mess mmu_man has created (thanks anyway!). Fixed a bug where the debug commands would be added in bfs_mount(), but not removed (since bfs_unmount() is only called if bfs_mount() doesn't fail). Switched to kernel_cpp.h/cpp. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6290 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../file_systems/bfs/kernel_interface.cpp | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 7f50939d24..6af18fb1c6 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -6,7 +6,6 @@ #include "Debug.h" -#include "cpp.h" #include "Volume.h" #include "Inode.h" #include "Index.h" @@ -14,6 +13,8 @@ #include "Query.h" #include "bfs_control.h" +#include + #include #include @@ -222,29 +223,12 @@ vnode_ops fs_entry = { int32 api_version = B_CUR_FS_API_VERSION; -#ifdef DEBUG -//#warn Don't mount more than once... would register twice the debugger commands! -int db_obfsinode(int argc, char **argv) -{ - Inode *ino; - if (argc < 2) { - kprintf("usage: obfsinode ptr\n"); - return 0; - } - ino = (Inode *)parse_expression(argv[1]); - ino->KDumpMe(); - return 0; -} -#endif static int bfs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, vnode_id *rootID) { FUNCTION(); -#ifdef DEBUG - add_debugger_command("obfsinode", db_obfsinode, "dump an OpenBFS Inode"); -#endif Volume *volume = new Volume(nsid); if (volume == NULL) @@ -256,6 +240,10 @@ bfs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, *rootID = volume->ToVnode(volume->Root()); INFORM(("mounted \"%s\" (root node at %Ld, device = %s)\n", volume->Name(), *rootID, device)); + +#ifdef DEBUG + add_debugger_commands(); +#endif } else delete volume; @@ -274,7 +262,7 @@ bfs_unmount(void *ns) delete volume; #ifdef DEBUG - remove_debugger_command("obfsinode", db_obfsinode); + remove_debugger_commands(); #endif RETURN_ERROR(status); }