summaryrefslogtreecommitdiff
path: root/Kernel/Memory/PrivateInodeVMObject.cpp
diff options
context:
space:
mode:
authorcreator1creeper1 <creator1creeper1@airmail.cc>2022-01-12 17:59:46 +0100
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-15 22:16:00 +0200
commitad480ff18bccb43d1cd29c86f1bb99c4888dfd8d (patch)
tree9edb9bc779c85f9268d47de5a74ae12a5e787a9c /Kernel/Memory/PrivateInodeVMObject.cpp
parent3879e70447a9e3b0f6a8ae64ba1a575c2b5f5703 (diff)
downloadserenity-ad480ff18bccb43d1cd29c86f1bb99c4888dfd8d.zip
Kernel: Make InodeVMOBject construction OOM-aware
This commit moves the allocation of the resources required for InodeVMObject from its constructors to the constructors of its child classes. We're making this change to give the child classes the chance to expose the fallibility of the allocation.
Diffstat (limited to 'Kernel/Memory/PrivateInodeVMObject.cpp')
-rw-r--r--Kernel/Memory/PrivateInodeVMObject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Memory/PrivateInodeVMObject.cpp b/Kernel/Memory/PrivateInodeVMObject.cpp
index cd552bc34f..16573fc2dd 100644
--- a/Kernel/Memory/PrivateInodeVMObject.cpp
+++ b/Kernel/Memory/PrivateInodeVMObject.cpp
@@ -20,12 +20,12 @@ ErrorOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
}
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
- : InodeVMObject(inode, size)
+ : InodeVMObject(inode, VMObject::must_create_physical_pages_but_fixme_should_propagate_errors(size))
{
}
PrivateInodeVMObject::PrivateInodeVMObject(PrivateInodeVMObject const& other)
- : InodeVMObject(other)
+ : InodeVMObject(other, other.must_clone_physical_pages_but_fixme_should_propagate_errors())
{
}