Added obfsinode kernel debugger command.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6262 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2047,6 +2047,19 @@ Inode::Create(Transaction *transaction, Inode *parent, const char *name, int32 m
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Inode::KDumpMe()
|
||||||
|
{
|
||||||
|
kprintf("Inode {\n");
|
||||||
|
CachedBlock::KDumpMe();
|
||||||
|
kprintf("fTree = 0x%08lx\n", fTree);
|
||||||
|
kprintf("fAttributes = 0x%08lx\n", fAttributes);
|
||||||
|
kprintf("fLock {}\n");
|
||||||
|
kprintf("fOldSize = 0x%16Lx\n", fOldSize);
|
||||||
|
kprintf("fOldLastModified = 0x%16Lx\n", fOldLastModified);
|
||||||
|
kprintf("}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ class CachedBlock {
|
|||||||
off_t BlockNumber() const { return fBlockNumber; }
|
off_t BlockNumber() const { return fBlockNumber; }
|
||||||
uint32 BlockSize() const { return fVolume->BlockSize(); }
|
uint32 BlockSize() const { return fVolume->BlockSize(); }
|
||||||
uint32 BlockShift() const { return fVolume->BlockShift(); }
|
uint32 BlockShift() const { return fVolume->BlockShift(); }
|
||||||
|
|
||||||
|
void KDumpMe();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CachedBlock(const CachedBlock &);
|
CachedBlock(const CachedBlock &);
|
||||||
@@ -177,6 +179,8 @@ class Inode : public CachedBlock {
|
|||||||
off_t OldSize() { return fOldSize; }
|
off_t OldSize() { return fOldSize; }
|
||||||
off_t OldLastModified() { return fOldLastModified; }
|
off_t OldLastModified() { return fOldLastModified; }
|
||||||
|
|
||||||
|
void KDumpMe();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Inode(const Inode &);
|
Inode(const Inode &);
|
||||||
Inode &operator=(const Inode &);
|
Inode &operator=(const Inode &);
|
||||||
@@ -375,6 +379,15 @@ CachedBlock::WriteBack(Transaction *transaction)
|
|||||||
return transaction->WriteBlocks(fBlockNumber, fBlock);
|
return transaction->WriteBlocks(fBlockNumber, fBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
CachedBlock::KDumpMe()
|
||||||
|
{
|
||||||
|
kprintf("CachedBlock {\n");
|
||||||
|
kprintf("fVolume = 0x%08lx\n", fVolume);
|
||||||
|
kprintf("fBlockNumber = 0x%16Lx\n", fBlockNumber);
|
||||||
|
kprintf("fBlock = 0x%08lx\n", fBlock);
|
||||||
|
kprintf("}\n");
|
||||||
|
}
|
||||||
|
|
||||||
/** Converts the "omode", the open flags given to bfs_open(), into
|
/** Converts the "omode", the open flags given to bfs_open(), into
|
||||||
* access modes, e.g. since O_RDONLY requires read access to the
|
* access modes, e.g. since O_RDONLY requires read access to the
|
||||||
|
|||||||
@@ -222,12 +222,29 @@ vnode_ops fs_entry = {
|
|||||||
|
|
||||||
int32 api_version = B_CUR_FS_API_VERSION;
|
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
|
static int
|
||||||
bfs_mount(nspace_id nsid, const char *device, ulong flags, void *parms,
|
bfs_mount(nspace_id nsid, const char *device, ulong flags, void *parms,
|
||||||
size_t len, void **data, vnode_id *rootID)
|
size_t len, void **data, vnode_id *rootID)
|
||||||
{
|
{
|
||||||
FUNCTION();
|
FUNCTION();
|
||||||
|
#ifdef DEBUG
|
||||||
|
add_debugger_command("obfsinode", db_obfsinode, "dump an OpenBFS Inode");
|
||||||
|
#endif
|
||||||
|
|
||||||
Volume *volume = new Volume(nsid);
|
Volume *volume = new Volume(nsid);
|
||||||
if (volume == NULL)
|
if (volume == NULL)
|
||||||
@@ -256,6 +273,9 @@ bfs_unmount(void *ns)
|
|||||||
status_t status = volume->Unmount();
|
status_t status = volume->Unmount();
|
||||||
delete volume;
|
delete volume;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
remove_debugger_command("obfsinode", db_obfsinode);
|
||||||
|
#endif
|
||||||
RETURN_ERROR(status);
|
RETURN_ERROR(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user