diff --git a/sys/rump/fs/lib/libp2k/p2k.c b/sys/rump/fs/lib/libp2k/p2k.c index 1658203b930a..918c9a8a10c5 100644 --- a/sys/rump/fs/lib/libp2k/p2k.c +++ b/sys/rump/fs/lib/libp2k/p2k.c @@ -1,4 +1,4 @@ -/* $NetBSD: p2k.c,v 1.3 2007/08/07 21:24:40 pooka Exp $ */ +/* $NetBSD: p2k.c,v 1.4 2007/08/08 14:09:07 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -240,7 +240,9 @@ p2k_node_lookup(struct puffs_cc *pcc, void *opc, struct puffs_newinfo *pni, { struct componentname *cn; struct vnode *vp; - struct vattr va; + enum vtype vtype; + voff_t vsize; + dev_t rdev; int rv; cn = P2K_MAKECN(pcn); @@ -252,17 +254,11 @@ p2k_node_lookup(struct puffs_cc *pcc, void *opc, struct puffs_newinfo *pni, return rv; } - rv = VOP_GETATTR(vp, &va, NULL, curlwp); - /* XXX: "unlookup" */ - if (rv) { - warn("%s: lookup succesful but failed GETATTR", __func__); - abort(); - } - puffs_newinfo_setcookie(pni, vp); - puffs_newinfo_setvtype(pni, va.va_type); - puffs_newinfo_setsize(pni, va.va_size); - puffs_newinfo_setrdev(pni, va.va_rdev); + rump_getvninfo(vp, &vtype, &vsize, &rdev); + puffs_newinfo_setvtype(pni, vtype); + puffs_newinfo_setsize(pni, vsize); + puffs_newinfo_setrdev(pni, rdev); return 0; } diff --git a/sys/rump/librump/rumpkern/rump.c b/sys/rump/librump/rumpkern/rump.c index 831d4c1fabca..c92424e65870 100644 --- a/sys/rump/librump/rumpkern/rump.c +++ b/sys/rump/librump/rumpkern/rump.c @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.3 2007/08/07 20:40:53 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.4 2007/08/08 14:09:07 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -38,6 +38,8 @@ #include +#include + #include "rump.h" #include "rumpuser.h" @@ -200,3 +202,15 @@ rump_fakeblk_deregister(const char *path) LIST_REMOVE(fblk, entries); rumpuser_free(fblk); } + +void +rump_getvninfo(struct vnode *vp, enum vtype *vtype, voff_t *vsize, dev_t *vdev) +{ + + *vtype = vp->v_type; + *vsize = vp->v_size; + if (vp->v_specinfo) + *vdev = vp->v_rdev; + else + *vdev = 0; +} diff --git a/sys/rump/librump/rumpkern/rump.h b/sys/rump/librump/rumpkern/rump.h index 93a811c2322e..1793e76f6c75 100644 --- a/sys/rump/librump/rumpkern/rump.h +++ b/sys/rump/librump/rumpkern/rump.h @@ -1,4 +1,4 @@ -/* $NetBSD: rump.h,v 1.4 2007/08/07 19:40:17 pooka Exp $ */ +/* $NetBSD: rump.h,v 1.5 2007/08/08 14:09:07 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -67,6 +67,8 @@ int rump_recyclenode(struct vnode *); int rump_ubc_magic_uiomove(size_t, struct uio *); int rump_vopwrite_fault(struct vnode *, voff_t, size_t, kauth_cred_t); +void rump_getvninfo(struct vnode *, enum vtype *, voff_t *, dev_t *); + int rump_fakeblk_register(const char *); int rump_fakeblk_find(const char *); void rump_fakeblk_deregister(const char *); diff --git a/sys/rump/librump/rumpkern/vfs.c b/sys/rump/librump/rumpkern/vfs.c index 5b08c5d700d4..47eabf50369c 100644 --- a/sys/rump/librump/rumpkern/vfs.c +++ b/sys/rump/librump/rumpkern/vfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs.c,v 1.3 2007/08/07 21:23:19 pooka Exp $ */ +/* $NetBSD: vfs.c,v 1.4 2007/08/08 14:09:07 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -96,6 +96,8 @@ void rump_putnode(struct vnode *vp) { + if (vp->v_specinfo) + rumpuser_free(vp->v_specinfo); rumpuser_free(vp); } @@ -405,10 +407,13 @@ vfs_unbusy(struct mount *mp) } struct vnode * -checkalias(struct vnode *nvp, dev_t ndvp_rdev, struct mount *mp) +checkalias(struct vnode *nvp, dev_t nvp_rdev, struct mount *mp) { /* Can this cause any funnies? */ + + nvp->v_specinfo = rumpuser_malloc(sizeof(struct specinfo), 0); + nvp->v_rdev = nvp_rdev; return NULLVP; }