Module Name: src
Committed By: riastradh
Date: Wed Oct 26 23:39:43 UTC 2022
Modified Files:
src/sys/kern: vfs_init.c vfs_subr.c vfs_trans.c vfs_vnode.c vnode_if.sh
src/sys/miscfs/deadfs: dead_vfsops.c dead_vnops.c
Added Files:
src/sys/miscfs/deadfs: deadfs.h
Log Message:
miscfs/deadfs/deadfs.h: New home for deadfs-related externs.
XXX regen sys/kern/vnode_if.c and the others
To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.495 -r1.496 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.76 -r1.77 src/sys/kern/vnode_if.sh
cvs rdiff -u -r1.12 -r1.13 src/sys/miscfs/deadfs/dead_vfsops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/miscfs/deadfs/dead_vnops.c
cvs rdiff -u -r0 -r1.1 src/sys/miscfs/deadfs/deadfs.h
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_init.c
diff -u src/sys/kern/vfs_init.c:1.55 src/sys/kern/vfs_init.c:1.56
--- src/sys/kern/vfs_init.c:1.55 Wed Oct 26 23:39:21 2022
+++ src/sys/kern/vfs_init.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $ */
+/* $NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $ */
/*-
* Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -85,6 +85,8 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v
#include <sys/sysctl.h>
#include <sys/kauth.h>
+#include <miscfs/deadfs/deadfs.h>
+
/*
* Sigh, such primitive tools are these...
*/
@@ -106,7 +108,6 @@ extern const struct vnodeop_desc * const
* associated with any particular file system, and thus cannot
* be initialized by vfs_attach().
*/
-extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.495 src/sys/kern/vfs_subr.c:1.496
--- src/sys/kern/vfs_subr.c:1.495 Tue Sep 13 09:13:19 2022
+++ src/sys/kern/vfs_subr.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.495 2022/09/13 09:13:19 riastradh Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.496 2022/10/26 23:39:43 riastradh Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008, 2019, 2020
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.495 2022/09/13 09:13:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.496 2022/10/26 23:39:43 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -96,8 +96,10 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v
#include <sys/kauth.h>
#include <sys/module.h>
+#include <miscfs/deadfs/deadfs.h>
#include <miscfs/genfs/genfs.h>
#include <miscfs/specfs/specdev.h>
+
#include <uvm/uvm_ddb.h>
const enum vtype iftovt_tab[16] = {
@@ -120,8 +122,6 @@ const int vttoif_tab[9] = {
int doforce = 1; /* 1 => permit forcible unmounting */
-extern struct mount *dead_rootmount;
-
/*
* Local declarations.
*/
Index: src/sys/kern/vfs_trans.c
diff -u src/sys/kern/vfs_trans.c:1.68 src/sys/kern/vfs_trans.c:1.69
--- src/sys/kern/vfs_trans.c:1.68 Mon Aug 22 09:13:08 2022
+++ src/sys/kern/vfs_trans.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_trans.c,v 1.68 2022/08/22 09:13:08 hannken Exp $ */
+/* $NetBSD: vfs_trans.c,v 1.69 2022/10/26 23:39:43 riastradh Exp $ */
/*-
* Copyright (c) 2007, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.68 2022/08/22 09:13:08 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.69 2022/10/26 23:39:43 riastradh Exp $");
/*
* File system transaction operations.
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,
#include <sys/proc.h>
#include <sys/pool.h>
+#include <miscfs/deadfs/deadfs.h>
#include <miscfs/specfs/specdev.h>
#define FSTRANS_MOUNT_HASHSIZE 32
@@ -124,8 +125,6 @@ static bool cow_state_change_done(const
static void cow_change_enter(struct fstrans_mount_info *);
static void cow_change_done(struct fstrans_mount_info *);
-extern struct mount *dead_rootmount;
-
/*
* Initialize.
*/
Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.145 src/sys/kern/vfs_vnode.c:1.146
--- src/sys/kern/vfs_vnode.c:1.145 Fri Aug 5 05:20:39 2022
+++ src/sys/kern/vfs_vnode.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.145 2022/08/05 05:20:39 thorpej Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.146 2022/10/26 23:39:43 riastradh Exp $ */
/*-
* Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -141,14 +141,14 @@
* Vnode is considered active, if reference count (vnode_t::v_usecount)
* is non-zero. It is maintained using: vref(9) and vrele(9), as well
* as vput(9), routines. Common points holding references are e.g.
- * file openings, current working directory, mount points, etc.
+ * file openings, current working directory, mount points, etc.
*
* v_usecount is adjusted with atomic operations, however to change
* from a non-zero value to zero the interlock must also be held.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.145 2022/08/05 05:20:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.146 2022/10/26 23:39:43 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@@ -176,6 +176,8 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,
#include <sys/wapbl.h>
#include <sys/fstrans.h>
+#include <miscfs/deadfs/deadfs.h>
+
#include <uvm/uvm.h>
#include <uvm/uvm_readahead.h>
#include <uvm/uvm_stat.h>
@@ -224,10 +226,7 @@ static void vnpanic(vnode_t *, const ch
__printflike(2, 3);
/* Routines having to do with the management of the vnode table. */
-extern struct mount *dead_rootmount;
-extern int (**dead_vnodeop_p)(void *);
extern int (**spec_vnodeop_p)(void *);
-extern struct vfsops dead_vfsops;
/*
* The high bit of v_usecount is a gate for vcache_tryvget(). It's set
@@ -1258,7 +1257,7 @@ vgone(vnode_t *vp)
lktype = LK_EXCLUSIVE;
mutex_enter(vp->v_interlock);
VSTATE_WAIT_STABLE(vp);
- if (VSTATE_GET(vp) == VS_LOADED) {
+ if (VSTATE_GET(vp) == VS_LOADED) {
VSTATE_CHANGE(vp, VS_LOADED, VS_BLOCKED);
vcache_reclaim(vp);
lktype = LK_NONE;
Index: src/sys/kern/vnode_if.sh
diff -u src/sys/kern/vnode_if.sh:1.76 src/sys/kern/vnode_if.sh:1.77
--- src/sys/kern/vnode_if.sh:1.76 Mon Jul 18 04:30:30 2022
+++ src/sys/kern/vnode_if.sh Wed Oct 26 23:39:43 2022
@@ -29,7 +29,7 @@ copyright="\
* SUCH DAMAGE.
*/
"
-SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.76 2022/07/18 04:30:30 thorpej Exp $'
+SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.77 2022/10/26 23:39:43 riastradh Exp $'
# Script to produce VFS front-end sugar.
#
@@ -361,6 +361,8 @@ echo '
if [ -z "${rump}" ] ; then
echo "
+#include <miscfs/deadfs/deadfs.h>
+
enum fst_op { FST_NO, FST_YES, FST_LAZY, FST_TRY };
static inline int
@@ -543,8 +545,6 @@ do { \\
#define vop_close_post(ap, e) \\
do { \\
- extern int (**dead_vnodeop_p)(void *); \\
- \\
/* See the definition of VN_KNOTE() in <sys/vnode.h>. */ \\
if (__predict_false(VN_KEVENT_INTEREST((ap)->a_vp, \\
NOTE_CLOSE_WRITE | NOTE_CLOSE) && (e) == 0)) { \\
Index: src/sys/miscfs/deadfs/dead_vfsops.c
diff -u src/sys/miscfs/deadfs/dead_vfsops.c:1.12 src/sys/miscfs/deadfs/dead_vfsops.c:1.13
--- src/sys/miscfs/deadfs/dead_vfsops.c:1.12 Fri Jul 8 07:44:17 2022
+++ src/sys/miscfs/deadfs/dead_vfsops.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: dead_vfsops.c,v 1.12 2022/07/08 07:44:17 hannken Exp $ */
+/* $NetBSD: dead_vfsops.c,v 1.13 2022/10/26 23:39:43 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,21 +30,20 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.12 2022/07/08 07:44:17 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.13 2022/10/26 23:39:43 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/vnode.h>
#include <sys/mount.h>
+#include <miscfs/deadfs/deadfs.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[] = {
&dead_vnodeop_opv_desc,
NULL
Index: src/sys/miscfs/deadfs/dead_vnops.c
diff -u src/sys/miscfs/deadfs/dead_vnops.c:1.66 src/sys/miscfs/deadfs/dead_vnops.c:1.67
--- src/sys/miscfs/deadfs/dead_vnops.c:1.66 Wed Oct 20 03:08:18 2021
+++ src/sys/miscfs/deadfs/dead_vnops.c Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: dead_vnops.c,v 1.66 2021/10/20 03:08:18 thorpej Exp $ */
+/* $NetBSD: dead_vnops.c,v 1.67 2022/10/26 23:39:43 riastradh Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.66 2021/10/20 03:08:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.67 2022/10/26 23:39:43 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: dead_vnops.c
#include <sys/buf.h>
#include <sys/proc.h>
+#include <miscfs/deadfs/deadfs.h>
#include <miscfs/genfs/genfs.h>
/*
@@ -69,7 +70,7 @@ int dead_default_error(void *);
int (**dead_vnodeop_p)(void *);
-const struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
+static const struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
{ &vop_default_desc, dead_default_error },
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
{ &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
Added files:
Index: src/sys/miscfs/deadfs/deadfs.h
diff -u /dev/null src/sys/miscfs/deadfs/deadfs.h:1.1
--- /dev/null Wed Oct 26 23:39:43 2022
+++ src/sys/miscfs/deadfs/deadfs.h Wed Oct 26 23:39:43 2022
@@ -0,0 +1,41 @@
+/* $NetBSD: deadfs.h,v 1.1 2022/10/26 23:39:43 riastradh Exp $ */
+
+/*-
+ * Copyright (c) 2022 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _MISCFS_DEADFS_DEADFS_H_
+#define _MISCFS_DEADFS_DEADFS_H_
+
+#include <sys/mount.h>
+#include <sys/vnode.h>
+
+extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
+extern int (**dead_vnodeop_p)(void *);
+
+extern struct vfsops dead_vfsops;
+extern struct mount *dead_rootmount;
+
+#endif /* _MISCFS_DEADFS_DEADFS_H_ */