Added DebugReverseLookup() method to reverse-lookup directory and entry name

for a given vnode (for debugging purposes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35625 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-02-26 22:13:18 +00:00
parent 561d4cb9eb
commit 83291a2a64
2 changed files with 18 additions and 0 deletions

View File

@ -204,6 +204,22 @@ EntryCache::Lookup(ino_t dirID, const char* name, ino_t& _nodeID)
}
const char*
EntryCache::DebugReverseLookup(ino_t nodeID, ino_t& _dirID)
{
for (EntryTable::Iterator it = fEntries.GetIterator();
EntryCacheEntry* entry = it.Next();) {
if (nodeID == entry->node_id && strcmp(entry->name, ".") != 0
&& strcmp(entry->name, "..") != 0) {
_dirID = entry->dir_id;
return entry->name;
}
}
return NULL;
}
void
EntryCache::_AddEntryToCurrentGeneration(EntryCacheEntry* entry)
{

View File

@ -94,6 +94,8 @@ public:
bool Lookup(ino_t dirID, const char* name,
ino_t& nodeID);
const char* DebugReverseLookup(ino_t nodeID, ino_t& _dirID);
private:
static const int32 kGenerationCount = 8;