Kernel: Don't require AnonymousFiles to be mmap'd completely

AnonymousFile always allocates in multiples of a page size when created
with anon_create. This is especially an issue if we use AnonymousFile
shared memory to store a shared data structure that isn't exactly a
multiple of a page in size. Therefore, we can just allow mmaps of
AnonymousFile to map only an initial part of the shared memory.

This makes SharedSingleProducerCircularQueue work when it's introduced
later.
This commit is contained in:
kleines Filmröllchen 2022-04-05 14:24:53 +02:00 committed by Linus Groh
parent 65b338ad04
commit b0a2572577
Notes: sideshowbarker 2024-07-17 11:37:22 +09:00

View file

@ -22,9 +22,6 @@ ErrorOr<Memory::Region*> AnonymousFile::mmap(Process& process, OpenFileDescripti
if (offset != 0)
return EINVAL;
if (range.size() != m_vmobject->size())
return EINVAL;
return process.address_space().allocate_region_with_vmobject(range, m_vmobject, offset, {}, prot, shared);
}