Sat Jan 23 16:02:09 2016 UTC ()
protect more kernel stuff.


(christos)
diff -r1.257 -r1.258 src/sys/sys/vnode.h
diff -r1.16 -r1.17 src/sys/sys/wapbl.h

cvs diff -r1.257 -r1.258 src/sys/sys/vnode.h (expand / switch to unified diff)

--- src/sys/sys/vnode.h 2016/01/22 22:43:25 1.257
+++ src/sys/sys/vnode.h 2016/01/23 16:02:09 1.258
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vnode.h,v 1.257 2016/01/22 22:43:25 dholland Exp $ */ 1/* $NetBSD: vnode.h,v 1.258 2016/01/23 16:02:09 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -58,33 +58,35 @@ @@ -58,33 +58,35 @@
58 */ 58 */
59 59
60#ifndef _SYS_VNODE_H_ 60#ifndef _SYS_VNODE_H_
61#define _SYS_VNODE_H_ 61#define _SYS_VNODE_H_
62 62
63#include <sys/event.h> 63#include <sys/event.h>
64#include <sys/queue.h> 64#include <sys/queue.h>
65#include <sys/condvar.h> 65#include <sys/condvar.h>
66#include <sys/rwlock.h> 66#include <sys/rwlock.h>
67#include <sys/mutex.h> 67#include <sys/mutex.h>
68#include <sys/time.h> 68#include <sys/time.h>
69 69
70/* XXX: clean up includes later */ 70/* XXX: clean up includes later */
 71#if defined(_KERNEL) || defined(_KMEMUSER)
71#include <uvm/uvm_param.h> /* XXX */ 72#include <uvm/uvm_param.h> /* XXX */
72#include <uvm/uvm_pglist.h> /* XXX */ 73#include <uvm/uvm_pglist.h> /* XXX */
73#include <uvm/uvm_object.h> /* XXX */ 74#include <uvm/uvm_object.h> /* XXX */
74#include <uvm/uvm_extern.h> /* XXX */ 75#include <uvm/uvm_extern.h> /* XXX */
75 76
76struct namecache; 77struct namecache;
77struct uvm_ractx; 78struct uvm_ractx;
 79#endif
78 80
79/* 81/*
80 * The vnode is the focus of all file activity in UNIX. There is a 82 * The vnode is the focus of all file activity in UNIX. There is a
81 * unique vnode allocated for each active file, each current directory, 83 * unique vnode allocated for each active file, each current directory,
82 * each mounted-on file, text file, and the root. 84 * each mounted-on file, text file, and the root.
83 */ 85 */
84 86
85/* 87/*
86 * Vnode types. VNON means no type. 88 * Vnode types. VNON means no type.
87 */ 89 */
88enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD }; 90enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
89 91
90#define VNODE_TYPES \ 92#define VNODE_TYPES \
@@ -102,26 +104,27 @@ enum vtagtype { @@ -102,26 +104,27 @@ enum vtagtype {
102 VT_FILECORE, VT_NTFS, VT_VFS, VT_OVERLAY, VT_SMBFS, VT_PTYFS, 104 VT_FILECORE, VT_NTFS, VT_VFS, VT_OVERLAY, VT_SMBFS, VT_PTYFS,
103 VT_TMPFS, VT_UDF, VT_SYSVBFS, VT_PUFFS, VT_HFS, VT_EFS, VT_ZFS, 105 VT_TMPFS, VT_UDF, VT_SYSVBFS, VT_PUFFS, VT_HFS, VT_EFS, VT_ZFS,
104 VT_RUMP, VT_NILFS, VT_V7FS, VT_CHFS 106 VT_RUMP, VT_NILFS, VT_V7FS, VT_CHFS
105}; 107};
106 108
107#define VNODE_TAGS \ 109#define VNODE_TAGS \
108 "VT_NON", "VT_UFS", "VT_NFS", "VT_MFS", "VT_MSDOSFS", "VT_LFS", "VT_LOFS", \ 110 "VT_NON", "VT_UFS", "VT_NFS", "VT_MFS", "VT_MSDOSFS", "VT_LFS", "VT_LOFS", \
109 "VT_FDESC", "VT_PORTAL", "VT_NULL", "VT_UMAP", "VT_KERNFS", "VT_PROCFS", \ 111 "VT_FDESC", "VT_PORTAL", "VT_NULL", "VT_UMAP", "VT_KERNFS", "VT_PROCFS", \
110 "VT_AFS", "VT_ISOFS", "VT_UNION", "VT_ADOSFS", "VT_EXT2FS", "VT_CODA", \ 112 "VT_AFS", "VT_ISOFS", "VT_UNION", "VT_ADOSFS", "VT_EXT2FS", "VT_CODA", \
111 "VT_FILECORE", "VT_NTFS", "VT_VFS", "VT_OVERLAY", "VT_SMBFS", "VT_PTYFS", \ 113 "VT_FILECORE", "VT_NTFS", "VT_VFS", "VT_OVERLAY", "VT_SMBFS", "VT_PTYFS", \
112 "VT_TMPFS", "VT_UDF", "VT_SYSVBFS", "VT_PUFFS", "VT_HFS", "VT_EFS", \ 114 "VT_TMPFS", "VT_UDF", "VT_SYSVBFS", "VT_PUFFS", "VT_HFS", "VT_EFS", \
113 "VT_ZFS", "VT_RUMP", "VT_NILFS", "VT_V7FS", "VT_CHFS" 115 "VT_ZFS", "VT_RUMP", "VT_NILFS", "VT_V7FS", "VT_CHFS"
114 116
 117#if defined(_KERNEL) || defined(_KMEMUSER)
