summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-05-06 05:45:57 +0000
committeralc <alc@FreeBSD.org>2002-05-06 05:45:57 +0000
commitd60a525036422ccbba23ce156a0a31a69aa7ebbb (patch)
tree8750eed2fb1169b9dac9c1c7e15f630aca3a5177 /sys
parentbfe0870a5677e80b9c46e2321657e424a6a20614 (diff)
downloadFreeBSD-src-d60a525036422ccbba23ce156a0a31a69aa7ebbb.zip
FreeBSD-src-d60a525036422ccbba23ce156a0a31a69aa7ebbb.tar.gz
o Condition the compilation and use of vm_freeze_copyopts()
on ENABLE_VFS_IOOPT.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c3
-rw-r--r--sys/vm/vm_fault.c3
-rw-r--r--sys/vm/vm_object.c11
-rw-r--r--sys/vm/vnode_pager.c2
4 files changed, 16 insertions, 3 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index cf8a5a0..c9a0e6f 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -473,12 +473,13 @@ WRITE(ap)
if ((ioflag & IO_SYNC) && !DOINGASYNC(vp))
flags = B_SYNC;
+#ifdef ENABLE_VFS_IOOPT
if (object && (object->flags & OBJ_OPT)) {
vm_freeze_copyopts(object,
OFF_TO_IDX(uio->uio_offset),
OFF_TO_IDX(uio->uio_offset + uio->uio_resid + PAGE_MASK));
}
-
+#endif
for (error = 0; uio->uio_resid > 0;) {
lbn = lblkno(fs, uio->uio_offset);
blkoffset = blkoff(fs, uio->uio_offset);
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index b86a469..9cfe1ce 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -276,12 +276,13 @@ RetryFault:;
fs.vp = vnode_pager_lock(fs.first_object);
vm_object_pip_add(fs.first_object, 1);
+#ifdef ENABLE_VFS_IOOPT
if ((fault_type & VM_PROT_WRITE) &&
(fs.first_object->type == OBJT_VNODE)) {
vm_freeze_copyopts(fs.first_object,
fs.first_pindex, fs.first_pindex + 1);
}
-
+#endif
fs.lookup_still_valid = TRUE;
if (wired)
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index e6da475..352ad2f 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -401,7 +401,9 @@ vm_object_vndeallocate(vm_object_t object)
object->ref_count--;
if (object->ref_count == 0) {
vp->v_flag &= ~VTEXT;
+#ifdef ENABLE_VFS_IOOPT
vm_object_clear_flag(object, OBJ_OPT);
+#endif
}
/*
* vrele may need a vop lock
@@ -496,8 +498,10 @@ doterm:
if (temp) {
TAILQ_REMOVE(&temp->shadow_head, object, shadow_list);
temp->shadow_count--;
+#ifdef ENABLE_VFS_IOOPT
if (temp->ref_count == 0)
vm_object_clear_flag(temp, OBJ_OPT);
+#endif
temp->generation++;
object->backing_object = NULL;
}
@@ -547,11 +551,12 @@ vm_object_terminate(vm_object_t object)
if (object->type == OBJT_VNODE) {
struct vnode *vp;
+#ifdef ENABLE_VFS_IOOPT
/*
* Freeze optimized copies.
*/
vm_freeze_copyopts(object, 0, object->size);
-
+#endif
/*
* Clean pages and flush buffers.
*/
@@ -1783,7 +1788,10 @@ vm_object_set_writeable_dirty(vm_object_t object)
}
}
+#ifdef ENABLE_VFS_IOOPT
/*
+ * Experimental support for zero-copy I/O
+ *
* Performs the copy_on_write operations necessary to allow the virtual copies
* into user space to work. This has to be called for write(2) system calls
* from other processes, file unlinking, and file size shrinkage.
@@ -1859,6 +1867,7 @@ vm_freeze_copyopts(vm_object_t object, vm_pindex_t froma, vm_pindex_t toa)
vm_object_clear_flag(object, OBJ_OPT);
}
+#endif
#include "opt_ddb.h"
#ifdef DDB
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 46c7cef..d650594 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -291,7 +291,9 @@ vnode_pager_setsize(vp, nsize)
* File has shrunk. Toss any cached pages beyond the new EOF.
*/
if (nsize < object->un_pager.vnp.vnp_size) {
+#ifdef ENABLE_VFS_IOOPT
vm_freeze_copyopts(object, OFF_TO_IDX(nsize), object->size);
+#endif
if (nobjsize < object->size) {
vm_object_page_remove(object, nobjsize, object->size,
FALSE);
OpenPOWER on IntegriCloud