diff options
| author | Guido van Rooij <guido@FreeBSD.org> | 2000-01-03 19:13:53 +0000 |
|---|---|---|
| committer | Guido van Rooij <guido@FreeBSD.org> | 2000-01-03 19:13:53 +0000 |
| commit | 00d76afededcbc8a271ccb6ebdf42347b69a670c (patch) | |
| tree | 2f4a327fdcaa80814dc02e97238348392547507e | |
| parent | 0f9183be1b9f736d991a5b138efe559c9897e815 (diff) | |
Notes
| -rw-r--r-- | sys/vm/vm_mmap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 1721fd3e1bac..bb106f3d0094 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -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; + } } } |
