mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
Kernel: Hoist VM range allocation up to sys$mmap() itself
Instead of letting each File subclass do range allocation in their mmap() override, do it up front in sys$mmap(). This makes us honor alignment requests for file-backed memory mappings and simplifies the code somwhat.
This commit is contained in:
@@ -328,10 +328,10 @@ InodeMetadata FileDescription::metadata() const
|
||||
return {};
|
||||
}
|
||||
|
||||
KResultOr<Region*> FileDescription::mmap(Process& process, VirtualAddress vaddr, size_t offset, size_t size, int prot, bool shared)
|
||||
KResultOr<Region*> FileDescription::mmap(Process& process, const Range& range, size_t offset, int prot, bool shared)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
return m_file->mmap(process, *this, vaddr, offset, size, prot, shared);
|
||||
return m_file->mmap(process, *this, range, offset, prot, shared);
|
||||
}
|
||||
|
||||
KResult FileDescription::truncate(u64 length)
|
||||
|
||||
Reference in New Issue
Block a user