mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
Add a VMO pointer to VNode.
This way, if anyone tries to map an already mapped file, we share the VMO.
This commit is contained in:
parent
862f108cb5
commit
3b2dcd5929
Notes:
sideshowbarker
2024-07-19 18:31:39 +09:00
Author: https://github.com/awesomekling
Commit: 3b2dcd5929
8 changed files with 59 additions and 10 deletions
|
@ -180,6 +180,7 @@ auto VirtualFileSystem::allocateNode() -> RetainPtr<Node>
|
|||
ASSERT(node->retainCount == 0);
|
||||
node->retainCount = 1;
|
||||
node->m_vfs = this;
|
||||
node->m_vmo = nullptr;
|
||||
return adopt(*node);
|
||||
}
|
||||
|
||||
|
@ -197,6 +198,8 @@ void VirtualFileSystem::freeNode(Node* node)
|
|||
m_device2vnode.remove(encodedDevice(node->m_characterDevice->major(), node->m_characterDevice->minor()));
|
||||
node->m_characterDevice = nullptr;
|
||||
}
|
||||
node->m_vfs = nullptr;
|
||||
node->m_vmo = nullptr;
|
||||
m_nodeFreeList.append(move(node));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue