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.
This commit is contained in:
Tom 2021-01-23 09:11:45 -07:00 committed by Andreas Kling
commit 250a310454
Notes: sideshowbarker 2024-07-18 22:48:34 +09:00
4 changed files with 23 additions and 11 deletions

View file

@ -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;