mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
651417a085
commit
aa1e209845
Notes:
sideshowbarker
2024-07-19 08:59:04 +09:00
Author: https://github.com/awesomekling
Commit: aa1e209845
5 changed files with 3 additions and 33 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <Kernel/FileSystem/InodeFile.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/VM/SharedInodeVMObject.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -63,7 +64,7 @@ KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptio
|
|||
{
|
||||
ASSERT(offset == 0);
|
||||
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
|
||||
auto* region = process.allocate_file_backed_region(preferred_vaddr, size, inode(), description.absolute_path(), prot);
|
||||
auto* region = process.allocate_region_with_vmobject(preferred_vaddr, size, SharedInodeVMObject::create_with_inode(inode()), offset, description.absolute_path(), prot);
|
||||
if (!region)
|
||||
return KResult(-ENOMEM);
|
||||
return region;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue