Source-Changes-HG archive

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

[src/trunk]: src/sys miscfs/deadfs/deadfs.h: New home for deadfs-related exte...



details:   https://anonhg.NetBSD.org/src/rev/f075c2c8dc86
branches:  trunk
changeset: 372078:f075c2c8dc86
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Oct 26 23:39:43 2022 +0000

description:
miscfs/deadfs/deadfs.h: New home for deadfs-related externs.

XXX regen sys/kern/vnode_if.c and the others

diffstat:

 sys/kern/vfs_init.c             |   7 ++++---
 sys/kern/vfs_subr.c             |   8 ++++----
 sys/kern/vfs_trans.c            |   7 +++----
 sys/kern/vfs_vnode.c            |  13 ++++++-------
 sys/kern/vnode_if.sh            |   6 +++---
 sys/miscfs/deadfs/dead_vfsops.c |   7 +++----
 sys/miscfs/deadfs/dead_vnops.c  |   7 ++++---
 sys/miscfs/deadfs/deadfs.h      |  41 +++++++++++++++++++++++++++++++++++++++++
 8 files changed, 68 insertions(+), 28 deletions(-)

diffs (truncated from 306 to 300 lines):

diff -r c0a073e33078 -r f075c2c8dc86 sys/kern/vfs_init.c
--- a/sys/kern/vfs_init.c       Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/kern/vfs_init.c       Wed Oct 26 23:39:43 2022 +0000
@@ -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 @@
 #include <sys/sysctl.h>
 #include <sys/kauth.h>
 
+#include <miscfs/deadfs/deadfs.h>
+
 /*
  * Sigh, such primitive tools are these...
  */
@@ -106,7 +108,6 @@
  * 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;
 
diff -r c0a073e33078 -r f075c2c8dc86 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/kern/vfs_subr.c       Wed Oct 26 23:39:43 2022 +0000
@@ -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 @@
 #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 @@
 
 int doforce = 1;               /* 1 => permit forcible unmounting */
 
-extern struct mount *dead_rootmount;
-
 /*
  * Local declarations.
  */
diff -r c0a073e33078 -r f075c2c8dc86 sys/kern/vfs_trans.c
--- a/sys/kern/vfs_trans.c      Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/kern/vfs_trans.c      Wed Oct 26 23:39:43 2022 +0000
@@ -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 @@
 #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 void cow_change_enter(struct fstrans_mount_info *);
 static void cow_change_done(struct fstrans_mount_info *);
 
-extern struct mount *dead_rootmount;
-
 /*
  * Initialize.
  */
diff -r c0a073e33078 -r f075c2c8dc86 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c      Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/kern/vfs_vnode.c      Wed Oct 26 23:39:43 2022 +0000
@@ -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 @@
 #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 @@
     __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 @@
        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;
diff -r c0a073e33078 -r f075c2c8dc86 sys/kern/vnode_if.sh
--- a/sys/kern/vnode_if.sh      Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/kern/vnode_if.sh      Wed Oct 26 23:39:43 2022 +0000
@@ -29,7 +29,7 @@
  * 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 @@
 
 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 @@
 
 #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)) {              \\
diff -r c0a073e33078 -r f075c2c8dc86 sys/miscfs/deadfs/dead_vfsops.c
--- a/sys/miscfs/deadfs/dead_vfsops.c   Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/miscfs/deadfs/dead_vfsops.c   Wed Oct 26 23:39:43 2022 +0000
@@ -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
diff -r c0a073e33078 -r f075c2c8dc86 sys/miscfs/deadfs/dead_vnops.c
--- a/sys/miscfs/deadfs/dead_vnops.c    Wed Oct 26 23:39:21 2022 +0000
+++ b/sys/miscfs/deadfs/dead_vnops.c    Wed Oct 26 23:39:43 2022 +0000
@@ -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 @@
 #include <sys/buf.h>
 #include <sys/proc.h>
 
+#include <miscfs/deadfs/deadfs.h>
 #include <miscfs/genfs/genfs.h>
 
 /*
@@ -69,7 +70,7 @@
 
 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 */
diff -r c0a073e33078 -r f075c2c8dc86 sys/miscfs/deadfs/deadfs.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/miscfs/deadfs/deadfs.h        Wed Oct 26 23:39:43 2022 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index