summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2000-09-12 09:49:08 +0000
committerbp <bp@FreeBSD.org>2000-09-12 09:49:08 +0000
commita7bc78c86d1b25efbea8d9ad3e7354ef3a302e90 (patch)
treeae6a2a75d2b0d94e115a73fd536dca86dba92ac4 /sys/vm
parent7893328799a796677510cba9c7bbb8e52d8ce56c (diff)
downloadFreeBSD-src-a7bc78c86d1b25efbea8d9ad3e7354ef3a302e90.zip
FreeBSD-src-a7bc78c86d1b25efbea8d9ad3e7354ef3a302e90.tar.gz
Add three new VOPs: VOP_CREATEVOBJECT, VOP_DESTROYVOBJECT and VOP_GETVOBJECT.
They will be used by nullfs and other stacked filesystems to support full cache coherency. Reviewed in general by: mckusick, dillon
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_mmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 79b6b72..43d75a5 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -198,6 +198,7 @@ mmap(p, uap)
int disablexworkaround;
off_t pos;
struct vmspace *vms = p->p_vmspace;
+ vm_object_t obj;
addr = (vm_offset_t) uap->addr;
size = uap->len;
@@ -295,6 +296,14 @@ mmap(p, uap)
vp = (struct vnode *) fp->f_data;
if (vp->v_type != VREG && vp->v_type != VCHR)
return (EINVAL);
+ if (vp->v_type == VREG) {
+ /*
+ * Get the proper underlying object
+ */
+ if (VOP_GETVOBJECT(vp, &obj) != 0)
+ return (EINVAL);
+ vp = (struct vnode*)obj->handle;
+ }
/*
* XXX hack to handle use of /dev/zero to map anon memory (ala
* SunOS).
OpenPOWER on IntegriCloud