summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-12-10 02:19:35 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-12-10 02:19:35 +0000
commitb1d070269012496fc9ea43ab62f9f6d4c6855c86 (patch)
treeaf8fabc460253582a3035edc55928b90b5ff6cf7 /sys/uvm
parentba38727131150bb5ee5ae61df8d315ded024e57d (diff)
Merge in struct uvm_vnode into struct vnode.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_bio.c6
-rw-r--r--sys/uvm/uvm_mmap.c3
-rw-r--r--sys/uvm/uvm_vnode.c68
-rw-r--r--sys/uvm/uvm_vnode.h60
4 files changed, 37 insertions, 100 deletions
diff --git a/sys/uvm/uvm_bio.c b/sys/uvm/uvm_bio.c
index ba119958317..f6ce9852451 100644
--- a/sys/uvm/uvm_bio.c
+++ b/sys/uvm/uvm_bio.c
@@ -262,12 +262,12 @@ again:
UVMHIST_LOG(ubchist, "slot_offset 0x%x writeoff 0x%x writelen 0x%x "
"u_size 0x%x", slot_offset, umap->writeoff, umap->writelen,
- vp->v_uvm.u_size);
+ vp->v_size);
if (access_type & VM_PROT_WRITE &&
slot_offset >= umap->writeoff &&
(slot_offset + PAGE_SIZE <= umap->writeoff + umap->writelen ||
- slot_offset + PAGE_SIZE >= vp->v_uvm.u_size - umap->offset)) {
+ slot_offset + PAGE_SIZE >= vp->v_size - umap->offset)) {
UVMHIST_LOG(ubchist, "setting PGO_OVERWRITE", 0,0,0,0);
flags |= PGO_OVERWRITE;
}
@@ -379,7 +379,7 @@ ubc_alloc(uobj, offset, lenp, flags)
UVMHIST_FUNC("ubc_alloc"); UVMHIST_CALLED(ubchist);
UVMHIST_LOG(ubchist, "uobj %p offset 0x%lx len 0x%lx filesize 0x%x",
- uobj, offset, *lenp, ((struct uvm_vnode *)uobj)->u_size);
+ uobj, offset, *lenp, ((struct vnode *)vp)->v_size);
umap_offset = (offset & ~((voff_t)ubc_winsize - 1));
slot_offset = (vaddr_t)(offset & ((voff_t)ubc_winsize - 1));
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 05c786f6666..8ff16e98351 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.31 2001/12/04 23:22:42 art Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.32 2001/12/10 02:19:34 art Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.55 2001/08/17 05:52:46 chs Exp $ */
/*
@@ -69,7 +69,6 @@
#include <uvm/uvm.h>
#include <uvm/uvm_device.h>
-#include <uvm/uvm_vnode.h>
/*
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index 67ccf7d605c..d58d0cf93f4 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_vnode.c,v 1.30 2001/12/06 12:43:20 art Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.31 2001/12/10 02:19:34 art Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.51 2001/08/17 05:53:02 chs Exp $ */
/*
@@ -66,7 +66,6 @@
#include <miscfs/specfs/specdev.h>
#include <uvm/uvm.h>
-#include <uvm/uvm_vnode.h>
/*
* functions
@@ -130,7 +129,7 @@ uvn_attach(arg, accessprot)
vm_prot_t accessprot;
{
struct vnode *vp = arg;
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_object *uobj = &vp->v_uobj;
struct vattr vattr;
int result;
struct partinfo pi;
@@ -143,13 +142,13 @@ uvn_attach(arg, accessprot)
/*
* first get a lock on the uvn.
*/
- simple_lock(&uvn->u_obj.vmobjlock);
- while (uvn->u_flags & VXLOCK) {
- uvn->u_flags |= VXWANT;
+ simple_lock(uobj->vmobjlock);
+ while (vp->v_flag & VXLOCK) {
+ vp->v_flag |= VXWANT;
UVMHIST_LOG(maphist, " SLEEPING on blocked vn",0,0,0,0);
- UVM_UNLOCK_AND_WAIT(uvn, &uvn->u_obj.vmobjlock, FALSE,
+ UVM_UNLOCK_AND_WAIT(vp, &uobj->vmobjlock, FALSE,
"uvn_attach", 0);
- simple_lock(&uvn->u_obj.vmobjlock);
+ simple_lock(&uobj->vmobjlock);
UVMHIST_LOG(maphist," WOKE UP",0,0,0,0);
}
@@ -157,7 +156,7 @@ uvn_attach(arg, accessprot)
* if we're mapping a BLK device, make sure it is a disk.
*/
if (vp->v_type == VBLK && bdevsw[major(vp->v_rdev)].d_type != D_DISK) {
- simple_unlock(&uvn->u_obj.vmobjlock);
+ simple_unlock(&uobj->vmobjlock);
UVMHIST_LOG(maphist,"<- done (VBLK not D_DISK!)", 0,0,0,0);
return(NULL);
}
@@ -167,10 +166,10 @@ uvn_attach(arg, accessprot)
* set up our idea of the size
* if this hasn't been done already.
*/
- if (uvn->u_size == VSIZENOTSET) {
+ if (vp->v_size == VSIZENOTSET) {
- uvn->u_flags |= VXLOCK;
- simple_unlock(&uvn->u_obj.vmobjlock); /* drop lock in case we sleep */
+ vp->v_flag |= VXLOCK;
+ simple_unlock(&uobj->vmobjlock); /* drop lock in case we sleep */
/* XXX: curproc? */
if (vp->v_type == VBLK) {
/*
@@ -195,26 +194,26 @@ uvn_attach(arg, accessprot)
}
/* relock object */
- simple_lock(&uvn->u_obj.vmobjlock);
+ simple_lock(&uobj->vmobjlock);
- if (uvn->u_flags & VXWANT)
- wakeup(uvn);
- uvn->u_flags &= ~(VXLOCK|VXWANT);
+ if (vp->v_flag & VXWANT)
+ wakeup(vp);
+ vp->v_flag &= ~(VXLOCK|VXWANT);
if (result != 0) {
- simple_unlock(&uvn->u_obj.vmobjlock); /* drop lock */
+ simple_unlock(&uobj->vmobjlock); /* drop lock */
UVMHIST_LOG(maphist,"<- done (VOP_GETATTR FAILED!)", 0,0,0,0);
return(NULL);
}
- uvn->u_size = used_vnode_size;
+ vp->v_size = used_vnode_size;
}
/* unlock and return */
- simple_unlock(&uvn->u_obj.vmobjlock);
+ simple_unlock(&uobj->vmobjlock);
UVMHIST_LOG(maphist,"<- done, refcnt=%d", uvn->u_obj.uo_refs,
0, 0, 0);
- return (&uvn->u_obj);
+ return (uobj);
}
@@ -378,7 +377,6 @@ uvn_flush(uobj, start, stop, flags)
voff_t start, stop;
int flags;
{
- struct uvm_vnode *uvn = (struct uvm_vnode *)uobj;
struct vnode *vp = (struct vnode *)uobj;
struct vm_page *pp, *ppnext, *ptmp;
struct vm_page *pps[256], **ppsp;
@@ -405,8 +403,8 @@ uvn_flush(uobj, start, stop, flags)
}
#ifdef DIAGNOSTIC
- if (uvn->u_size == VSIZENOTSET) {
- printf("uvn_flush: size not set vp %p\n", uvn);
+ if (vp->v_size == VSIZENOTSET) {
+ printf("uvn_flush: size not set vp %p\n", vp);
vprint("uvn_flush VSIZENOTSET", vp);
flags |= PGO_ALLPAGES;
}
@@ -770,9 +768,9 @@ uvn_flush(uobj, start, stop, flags)
vp->v_bioflag |= VBIOWAIT;
UVM_UNLOCK_AND_WAIT(&vp->v_numoutput,
- &uvn->u_obj.vmobjlock,
+ &uobj->vmobjlock,
FALSE, "uvn_flush",0);
- simple_lock(&uvn->u_obj.vmobjlock);
+ simple_lock(&uobj->vmobjlock);
}
splx(s);
}
@@ -798,10 +796,10 @@ uvn_cluster(uobj, offset, loffset, hoffset)
voff_t offset;
voff_t *loffset, *hoffset; /* OUT */
{
- struct uvm_vnode *uvn = (struct uvm_vnode *)uobj;
+ struct vnode *vp = (struct vnode *)uobj;
*loffset = offset;
- *hoffset = MIN(offset + MAXBSIZE, round_page(uvn->u_size));
+ *hoffset = MIN(offset + MAXBSIZE, round_page(vp->v_size));
}
/*
@@ -995,24 +993,24 @@ uvm_vnp_setsize(vp, newsize)
struct vnode *vp;
voff_t newsize;
{
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_object *uobj = &vp->v_uobj;
voff_t pgend = round_page(newsize);
UVMHIST_FUNC("uvm_vnp_setsize"); UVMHIST_CALLED(ubchist);
- simple_lock(&uvn->u_obj.vmobjlock);
+ simple_lock(&uobj->vmobjlock);
- UVMHIST_LOG(ubchist, "old 0x%x new 0x%x", uvn->u_size, newsize, 0,0);
+ UVMHIST_LOG(ubchist, "old 0x%x new 0x%x", vp->v_size, newsize, 0,0);
/*
* now check if the size has changed: if we shrink we had better
* toss some pages...
*/
- if (uvn->u_size > pgend && uvn->u_size != VSIZENOTSET) {
- (void) uvn_flush(&uvn->u_obj, pgend, 0, PGO_FREE);
+ if (vp->v_size > pgend && vp->v_size != VSIZENOTSET) {
+ (void) uvn_flush(uobj, pgend, 0, PGO_FREE);
}
- uvn->u_size = newsize;
- simple_unlock(&uvn->u_obj.vmobjlock);
+ vp->v_size = newsize;
+ simple_unlock(&uobj->vmobjlock);
}
/*
@@ -1034,7 +1032,7 @@ uvm_vnp_zerorange(vp, off, len)
while (len) {
vsize_t bytelen = len;
- win = ubc_alloc(&vp->v_uvm.u_obj, off, &bytelen, UBC_WRITE);
+ win = ubc_alloc(&vp->v_uobj, off, &bytelen, UBC_WRITE);
memset(win, 0, bytelen);
ubc_release(win, 0);
diff --git a/sys/uvm/uvm_vnode.h b/sys/uvm/uvm_vnode.h
deleted file mode 100644
index ce853189207..00000000000
--- a/sys/uvm/uvm_vnode.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $OpenBSD: uvm_vnode.h,v 1.9 2001/11/27 05:27:12 art Exp $ */
-/* $NetBSD: uvm_vnode.h,v 1.9 2000/03/26 20:54:48 kleink Exp $ */
-
-/*
- *
- * Copyright (c) 1997 Charles D. Cranor and Washington University.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Charles D. Cranor and
- * Washington University.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * from: Id: uvm_vnode.h,v 1.1.2.4 1997/10/03 21:18:24 chuck Exp
- */
-
-#ifndef _UVM_UVM_VNODE_H_
-#define _UVM_UVM_VNODE_H_
-
-/*
- * uvm_vnode.h
- *
- * vnode handle into the VM system.
- */
-
-/*
- * the uvm_vnode structure. put at the top of the vnode data structure.
- * this allows:
- * (struct vnode *) == (struct uvm_vnode *) == (struct uvm_object *)
- */
-
-struct uvm_vnode {
- struct uvm_object u_obj; /* the actual VM object */
- int u_flags; /* flags */
- int u_nio; /* number of running I/O requests */
- voff_t u_size; /* size of object */
-};
-
-#endif /* _UVM_UVM_VNODE_H_ */