packagefs: Followups to the directory locking change.

* Fix the build with DEBUG enabled.

 * Add some more read-locks, to be safe.
This commit is contained in:
Augustin Cavalier 2024-10-09 23:29:03 -04:00
parent 38946ff82f
commit 04c9b279cb
3 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,7 @@ Index::Dump()
if (GetIterator(it)) {
while (Node* node = it.Next()) {
PRINT(" node: `%s', dir: %" B_PRIdINO "\n",
node->Name().Data(), node->Parent()->ID());
node->Name().Data(), node->GetParentUnchecked()->ID());
}
}
)

View File

@ -148,7 +148,7 @@ packagefs_lookup(fs_volume* fsVolume, fs_vnode* fsDir, const char* entryName,
Node* node = (Node*)fsDir->private_node;
FUNCTION("volume: %p, dir: %p (%" B_PRId64 "), entry: \"%s\"\n", volume,
dir, dir->ID(), entryName);
node, node->ID(), entryName);
if (!S_ISDIR(node->Mode()))
return B_NOT_A_DIRECTORY;

View File

@ -1923,6 +1923,7 @@ Volume::_AddPackageLinksNode(Node* node)
// If this is a directory, recursively add descendants. The directory tree
// for the package links isn't deep, so we can do recursion.
if (Directory* directory = dynamic_cast<Directory*>(node)) {
DirectoryReadLocker directoryReadLocker(directory);
for (Node* child = directory->FirstChild(); child != NULL;
child = directory->NextChild(child)) {
_AddPackageLinksNode(child);
@ -1937,6 +1938,7 @@ Volume::_RemovePackageLinksNode(Node* node)
// If this is a directory, recursively remove descendants. The directory
// tree for the package links isn't deep, so we can do recursion.
if (Directory* directory = dynamic_cast<Directory*>(node)) {
DirectoryReadLocker directoryReadLocker(directory);
for (Node* child = directory->FirstChild(); child != NULL;
child = directory->NextChild(child)) {
_RemovePackageLinksNode(child);