Source-Changes-HG archive

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

[src/trunk]: src/sys Use VFS_PROTOS() for deadfs. Rename dead_mount to dead_...



details:   https://anonhg.NetBSD.org/src/rev/91b9be5a71f6
branches:  trunk
changeset: 339042:91b9be5a71f6
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Jun 23 10:41:59 2015 +0000

description:
Use VFS_PROTOS() for deadfs.  Rename dead_mount to dead_rootmount.

diffstat:

 sys/kern/vfs_vnode.c            |  16 ++++++++--------
 sys/miscfs/deadfs/dead_vfsops.c |  24 ++++++++++++++++--------
 2 files changed, 24 insertions(+), 16 deletions(-)

diffs (113 lines):

diff -r 85e171caef39 -r 91b9be5a71f6 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c      Tue Jun 23 10:41:41 2015 +0000
+++ b/sys/kern/vfs_vnode.c      Tue Jun 23 10:41:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnode.c,v 1.43 2015/06/23 10:40:36 hannken Exp $   */
+/*     $NetBSD: vfs_vnode.c,v 1.44 2015/06/23 10:41:59 hannken Exp $   */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.43 2015/06/23 10:40:36 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.44 2015/06/23 10:41:59 hannken Exp $");
 
 #define _VFS_VNODE_PRIVATE
 
@@ -162,7 +162,6 @@
 u_int                  numvnodes               __cacheline_aligned;
 
 static pool_cache_t    vnode_cache             __read_mostly;
-static struct mount    *dead_mount;
 
 /*
  * There are two free lists: one is for vnodes which have no buffer/page
@@ -201,6 +200,7 @@
 static void            vwait(vnode_t *, int);
 
 /* Routines having to do with the management of the vnode table. */
+extern struct mount    *dead_rootmount;
 extern int             (**dead_vnodeop_p)(void *);
 extern struct vfsops   dead_vfsops;
 
@@ -213,9 +213,9 @@
            NULL, IPL_NONE, NULL, NULL, NULL);
        KASSERT(vnode_cache != NULL);
 
-       dead_mount = vfs_mountalloc(&dead_vfsops, NULL);
-       KASSERT(dead_mount != NULL);
-       dead_mount->mnt_iflag = IMNT_MPSAFE;
+       dead_rootmount = vfs_mountalloc(&dead_vfsops, NULL);
+       KASSERT(dead_rootmount != NULL);
+       dead_rootmount->mnt_iflag = IMNT_MPSAFE;
 
        mutex_init(&vnode_free_list_lock, MUTEX_DEFAULT, IPL_NONE);
        TAILQ_INIT(&vnode_free_list);
@@ -1032,8 +1032,8 @@
 
        /* Move to dead mount. */
        vp->v_vflag &= ~VV_ROOT;
-       atomic_inc_uint(&dead_mount->mnt_refcnt);
-       vfs_insmntque(vp, dead_mount);
+       atomic_inc_uint(&dead_rootmount->mnt_refcnt);
+       vfs_insmntque(vp, dead_rootmount);
 
        /* Done with purge, notify sleepers of the grim news. */
        mutex_enter(vp->v_interlock);
diff -r 85e171caef39 -r 91b9be5a71f6 sys/miscfs/deadfs/dead_vfsops.c
--- a/sys/miscfs/deadfs/dead_vfsops.c   Tue Jun 23 10:41:41 2015 +0000
+++ b/sys/miscfs/deadfs/dead_vfsops.c   Tue Jun 23 10:41:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dead_vfsops.c,v 1.2 2014/03/23 15:21:16 hannken Exp $  */
+/*     $NetBSD: dead_vfsops.c,v 1.3 2015/06/23 10:41:59 hannken Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,13 +30,19 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.2 2014/03/23 15:21:16 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.3 2015/06/23 10:41:59 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
 #include <sys/mount.h>
 
+#include <miscfs/specfs/specdev.h>
+
+VFS_PROTOS(dead);
+
+static void dead_panic(void);
+
 extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
 
 static const struct vnodeopv_desc * const dead_vnodeopv_descs[] = {
@@ -44,12 +50,7 @@
        NULL
 };
 
-static void
-dead_panic(void)
-{
-
-       panic("dead fs operation used");
-}
+struct mount *dead_rootmount;
 
 struct vfsops dead_vfsops = {
        .vfs_name = "dead",
@@ -76,3 +77,10 @@
        .vfs_fsync = (void *)eopnotsupp,
        .vfs_opv_descs = dead_vnodeopv_descs
 };
+
+static void
+dead_panic(void)
+{
+
+       panic("dead fs operation used");
+}



Home | Main Index | Thread Index | Old Index