mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00

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*. :^)
24 lines
605 B
C++
24 lines
605 B
C++
#include <Kernel/FileSystem/FileSystem.h>
|
|
#include <Kernel/FileSystem/Inode.h>
|
|
#include <Kernel/VM/MemoryManager.h>
|
|
#include <Kernel/VM/VMObject.h>
|
|
|
|
VMObject::VMObject(const VMObject& other)
|
|
: m_size(other.m_size)
|
|
, m_physical_pages(other.m_physical_pages)
|
|
{
|
|
MM.register_vmo(*this);
|
|
}
|
|
|
|
VMObject::VMObject(size_t size, ShouldFillPhysicalPages should_fill_physical_pages)
|
|
: m_size(size)
|
|
{
|
|
MM.register_vmo(*this);
|
|
if (should_fill_physical_pages == ShouldFillPhysicalPages::Yes)
|
|
m_physical_pages.resize(page_count());
|
|
}
|
|
|
|
VMObject::~VMObject()
|
|
{
|
|
MM.unregister_vmo(*this);
|
|
}
|