mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:32:43 +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
					
				
					 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
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling