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

Kernel: Remove some unnecessary indirection in InodeFile::mmap()

InodeFile now directly calls Process::allocate_region_with_vmobject()
instead of taking an awkward detour via a special Region constructor.
This commit is contained in:
Andreas Kling 2020-02-28 20:29:14 +01:00
parent 651417a085
commit aa1e209845
5 changed files with 3 additions and 33 deletions

View file

@ -48,16 +48,6 @@ Region::Region(const Range& range, const String& name, u8 access, bool cacheable
MM.register_region(*this);
}
Region::Region(const Range& range, NonnullRefPtr<Inode> inode, const String& name, u8 access, bool cacheable)
: m_range(range)
, m_vmobject(SharedInodeVMObject::create_with_inode(*inode))
, m_name(name)
, m_access(access)
, m_cacheable(cacheable)
{
MM.register_region(*this);
}
Region::Region(const Range& range, NonnullRefPtr<VMObject> vmobject, size_t offset_in_vmobject, const String& name, u8 access, bool cacheable)
: m_range(range)
, m_offset_in_vmobject(offset_in_vmobject)
@ -206,13 +196,6 @@ NonnullOwnPtr<Region> Region::create_user_accessible(const Range& range, Nonnull
return region;
}
NonnullOwnPtr<Region> Region::create_user_accessible(const Range& range, NonnullRefPtr<Inode> inode, const StringView& name, u8 access, bool cacheable)
{
auto region = make<Region>(range, move(inode), name, access, cacheable);
region->m_user_accessible = true;
return region;
}
NonnullOwnPtr<Region> Region::create_kernel_only(const Range& range, NonnullRefPtr<VMObject> vmobject, size_t offset_in_vmobject, const StringView& name, u8 access, bool cacheable)
{
auto region = make<Region>(range, move(vmobject), offset_in_vmobject, name, access, cacheable);