summaryrefslogtreecommitdiff
path: root/Kernel/VM/Region.cpp
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-01-01 00:02:40 -0700
committerAndreas Kling <kling@serenityos.org>2021-01-01 23:43:44 +0100
commit2f429bd2d5ff3433c6a26208dd4abfdcc8129c19 (patch)
treef1575cfac500b93a118a2ff71680d8efdf34b588 /Kernel/VM/Region.cpp
parenta0c91719d85ca37f613acee5b7f3d16dca6b3ebd (diff)
downloadserenity-2f429bd2d5ff3433c6a26208dd4abfdcc8129c19.zip
Kernel: Pass new region owner to Region::clone
Diffstat (limited to 'Kernel/VM/Region.cpp')
-rw-r--r--Kernel/VM/Region.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp
index 011a91cfcd..35964c25af 100644
--- a/Kernel/VM/Region.cpp
+++ b/Kernel/VM/Region.cpp
@@ -86,7 +86,7 @@ void Region::unregister_purgeable_page_ranges()
}
}
-OwnPtr<Region> Region::clone()
+OwnPtr<Region> Region::clone(Process& new_owner)
{
ASSERT(Process::current());
@@ -98,7 +98,7 @@ OwnPtr<Region> Region::clone()
auto new_vmobject = AnonymousVMObject::create_with_size(size(), AllocationStrategy::Reserve); // TODO: inherit committed non-volatile areas?
if (!new_vmobject)
return {};
- auto zeroed_region = Region::create_user_accessible(get_owner().ptr(), m_range, new_vmobject.release_nonnull(), 0, m_name, m_access);
+ auto zeroed_region = Region::create_user_accessible(&new_owner, m_range, new_vmobject.release_nonnull(), 0, m_name, m_access);
zeroed_region->copy_purgeable_page_ranges(*this);
zeroed_region->set_mmap(m_mmap);
zeroed_region->set_inherit_mode(m_inherit_mode);
@@ -114,7 +114,7 @@ OwnPtr<Region> Region::clone()
ASSERT(vmobject().is_shared_inode());
// Create a new region backed by the same VMObject.
- auto region = Region::create_user_accessible(get_owner().ptr(), m_range, m_vmobject, m_offset_in_vmobject, m_name, m_access);
+ auto region = Region::create_user_accessible(&new_owner, m_range, m_vmobject, m_offset_in_vmobject, m_name, m_access);
if (m_vmobject->is_anonymous())
region->copy_purgeable_page_ranges(*this);
region->set_mmap(m_mmap);
@@ -134,7 +134,7 @@ OwnPtr<Region> Region::clone()
#endif
// Set up a COW region. The parent (this) region becomes COW as well!
remap();
- auto clone_region = Region::create_user_accessible(get_owner().ptr(), m_range, vmobject_clone.release_nonnull(), m_offset_in_vmobject, m_name, m_access);
+ auto clone_region = Region::create_user_accessible(&new_owner, m_range, vmobject_clone.release_nonnull(), m_offset_in_vmobject, m_name, m_access);
if (m_vmobject->is_anonymous())
clone_region->copy_purgeable_page_ranges(*this);
if (m_stack) {