From 874f013517ffdfe671b963e792c867bb47c90405 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Fri, 30 Jul 2004 11:08:02 +0000 Subject: [PATCH] Fix handling of msync(2) for character special files. Submitted by: nvidia --- sys/vm/vm_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index feb13aa0b871..d2b1e0531d62 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1023,10 +1023,12 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, } if ((object->type == OBJT_VNODE || object->type == OBJT_DEVICE) && invalidate) { + boolean_t purge; + purge = old_msync || (object->type == OBJT_DEVICE); vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), - old_msync ? FALSE : TRUE); + purge ? FALSE : TRUE); } VM_OBJECT_UNLOCK(object); }