diff --git a/eden/fs/inodes/TreeInode.cpp b/eden/fs/inodes/TreeInode.cpp index 7a6fcec8ae..fc7f99e0b1 100644 --- a/eden/fs/inodes/TreeInode.cpp +++ b/eden/fs/inodes/TreeInode.cpp @@ -3454,15 +3454,13 @@ size_t TreeInode::unloadChildrenLastAccessedBefore(const timespec& cutoff) { } #endif -void TreeInode::getDebugStatus(vector& results) const { +void TreeInode::getDebugStatus( + vector& results, + const RelativePath& myPath) const { TreeInodeDebugInfo info; *info.inodeNumber_ref() = getNodeId().get(); *info.refcount_ref() = debugGetFuseRefcount(); - - auto myPath = getPath(); - if (myPath.has_value()) { - *info.path_ref() = myPath.value().stringPiece().str(); - } + *info.path_ref() = myPath.stringPiece().str(); vector> childInodes; { @@ -3548,10 +3546,10 @@ void TreeInode::getDebugStatus(vector& results) const { // results. We do this separately from the loop above just to order the // results nicely: parents appear before their children, and children // are sorted alphabetically (since contents_.entries are sorted). - for (const auto& childData : childInodes) { - auto childTree = childData.second.asTreePtrOrNull(); + for (const auto& [childName, childInode] : childInodes) { + auto childTree = childInode.asTreePtrOrNull(); if (childTree) { - childTree->getDebugStatus(results); + childTree->getDebugStatus(results, myPath + childName); } } } diff --git a/eden/fs/inodes/TreeInode.h b/eden/fs/inodes/TreeInode.h index 23974e3752..d8d24d6a28 100644 --- a/eden/fs/inodes/TreeInode.h +++ b/eden/fs/inodes/TreeInode.h @@ -392,7 +392,9 @@ class TreeInode final : public InodeBaseMetadata { * This populates the results argument with TreeInodeDebugInfo objects for * this TreeInode and all subdirectories inside of it. */ - void getDebugStatus(std::vector& results) const; + void getDebugStatus( + std::vector& results, + const RelativePath& myPath) const; /** * Returns a copy of this inode's metadata. diff --git a/eden/fs/service/EdenServiceHandler.cpp b/eden/fs/service/EdenServiceHandler.cpp index a0dbcf8781..2ba0332b47 100644 --- a/eden/fs/service/EdenServiceHandler.cpp +++ b/eden/fs/service/EdenServiceHandler.cpp @@ -1223,7 +1223,7 @@ void EdenServiceHandler::debugInodeStatus( auto edenMount = server_->getMount(*mountPoint); auto inode = inodeFromUserPath(*edenMount, *path).asTreePtr(); - inode->getDebugStatus(inodeInfo); + inode->getDebugStatus(inodeInfo, RelativePath{*path}); } void EdenServiceHandler::debugOutstandingFuseCalls(