Bläddra i källkod

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.
kleines Filmröllchen 3 år sedan
förälder
incheckning
b0a2572577
1 ändrade filer med 0 tillägg och 3 borttagningar
  1. 0 3
      Kernel/FileSystem/AnonymousFile.cpp

+ 0 - 3
Kernel/FileSystem/AnonymousFile.cpp

@@ -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);
 }