115struct vnode; 118struct vnode;
116struct buf; 119struct buf;
117 120
118LIST_HEAD(buflists, buf); 121LIST_HEAD(buflists, buf);
119TAILQ_HEAD(vnodelst, vnode); 122TAILQ_HEAD(vnodelst, vnode);
120 123
121/* 124/*
122 * Reading or writing any of these items requires holding the appropriate 125 * Reading or writing any of these items requires holding the appropriate
123 * lock. Field markings and the corresponding locks: 126 * lock. Field markings and the corresponding locks:
124 * 127 *
125 * : stable, reference to the vnode is required 128 * : stable, reference to the vnode is required
126 * f vnode_free_list_lock, or vrele_lock for vrele_list 129 * f vnode_free_list_lock, or vrele_lock for vrele_list
127 * i v_interlock 130 * i v_interlock
@@ -170,26 +173,27 @@ struct vnode { @@ -170,26 +173,27 @@ struct vnode {
170 void *v_data; /* :: private data for fs */ 173 void *v_data; /* :: private data for fs */
171 struct klist v_klist; /* i: notes attached to vnode */ 174 struct klist v_klist; /* i: notes attached to vnode */
172}; 175};
173#define v_usecount v_uobj.uo_refs 176#define v_usecount v_uobj.uo_refs
174#define v_interlock v_uobj.vmobjlock 177#define v_interlock v_uobj.vmobjlock
175#define v_mountedhere v_un.vu_mountedhere 178#define v_mountedhere v_un.vu_mountedhere
176#define v_socket v_un.vu_socket 179#define v_socket v_un.vu_socket
177#define v_specnode v_un.vu_specnode 180#define v_specnode v_un.vu_specnode
178#define v_fifoinfo v_un.vu_fifoinfo 181#define v_fifoinfo v_un.vu_fifoinfo
179#define v_ractx v_un.vu_ractx 182#define v_ractx v_un.vu_ractx
180 183
181typedef struct vnodelst vnodelst_t; 184typedef struct vnodelst vnodelst_t;
182typedef struct vnode vnode_t; 185typedef struct vnode vnode_t;
 186#endif
183 187
184/* 188/*
185 * Vnode flags. The first set are locked by vnode lock or are stable. 189 * Vnode flags. The first set are locked by vnode lock or are stable.
186 * VSYSTEM is only used to skip vflush()ing quota files. VISTTY is used 190 * VSYSTEM is only used to skip vflush()ing quota files. VISTTY is used
187 * when reading dead vnodes. 191 * when reading dead vnodes.
188 */ 192 */
189#define VV_ROOT 0x00000001 /* root of its file system */ 193#define VV_ROOT 0x00000001 /* root of its file system */
190#define VV_SYSTEM 0x00000002 /* vnode being used by kernel */ 194#define VV_SYSTEM 0x00000002 /* vnode being used by kernel */
191#define VV_ISTTY 0x00000004 /* vnode represents a tty */ 195#define VV_ISTTY 0x00000004 /* vnode represents a tty */
192#define VV_MAPPED 0x00000008 /* vnode might have user mappings */ 196#define VV_MAPPED 0x00000008 /* vnode might have user mappings */
193#define VV_MPSAFE 0x00000010 /* file system code is MP safe */ 197#define VV_MPSAFE 0x00000010 /* file system code is MP safe */
194#define VV_LOCKSWORK 0x00000020 /* FS supports locking discipline */ 198#define VV_LOCKSWORK 0x00000020 /* FS supports locking discipline */
195 199

cvs diff -r1.16 -r1.17 src/sys/sys/wapbl.h (expand / switch to unified diff)

--- src/sys/sys/wapbl.h 2014/09/05 05:42:50 1.16
+++ src/sys/sys/wapbl.h 2016/01/23 16:02:09 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: wapbl.h,v 1.16 2014/09/05 05:42:50 matt Exp $ */ 1/* $NetBSD: wapbl.h,v 1.17 2016/01/23 16:02:09 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003,2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wasabi Systems, Inc. 8 * by Wasabi Systems, Inc.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,29 @@ @@ -24,27 +24,29 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _SYS_WAPBL_H 32#ifndef _SYS_WAPBL_H
33#define _SYS_WAPBL_H 33#define _SYS_WAPBL_H
34 34
35#include <sys/mutex.h> 35#include <sys/mutex.h>
36 36
 37#if defined(_KERNEL) || defined(_KMEMUSER)
37#include <miscfs/specfs/specdev.h> 38#include <miscfs/specfs/specdev.h>
 39#endif
38 40
39/* This header file describes the api and data structures for 41/* This header file describes the api and data structures for
40 * write ahead physical block logging (WAPBL) support. 42 * write ahead physical block logging (WAPBL) support.
41 */ 43 */
42 44
43#if defined(_KERNEL_OPT) 45#if defined(_KERNEL_OPT)
44#include "opt_wapbl.h" 46#include "opt_wapbl.h"
45#endif 47#endif
46 48
47#ifdef WAPBL_DEBUG 49#ifdef WAPBL_DEBUG
48#ifndef WAPBL_DEBUG_PRINT 50#ifndef WAPBL_DEBUG_PRINT
49#define WAPBL_DEBUG_PRINT (WAPBL_PRINT_REPLAY | WAPBL_PRINT_OPEN) 51#define WAPBL_DEBUG_PRINT (WAPBL_PRINT_REPLAY | WAPBL_PRINT_OPEN)
50#endif 52#endif