aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2013-08-04 21:07:24 +0000
committerAttilio Rao <attilio@FreeBSD.org>2013-08-04 21:07:24 +0000
commit3b6714cacb30c4ded64d5580426cf7acc9dfcd32 (patch)
tree66d78aa520f99833b11e6eca180f8fa7216b21f8 /sys/kern/sys_process.c
parentb9fdaa9b19b3382d087c564ed1661f7581d7155e (diff)
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 5508dcff15fb..33fac71c3f01 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -263,6 +263,7 @@ proc_rwmem(struct proc *p, struct uio *uio)
writing = uio->uio_rw == UIO_WRITE;
reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ;
fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL;
+ fault_flags |= VM_FAULT_IOBUSY;
/*
* Only map in one page at a time. We don't have to, but it
@@ -287,9 +288,9 @@ proc_rwmem(struct proc *p, struct uio *uio)
len = min(PAGE_SIZE - page_offset, uio->uio_resid);
/*
- * Fault and hold the page on behalf of the process.
+ * Fault and busy the page on behalf of the process.
*/
- error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m);
+ error = vm_fault_handle(map, pageno, reqprot, fault_flags, &m);
if (error != KERN_SUCCESS) {
if (error == KERN_RESOURCE_SHORTAGE)
error = ENOMEM;
@@ -315,9 +316,9 @@ proc_rwmem(struct proc *p, struct uio *uio)
/*
* Release the page.
*/
- vm_page_lock(m);
- vm_page_unhold(m);
- vm_page_unlock(m);
+ VM_OBJECT_WLOCK(m->object);
+ vm_page_io_finish(m);
+ VM_OBJECT_WUNLOCK(m->object);
} while (error == 0 && uio->uio_resid > 0);