1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Split VMObject into two classes: Anonymous- and InodeVMObject

InodeVMObject is a VMObject with an underlying Inode in the filesystem.
AnonymousVMObject has no Inode.

I'm happy that InodeVMObject::inode() can now return Inode& instead of
VMObject::inode() return Inode*. :^)
This commit is contained in:
Andreas Kling 2019-08-07 18:06:17 +02:00
parent cb2d572a14
commit 6bdb81ad87
16 changed files with 286 additions and 200 deletions

View file

@ -26,6 +26,7 @@
#include <Kernel/StdLib.h>
#include <Kernel/Syscall.h>
#include <Kernel/TTY/MasterPTY.h>
#include <Kernel/VM/InodeVMObject.h>
#include <Kernel/kmalloc.h>
#include <LibC/errno_numbers.h>
#include <LibC/signal_numbers.h>
@ -339,7 +340,8 @@ int Process::do_exec(String path, Vector<String> arguments, Vector<String> envir
#endif
ProcessPagingScope paging_scope(*this);
auto vmo = VMObject::create_file_backed(description->inode());
ASSERT(description->inode());
auto vmo = InodeVMObject::create_with_inode(*description->inode());
RefPtr<Region> region = allocate_region_with_vmo(VirtualAddress(), metadata.size, vmo, 0, description->absolute_path(), PROT_READ);
ASSERT(region);