summaryrefslogtreecommitdiff
path: root/Kernel/VM/SharedInodeVMObject.cpp
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-01-23 09:11:45 -0700
committerAndreas Kling <kling@serenityos.org>2021-01-27 22:48:41 +0100
commit250a31045485f231ad7d5b51247688796c5e9d47 (patch)
treeb5e7add3e1e8556618811ba7f10a6eeebfb6db1d /Kernel/VM/SharedInodeVMObject.cpp
parentac3927086fe663db0cb04fd0d746a68c96e229b4 (diff)
downloadserenity-250a31045485f231ad7d5b51247688796c5e9d47.zip
Kernel: Release MM lock while yielding from inode page fault handler
We need to make sure other processors can grab the MM lock while we wait, so release it when we might block. Reading the page from disk may also block, so release it during that time as well.
Diffstat (limited to 'Kernel/VM/SharedInodeVMObject.cpp')
-rw-r--r--Kernel/VM/SharedInodeVMObject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/VM/SharedInodeVMObject.cpp b/Kernel/VM/SharedInodeVMObject.cpp
index 4a04d5031f..33b0316f59 100644
--- a/Kernel/VM/SharedInodeVMObject.cpp
+++ b/Kernel/VM/SharedInodeVMObject.cpp
@@ -34,8 +34,8 @@ namespace Kernel {
NonnullRefPtr<SharedInodeVMObject> SharedInodeVMObject::create_with_inode(Inode& inode)
{
size_t size = inode.size();
- if (inode.shared_vmobject())
- return *inode.shared_vmobject();
+ if (auto shared_vmobject = inode.shared_vmobject())
+ return shared_vmobject.release_nonnull();
auto vmobject = adopt(*new SharedInodeVMObject(inode, size));
vmobject->inode().set_shared_vmobject(*vmobject);
return vmobject;