Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpvfs be friends with genfs



details:   https://anonhg.NetBSD.org/src/rev/a03f8dbdfad6
branches:  trunk
changeset: 758620:a03f8dbdfad6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Nov 11 15:05:54 2010 +0000

description:
be friends with genfs

diffstat:

 sys/rump/librump/rumpvfs/rumpfs.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r 403a5fc874d9 -r a03f8dbdfad6 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 14:50:58 2010 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 15:05:54 2010 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/atomic.h>
@@ -49,6 +49,7 @@
 #include <miscfs/fifofs/fifo.h>
 #include <miscfs/specfs/specdev.h>
 #include <miscfs/genfs/genfs.h>
+#include <miscfs/genfs/genfs_node.h>
 
 #include <rump/rumpuser.h>
 
@@ -138,7 +139,17 @@
        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 @@
        }
        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 @@
        mutex_enter(&reclock);
        rn->rn_vp = NULL;
        mutex_exit(&reclock);
+       genfs_node_destroy(vp);
        vp->v_data = NULL;
 
        if (rn->rn_flags & RUMPNODE_CANRECLAIM) {



Home | Main Index | Thread Index | Old Index