mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-27 05:21:08 +01:00
Use MAP_NOSYNC for vnodes without any links in their filesystem.
This is necessary for vmware: it does not use an anonymous mmap for the memory of the virtual system. In stead it creates a temp file an unlinks it. For a 50 MB file, this results in a ot of syncing every 30 seconds. Reviewed by: Matthew Dillon <dillon@backplane.com>
This commit is contained in:
parent
0f9183be1b
commit
00d76afede
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55351
@ -1024,6 +1024,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
|
||||
return (error);
|
||||
objsize = round_page(vat.va_size);
|
||||
type = OBJT_VNODE;
|
||||
/*
|
||||
* if it is a regular file without any references
|
||||
* we do not need to sync it.
|
||||
*/
|
||||
if (vp->v_type == VREG && vat.va_nlink == 0) {
|
||||
flags |= MAP_NOSYNC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user