Module Name: src Committed By: pooka Date: Wed Aug 5 00:04:08 UTC 2009
Modified Files: src/sys/rump/librump/rumpvfs: Makefile.rumpvfs vm_vfs.c Log Message: Use uvm_vnode.c instead of homerolled stuff. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpvfs/vm_vfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpvfs/Makefile.rumpvfs diff -u src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.10 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.11 --- src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.10 Mon Aug 3 16:22:00 2009 +++ src/sys/rump/librump/rumpvfs/Makefile.rumpvfs Wed Aug 5 00:04:08 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpvfs,v 1.10 2009/08/03 16:22:00 pooka Exp $ +# $NetBSD: Makefile.rumpvfs,v 1.11 2009/08/05 00:04:08 pooka Exp $ # .include "${RUMPTOP}/Makefile.rump" @@ -9,7 +9,7 @@ ${RUMPTOP}/../kern \ ${RUMPTOP}/../miscfs/genfs ${RUMPTOP}/../miscfs/syncfs \ ${RUMPTOP}/../miscfs/specfs ${RUMPTOP}/../miscfs/deadfs \ - ${RUMPTOP}/../compat/common + ${RUMPTOP}/../compat/common ${RUMPTOP}/../uvm # # Source modules, first the ones specifically implemented for librump. @@ -26,6 +26,9 @@ vfs_hooks.c vfs_init.c vfs_lockf.c vfs_lookup.c vfs_subr.c \ vfs_syscalls.c vfs_vnops.c vfs_wapbl.c vfs_xattr.c +# sys/uvm +SRCS+= uvm_vnode.c + # sys/miscfs/syncfs SRCS+= sync_subr.c sync_vnops.c Index: src/sys/rump/librump/rumpvfs/vm_vfs.c diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.7 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.8 --- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.7 Tue Aug 4 20:01:06 2009 +++ src/sys/rump/librump/rumpvfs/vm_vfs.c Wed Aug 5 00:04:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_vfs.c,v 1.7 2009/08/04 20:01:06 pooka Exp $ */ +/* $NetBSD: vm_vfs.c,v 1.8 2009/08/05 00:04:08 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.7 2009/08/04 20:01:06 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.8 2009/08/05 00:04:08 pooka Exp $"); #include <sys/param.h> @@ -39,52 +39,6 @@ #include <uvm/uvm.h> #include <uvm/uvm_readahead.h> -static int vn_get(struct uvm_object *, voff_t, struct vm_page **, - int *, int, vm_prot_t, int, int); -static int vn_put(struct uvm_object *, voff_t, voff_t, int); - -const struct uvm_pagerops uvm_vnodeops = { - .pgo_get = vn_get, - .pgo_put = vn_put, -}; - -/* - * vnode pager - */ - -static int -vn_get(struct uvm_object *uobj, voff_t off, struct vm_page **pgs, - int *npages, int centeridx, vm_prot_t access_type, - int advice, int flags) -{ - struct vnode *vp = (struct vnode *)uobj; - - return VOP_GETPAGES(vp, off, pgs, npages, centeridx, access_type, - advice, flags); -} - -static int -vn_put(struct uvm_object *uobj, voff_t offlo, voff_t offhi, int flags) -{ - struct vnode *vp = (struct vnode *)uobj; - - return VOP_PUTPAGES(vp, offlo, offhi, flags); -} - -void -uvm_aio_biodone1(struct buf *bp) -{ - - panic("%s: unimplemented", __func__); -} - -void -uvm_aio_biodone(struct buf *bp) -{ - - uvm_aio_aiodone(bp); -} - /* * release resources held during async io. this is almost the * same as uvm_aio_aiodone() from uvm_pager.c and only lacks the @@ -117,46 +71,46 @@ kmem_free(pgs, npages * sizeof(*pgs)); } -struct uvm_ractx * -uvm_ra_allocctx(void) +void +uvm_aio_biodone1(struct buf *bp) { - return NULL; + panic("%s: unimplemented", __func__); } void -uvm_ra_freectx(struct uvm_ractx *ra) +uvm_aio_biodone(struct buf *bp) { - return; + uvm_aio_aiodone(bp); } -bool -uvn_clean_p(struct uvm_object *uobj) +struct uvm_ractx * +uvm_ra_allocctx(void) { - struct vnode *vp = (void *)uobj; - return (vp->v_iflag & VI_ONWORKLST) == 0; + return NULL; } void -uvm_vnp_setsize(struct vnode *vp, voff_t newsize) +uvm_ra_request(struct uvm_ractx *ra, int advice, struct uvm_object *uobj, + off_t reqoff, size_t reqsize) { - mutex_enter(&vp->v_interlock); - vp->v_size = vp->v_writesize = newsize; - mutex_exit(&vp->v_interlock); + return; } void -uvm_vnp_setwritesize(struct vnode *vp, voff_t newsize) +uvm_ra_freectx(struct uvm_ractx *ra) { - mutex_enter(&vp->v_interlock); - vp->v_writesize = newsize; - mutex_exit(&vp->v_interlock); + return; } +/* + * UBC + */ + void uvm_vnp_zerorange(struct vnode *vp, off_t off, size_t len) { @@ -194,10 +148,6 @@ return; } -/* - * UBC - */ - /* dumdidumdum */ #define len2npages(off, len) \ (((((len) + PAGE_MASK) & ~(PAGE_MASK)) >> PAGE_SHIFT) \