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

This commit is contained in:
hannken 2015-06-23 10:41:59 +00:00
parent c32755f978
commit 142e4ca539
2 changed files with 24 additions and 16 deletions

View File

@ -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 char *, ...)
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);

View File

@ -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 * const dead_vnodeopv_descs[] = {
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");
}