From d542ce3403c1ed7d3a5b6319e0639e24a7078a6e Mon Sep 17 00:00:00 2001 From: pooka Date: Thu, 11 Nov 2010 15:05:54 +0000 Subject: [PATCH] be friends with genfs --- sys/rump/librump/rumpvfs/rumpfs.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/rump/librump/rumpvfs/rumpfs.c b/sys/rump/librump/rumpvfs/rumpfs.c index ea74b632e46a..15c754e6493b 100644 --- a/sys/rump/librump/rumpvfs/rumpfs.c +++ b/sys/rump/librump/rumpvfs/rumpfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $"); #include #include @@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $"); #include #include #include +#include #include @@ -138,7 +139,17 @@ struct rumpfs_dent { LIST_ENTRY(rumpfs_dent) rd_entries; }; +struct genfs_ops rumpfs_genfsops = { + .gop_size = genfs_size, + .gop_write = genfs_gop_write, + + /* optional */ + .gop_alloc = NULL, + .gop_markupdate = NULL, +}; + struct rumpfs_node { + struct genfs_node rn_gn; struct vattr rn_va; struct vnode *rn_vp; char *rn_hostpath; @@ -521,6 +532,7 @@ makevnode(struct mount *mp, struct rumpfs_node *rn, struct vnode **vpp) } vp->v_data = rn; + genfs_node_init(vp, &rumpfs_genfsops); vn_lock(vp, LK_RETRY | LK_EXCLUSIVE); mutex_enter(&reclock); rn->rn_vp = vp; @@ -1142,6 +1154,7 @@ rump_vop_reclaim(void *v) mutex_enter(&reclock); rn->rn_vp = NULL; mutex_exit(&reclock); + genfs_node_destroy(vp); vp->v_data = NULL; if (rn->rn_flags & RUMPNODE_CANRECLAIM) {