mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
Kernel: Don't page in entire file immediately on mmap().
If we just don't do anything, the page fault handler will load the file incrementally as-needed instead. :^)
This commit is contained in:
parent
f5234660f6
commit
75866438b5
Notes:
sideshowbarker
2024-07-19 14:01:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/75866438b58
1 changed files with 1 additions and 4 deletions
|
@ -338,12 +338,9 @@ KResultOr<Region*> FileDescriptor::mmap(Process& process, LinearAddress laddr, s
|
|||
region_name = "Memory-mapped file";
|
||||
#endif
|
||||
InterruptDisabler disabler;
|
||||
// FIXME: Implement mapping at a client-specified address. Most of the support is already in plcae.
|
||||
ASSERT(laddr.as_ptr() == nullptr);
|
||||
auto* region = process.allocate_file_backed_region(LinearAddress(), size, inode(), move(region_name), prot & PROT_READ, prot & PROT_WRITE);
|
||||
auto* region = process.allocate_file_backed_region(laddr, size, inode(), move(region_name), prot & PROT_READ, prot & PROT_WRITE);
|
||||
if (!region)
|
||||
return KResult(-ENOMEM);
|
||||
region->page_in();
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue