* Added new debugger commands bfs_btree_header and bfs_btree_node that

dump a B+tree header resp. node.
* Use dprintf() when a transaction is too large instead of a panic; even
  though the file system has to revert the transaction, it's not lethal,
  and it does not corrupt your disk.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23653 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-01-19 20:58:47 +00:00
parent d62f743549
commit 5d43cf2a84
2 changed files with 51 additions and 6 deletions

View File

@ -256,7 +256,7 @@ dump_inode(int argc, char **argv)
Inode *inode = (Inode *)parse_expression(argv[1]);
dump_inode(&inode->Node());
return B_OK;
return 0;
}
@ -275,7 +275,46 @@ dump_volume(int argc, char **argv)
dump_super_block(&volume->SuperBlock());
return B_OK;
return 0;
}
static int
dump_bplustree_node(int argc, char **argv)
{
if (argc < 2 || argc > 4 || !strcmp(argv[1], "--help")) {
kprintf("usage: %s <ptr-to-node> [ptr-to-header] [ptr-to-volume]\n",
argv[0]);
return 0;
}
bplustree_node *node = (bplustree_node *)parse_expression(argv[1]);
bplustree_header *header = NULL;
Volume *volume = NULL;
if (argc > 2)
header = (bplustree_header *)parse_expression(argv[2]);
if (argc > 3)
volume = (Volume *)parse_expression(argv[3]);
dump_bplustree_node(node, header, volume);
return 0;
}
static int
dump_bplustree_header(int argc, char **argv)
{
if (argc != 2 || !strcmp(argv[1], "--help")) {
kprintf("usage: %s <ptr-to-header>\n", argv[0]);
return 0;
}
bplustree_header *header = (bplustree_header *)parse_expression(argv[1]);
dump_bplustree_header(header);
return 0;
}
@ -284,6 +323,8 @@ remove_debugger_commands()
{
remove_debugger_command("bfs_inode", dump_inode);
remove_debugger_command("bfs_allocator", dump_block_allocator);
remove_debugger_command("bfs_btree_header", dump_bplustree_header);
remove_debugger_command("bfs_btree_node", dump_bplustree_node);
remove_debugger_command("bfs", dump_volume);
}
@ -293,7 +334,11 @@ add_debugger_commands()
{
add_debugger_command("bfs_inode", dump_inode, "dump an Inode object");
add_debugger_command("bfs_allocator", dump_block_allocator,
"dump a BFS block allocator.");
"dump a BFS block allocator");
add_debugger_command("bfs_btree_header", dump_bplustree_header,
"dump a BFS B+tree header");
add_debugger_command("bfs_btree_node", dump_bplustree_node,
"dump a BFS B+tree node");
add_debugger_command("bfs", dump_volume, "dump a BFS volume");
}

View File

@ -559,9 +559,9 @@ Journal::_WriteTransactionToLog()
// a) abort the transaction - bad, because all changes are lost
// b) carry out the changes, but don't use the log - even worse,
// as it potentially creates a corrupted disk.
panic("transaction too large (%ld blocks, %ld main, log size %ld)!\n",
(long)_TransactionSize(), cache_blocks_in_main_transaction(
fVolume->BlockCache(), fTransactionID), (long)fLogSize);
dprintf("transaction too large (%d blocks, %d main, log size %d)!\n",
(int)_TransactionSize(), (int)cache_blocks_in_main_transaction(
fVolume->BlockCache(), fTransactionID), (int)fLogSize);
return B_BUFFER_OVERFLOW;
}
}