diff options
author | mdodd <mdodd@FreeBSD.org> | 2002-09-22 08:22:32 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2002-09-22 08:22:32 +0000 |
commit | 2ecda740f8b6d56c6faf3fe047467e2506ac5568 (patch) | |
tree | 31a63d92b0c80a622b84d31ed55878ddfd210d06 | |
parent | 491569a0a72f41a57e60f55bdf7a63bbe3bd6726 (diff) | |
download | FreeBSD-src-2ecda740f8b6d56c6faf3fe047467e2506ac5568.zip FreeBSD-src-2ecda740f8b6d56c6faf3fe047467e2506ac5568.tar.gz |
Modify vm_map_clean() (and thus the msync(2) system call) to support
invalidation of cached pages for objects of type OBJT_DEVICE.
Submitted by: Christian Zander <zander@minion.de>
Approved by: alc
-rw-r--r-- | sys/vm/vm_map.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 386acbc..f28271d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1920,16 +1920,19 @@ vm_map_clean( OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); - if (invalidate) { - /*vm_object_pip_wait(object, "objmcl");*/ - vm_object_page_remove(object, - OFF_TO_IDX(offset), - OFF_TO_IDX(offset + size + PAGE_MASK), - FALSE); - } VOP_UNLOCK(object->handle, 0, curthread); vm_object_deallocate(object); } + if (object && invalidate && + ((object->type == OBJT_VNODE) || + (object->type == OBJT_DEVICE))) { + vm_object_reference(object); + vm_object_page_remove(object, + OFF_TO_IDX(offset), + OFF_TO_IDX(offset + size + PAGE_MASK), + FALSE); + vm_object_deallocate(object); + } start += size; } |