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:
@@ -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
|
void
|
||||||
EntryCache::_AddEntryToCurrentGeneration(EntryCacheEntry* entry)
|
EntryCache::_AddEntryToCurrentGeneration(EntryCacheEntry* entry)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ public:
|
|||||||
bool Lookup(ino_t dirID, const char* name,
|
bool Lookup(ino_t dirID, const char* name,
|
||||||
ino_t& nodeID);
|
ino_t& nodeID);
|
||||||
|
|
||||||
|
const char* DebugReverseLookup(ino_t nodeID, ino_t& _dirID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int32 kGenerationCount = 8;
|
static const int32 kGenerationCount = 8;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user