Source-Changes-HG archive

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

[src/trunk]: src/sys/coda Attach the control object vnode to the coda mount a...



details:   https://anonhg.NetBSD.org/src/rev/9f3006e1b315
branches:  trunk
changeset: 805021:9f3006e1b315
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sat Dec 13 15:57:46 2014 +0000

description:
Attach the control object vnode to the coda mount and release it
on unmount.  Initialize special files with NODEV.

diffstat:

 sys/coda/coda_subr.c   |  11 ++++-------
 sys/coda/coda_vfsops.c |  12 ++++--------
 sys/coda/coda_vnops.c  |  10 +++++++---
 3 files changed, 15 insertions(+), 18 deletions(-)

diffs (131 lines):

diff -r e68c6960bda8 -r 9f3006e1b315 sys/coda/coda_subr.c
--- a/sys/coda/coda_subr.c      Sat Dec 13 15:51:18 2014 +0000
+++ b/sys/coda/coda_subr.c      Sat Dec 13 15:57:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $  */
+/*     $NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $   */
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -228,6 +228,8 @@
 
        for (hash = 0; hash < CODA_CACHESIZE; hash++) {
                for (cp = coda_cache[hash]; cp != NULL; cp = CNODE_NEXT(cp)) {
+                       if (IS_CTL_VP(CTOV(cp)))
+                               continue;
                        if (CTOV(cp)->v_mount == whoIam) {
 #ifdef DEBUG
                                printf("coda_kill: vp %p, cp %p\n", CTOV(cp), cp);
@@ -302,11 +304,6 @@
        for (hash = 0; hash < CODA_CACHESIZE; hash++) {
                for (cp = coda_cache[hash]; cp != NULL; cp = CNODE_NEXT(cp)) {
                        if (CTOV(cp)->v_mount == whoIam) {
-                               if (cp->c_flags & (C_LOCKED|C_WANTED)) {
-                                       printf("coda_unmounting: Unlocking %p\n", cp);
-                                       cp->c_flags &= ~(C_LOCKED|C_WANTED);
-                                       wakeup((void *) cp);
-                               }
                                cp->c_flags |= C_UNMOUNTING;
                        }
                }
diff -r e68c6960bda8 -r 9f3006e1b315 sys/coda/coda_vfsops.c
--- a/sys/coda/coda_vfsops.c    Sat Dec 13 15:51:18 2014 +0000
+++ b/sys/coda/coda_vfsops.c    Sat Dec 13 15:57:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_vfsops.c,v 1.81 2014/04/16 18:55:17 maxv Exp $    */
+/*     $NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $ */
 
 /*
  *
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.81 2014/04/16 18:55:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $");
 
 #ifndef _KERNEL_OPT
 #define        NVCODA 4
@@ -264,12 +264,7 @@
     rtvp = CTOV(cp);
     rtvp->v_vflag |= VV_ROOT;
 
-/*  cp = make_coda_node(&ctlfid, vfsp, VCHR);
-    The above code seems to cause a loop in the cnode links.
-    I don't totally understand when it happens, it is caught
-    when closing down the system.
- */
-    cp = make_coda_node(&ctlfid, 0, VCHR);
+    cp = make_coda_node(&ctlfid, vfsp, VCHR);
 
     coda_ctlvp = CTOV(cp);
 
@@ -325,6 +320,7 @@
        mi->mi_started = 0;
 
        vrele(mi->mi_rootvp);
+       vrele(coda_ctlvp);
 
        active = coda_kill(vfsp, NOT_DOWNCALL);
        mi->mi_rootvp->v_vflag &= ~VV_ROOT;
diff -r e68c6960bda8 -r 9f3006e1b315 sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c     Sat Dec 13 15:51:18 2014 +0000
+++ b/sys/coda/coda_vnops.c     Sat Dec 13 15:57:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_vnops.c,v 1.98 2014/10/18 08:33:27 snj Exp $      */
+/*     $NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $  */
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.98 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -64,6 +64,7 @@
 #include <sys/kauth.h>
 
 #include <miscfs/genfs/genfs.h>
+#include <miscfs/specfs/specdev.h>
 
 #include <coda/coda.h>
 #include <coda/cnode.h>
@@ -836,6 +837,7 @@
 
     if (IS_CTL_VP(vp)) {
        MARK_INT_SAT(CODA_INACTIVE_STATS);
+       VOP_UNLOCK(vp);
        return 0;
     }
 
@@ -1844,6 +1846,8 @@
        vp->v_data = cp;
        vp->v_type = type;
        cp->c_vnode = vp;
+       if (type == VCHR || type == VBLK)
+               spec_node_init(vp, NODEV);
        uvm_vnp_setsize(vp, 0);
        coda_save(cp);
 
@@ -2014,7 +2018,7 @@
 #ifdef CODA_VERBOSE
                printf("%s: control object %p\n", __func__, vp);
 #endif
-               return(EINVAL);
+               return 0;
        }
 
        /*



Home | Main Index | Thread Index | Old Index