Add some stubs for lfs.

This commit is contained in:
pooka 2007-08-09 08:56:44 +00:00
parent 3de9f5d391
commit 2c3d0e9d16
7 changed files with 201 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: buffercache.c,v 1.1 2007/08/05 22:28:07 pooka Exp $ */
/* $NetBSD: buffercache.c,v 1.2 2007/08/09 08:56:44 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -34,9 +34,16 @@
#include <sys/buf.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/queue.h>
#include "rumpuser.h"
#define BQUEUES 3
struct bqueue {
TAILQ_HEAD(,buf) bq_queue;
uint64_t bq_bytes;
} bufqueues[BQUEUES];
int
bread(struct vnode *vp, daddr_t blkno, int size, struct kauth_cred *cred,
struct buf **bpp)
@ -141,18 +148,52 @@ struct buf *
getiobuf()
{
panic("%s: not implemented", __func__);
return rumpuser_malloc(sizeof(struct buf), 0);
}
struct buf *
getiobuf_nowait()
{
panic("%s: not implemented", __func__);
return rumpuser_malloc(sizeof(struct buf), 1);
}
void
putiobuf(struct buf *bp)
{
rumpuser_free(bp);
}
void
bgetvp(struct vnode *vp, struct buf *bp)
{
if (bp->b_vp)
panic("%s: vp already set", __func__);
bp->b_vp = vp;
}
void
bremfree(struct buf *bp)
{
return;
}
void
brelvp(struct buf *bp)
{
if (bp->b_vp == NULL)
panic("%s: vp not set", __func__);
bp->b_vp = NULL;
}
void
reassignbuf(struct buf *bp, struct vnode *vp)
{
panic("%s: not implemented", __func__);

View File

@ -1,4 +1,4 @@
/* $NetBSD: emul.c,v 1.4 2007/08/08 13:12:08 pooka Exp $ */
/* $NetBSD: emul.c,v 1.5 2007/08/09 08:56:44 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -39,6 +39,7 @@
#include <sys/device.h>
#include <sys/queue.h>
#include <sys/filedesc.h>
#include <sys/kthread.h>
#include <machine/cpu.h>
#include <machine/stdarg.h>
@ -52,6 +53,7 @@ kmutex_t proclist_mutex;
struct lwp lwp0;
struct vnode *rootvp;
struct device *root_device;
dev_t rootdev;
MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount struct");
MALLOC_DEFINE(M_UFSMNT, "UFS mount", "UFS mount structure");
@ -64,6 +66,12 @@ struct lwp *curlwp;
char hostname[MAXHOSTNAMELEN];
size_t hostnamelen;
u_long bufmem_valimit;
u_long bufmem_hiwater;
u_long bufmem_lowater;
u_long bufmem;
u_int nbuf;
void
panic(const char *fmt, ...)
{
@ -207,6 +215,13 @@ ltsleep(wchan_t ident, pri_t prio, const char *wmesg, int timo,
panic("%s: not implemented", __func__);
}
void
wakeup(wchan_t ident)
{
printf("%s: not implemented\n", __func__);
}
void
malloc_type_attach(struct malloc_type *type)
{
@ -245,9 +260,37 @@ microtime(struct timeval *tv)
rumpuser_gettimeofday(tv);
}
void
getmicrotime(struct timeval *tv)
{
rumpuser_gettimeofday(tv);
}
void
bdev_strategy(struct buf *bp)
{
panic("%s: not supported", __func__);
}
void
vn_syncer_remove_from_worklist(struct vnode *vp)
{
/* nada */
}
int
kthread_create(pri_t pri, int flags, struct cpu_info *ci,
void (*func)(void *), void *arg, lwp_t **newlp, const char *fmt, ...)
{
return 0;
}
void
workqueue_enqueue(struct workqueue *wq, struct work *wk0, struct cpu_info *ci)
{
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfs.c,v 1.6 2007/08/07 19:43:56 pooka Exp $ */
/* $NetBSD: genfs.c,v 1.7 2007/08/09 08:56:44 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -192,9 +192,17 @@ genfs_putpages(void *v)
voff_t a_offhi;
int a_flags;
} */ *ap = v;
return genfs_do_putpages(ap->a_vp, ap->a_offlo, ap->a_offhi,
ap->a_flags, NULL);
}
int
genfs_do_putpages(struct vnode *vp, off_t startoff, off_t endoff, int flags,
struct vm_page **busypg)
{
char databuf[MAXPHYS];
struct buf buf;
struct vnode *vp = ap->a_vp;
struct uvm_object *uobj = &vp->v_uobj;
struct vm_page *pg, *pg_next;
voff_t smallest = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock_stub.c,v 1.2 2007/08/07 17:55:49 pooka Exp $ */
/* $NetBSD: lock_stub.c,v 1.3 2007/08/09 08:56:45 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -30,6 +30,7 @@
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/rwlock.h>
/* oh sweet crackmgr, what would I do without you? */
int
@ -102,3 +103,27 @@ mutex_owned(kmutex_t *mtx)
return 1;
}
void
rw_init(krwlock_t *rw)
{
}
void
rw_destroy(krwlock_t *rw)
{
}
void
rw_enter(krwlock_t *rw, const krw_t op)
{
}
void
rw_exit(krwlock_t *rw)
{
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: misc_stub.c,v 1.1 2007/08/05 22:28:08 pooka Exp $ */
/* $NetBSD: misc_stub.c,v 1.2 2007/08/09 08:56:45 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -64,3 +64,10 @@ sysctl_notavail(SYSCTLFN_ARGS)
return EOPNOTSUPP;
}
int
sysctl_lookup(SYSCTLFN_ARGS)
{
return ENOSYS;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs.c,v 1.4 2007/08/08 14:09:07 pooka Exp $ */
/* $NetBSD: vfs.c,v 1.5 2007/08/09 08:56:45 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -134,6 +134,12 @@ vrele(struct vnode *vp)
}
void
vrele2(struct vnode *vp)
{
}
void
vput(struct vnode *vp)
{
@ -399,6 +405,13 @@ vfs_rootmountalloc(const char *fstypename, const char *devname,
panic("%s: not supported", __func__);
}
int
vfs_busy(struct mount *mp, int flags, struct simplelock *interlck)
{
return 0;
}
void
vfs_unbusy(struct mount *mp)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm.c,v 1.6 2007/08/07 19:40:17 pooka Exp $ */
/* $NetBSD: vm.c,v 1.7 2007/08/09 08:56:45 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -68,6 +68,7 @@ static int ubc_flags;
struct uvm_pagerops uvm_vnodeops;
struct uvm_pagerops aobj_pager;
struct uvmexp uvmexp;
struct uvm uvm;
struct vmspace rump_vmspace;
struct vm_map rump_vmmap;
@ -322,7 +323,9 @@ rumpvm_init()
uvm_vnodeops.pgo_put = vn_put;
aobj_pager.pgo_get = ao_get;
aobj_pager.pgo_put = ao_put;
uvmexp.free = 1024*1024; /* XXX */
uvm.pagedaemon_lwp = NULL; /* doesn't match curlwp */
}
void
@ -339,6 +342,57 @@ uvm_page_unbusy(struct vm_page **pgs, int npgs)
/* nada */
}
void
uvm_pagewire(struct vm_page *pg)
{
/* nada */
}
void
uvm_pageunwire(struct vm_page *pg)
{
/* nada */
}
vaddr_t
uvm_pagermapin(struct vm_page **pps, int npages, int flags)
{
panic("%s: unimplemented", __func__);
}
struct vm_page *
uvm_pagelookup(struct uvm_object *uobj, voff_t off)
{
return rumpvm_findpage(uobj, off);
}
void
uvm_estimatepageable(int *active, int *inactive)
{
*active = 0;
*inactive = 0;
panic("%s: unimplemented", __func__);
}
void
uvm_aio_biodone1(struct buf *bp)
{
panic("%s: unimplemented", __func__);
}
void
uvm_aio_biodone(struct buf *bp)
{
panic("%s: unimplemented", __func__);
}
void
uvm_vnp_setsize(struct vnode *vp, voff_t newsize)
{