Module Name: src
Committed By: hannken
Date: Tue Jun 23 10:41:59 UTC 2015
Modified Files:
src/sys/kern: vfs_vnode.c
src/sys/miscfs/deadfs: dead_vfsops.c
Log Message:
Use VFS_PROTOS() for deadfs. Rename dead_mount to dead_rootmount.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.2 -r1.3 src/sys/miscfs/deadfs/dead_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.43 src/sys/kern/vfs_vnode.c:1.44
--- src/sys/kern/vfs_vnode.c:1.43 Tue Jun 23 10:40:36 2015
+++ src/sys/kern/vfs_vnode.c Tue Jun 23 10:41:59 2015
@@ -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 @@ struct vcache_node {
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 vnpanic(vnode_t *, const ch
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 @@ vfs_vnode_sysinit(void)
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 @@ vclean(vnode_t *vp)
/* 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);
Index: src/sys/miscfs/deadfs/dead_vfsops.c
diff -u src/sys/miscfs/deadfs/dead_vfsops.c:1.2 src/sys/miscfs/deadfs/dead_vfsops.c:1.3
--- src/sys/miscfs/deadfs/dead_vfsops.c:1.2 Sun Mar 23 15:21:16 2014
+++ src/sys/miscfs/deadfs/dead_vfsops.c Tue Jun 23 10:41:59 2015
@@ -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 @@ static const struct vnodeopv_desc * cons
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 @@ struct vfsops dead_vfsops = {
.vfs_fsync = (void *)eopnotsupp,
.vfs_opv_descs = dead_vnodeopv_descs
};
+
+static void
+dead_panic(void)
+{
+
+ panic("dead fs operation used");
+}