lfs_extern.h revision 1.13 1 /* $NetBSD: lfs_extern.h,v 1.13 1999/03/10 00:20:00 perseant Exp $ */
2
3 /*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Konrad E. Schroder <perseant (at) hhhh.org>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38 /*-
39 * Copyright (c) 1991, 1993, 1994
40 * The Regents of the University of California. All rights reserved.
41 *
42 * Redistribution and use in source and binary forms, with or without
43 * modification, are permitted provided that the following conditions
44 * are met:
45 * 1. Redistributions of source code must retain the above copyright
46 * notice, this list of conditions and the following disclaimer.
47 * 2. Redistributions in binary form must reproduce the above copyright
48 * notice, this list of conditions and the following disclaimer in the
49 * documentation and/or other materials provided with the distribution.
50 * 3. All advertising materials mentioning features or use of this software
51 * must display the following acknowledgement:
52 * This product includes software developed by the University of
53 * California, Berkeley and its contributors.
54 * 4. Neither the name of the University nor the names of its contributors
55 * may be used to endorse or promote products derived from this software
56 * without specific prior written permission.
57 *
58 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
59 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 *
70 * @(#)lfs_extern.h 8.6 (Berkeley) 5/8/95
71 */
72
73 /*
74 * Sysctl values for LFS.
75 */
76 #define LFS_WRITEINDIR 1 /* flush indirect blocks on non-checkpoint writes */
77 #define LFS_CLEAN_VNHEAD 2 /* put prev unrefed cleaned vnodes on head of free list */
78 #define LFS_DOSTATS 3
79 #define LFS_STATS 4
80 #define LFS_MAXID 5
81
82 #define LFS_NAMES { \
83 { 0, 0 }, \
84 { "flushindir", CTLTYPE_INT }, \
85 { "clean_vnhead", CTLTYPE_INT }, \
86 { "dostats", CTLTYPE_INT }, \
87 { "stats", CTLTYPE_STRUCT }, \
88 }
89
90 struct fid;
91 struct mount;
92 struct nameidata;
93 struct proc;
94 struct statfs;
95 struct timeval;
96 struct inode;
97 struct uio;
98 struct mbuf;
99 struct dinode;
100 struct buf;
101 struct vnode;
102 struct lfs;
103 struct segment;
104 struct ucred;
105
106 extern struct pool lfs_inode_pool; /* memory pool for inodes */
107
108 __BEGIN_DECLS
109 /* lfs_alloc.c */
110 int lfs_vcreate __P((struct mount *, ino_t, struct vnode **));
111
112
113 /* lfs_balloc.c */
114 int lfs_balloc __P((struct vnode *, int, u_long, ufs_daddr_t, struct buf **));
115
116 /* lfs_bio.c */
117 int lfs_bwrite_ext __P((struct buf *, int));
118 void lfs_flush __P((struct lfs *, int));
119 int lfs_check __P((struct vnode *, ufs_daddr_t, int));
120 void lfs_freebuf __P((struct buf *));
121 void lfs_countlocked __P((int *, long *));
122
123 /* lfs_cksum.c */
124 u_long cksum __P((void *, size_t));
125 u_long lfs_sb_cksum __P((struct dlfs *));
126
127 /* lfs_debug.c */
128 #ifdef DEBUG
129 void lfs_dump_super __P((struct lfs *));
130 void lfs_dump_dinode __P((struct dinode *));
131 void lfs_check_bpp __P((struct lfs *, struct segment *, char *, int));
132 void lfs_check_segsum __P((struct lfs *, struct segment *, char *, int));
133 #endif /* DEBUG */
134
135 /* lfs_inode.c */
136 void lfs_init __P((void));
137 struct dinode *lfs_ifind __P((struct lfs *, ino_t, struct dinode *));
138
139 /* lfs_segment.c */
140 void lfs_imtime __P((struct lfs *));
141 int lfs_vflush __P((struct vnode *));
142 int lfs_writevnodes __P((struct lfs *, struct mount *, struct segment *, int));
143 int lfs_segwrite __P((struct mount *, int));
144 void lfs_writefile __P((struct lfs *, struct segment *, struct vnode *));
145 int lfs_writeinode __P((struct lfs *, struct segment *, struct inode *));
146 int lfs_gatherblock __P((struct segment *, struct buf *, int *));
147 int lfs_gather __P((struct lfs *, struct segment *, struct vnode *, int (*match )__P ((struct lfs *, struct buf *))));
148 void lfs_updatemeta __P((struct segment *));
149 int lfs_initseg __P((struct lfs *));
150 void lfs_newseg __P((struct lfs *));
151 int lfs_writeseg __P((struct lfs *, struct segment *));
152 void lfs_writesuper __P((struct lfs *, daddr_t));
153 int lfs_match_data __P((struct lfs *, struct buf *));
154 int lfs_match_indir __P((struct lfs *, struct buf *));
155 int lfs_match_dindir __P((struct lfs *, struct buf *));
156 int lfs_match_tindir __P((struct lfs *, struct buf *));
157 struct buf *lfs_newbuf __P((struct vnode *, ufs_daddr_t, size_t));
158 void lfs_callback __P((struct buf *));
159 void lfs_supercallback __P((struct buf *));
160 void lfs_shellsort __P((struct buf **, ufs_daddr_t *, int));
161 int lfs_vref __P((struct vnode *));
162 void lfs_vunref __P((struct vnode *));
163 void lfs_vunref_head __P((struct vnode *));
164
165 /* lfs_subr.c */
166 void lfs_seglock __P((struct lfs *, unsigned long));
167 void lfs_segunlock __P((struct lfs *));
168
169 /* lfs_syscalls.c */
170 int lfs_fastvget __P((struct mount *, ino_t, ufs_daddr_t, struct vnode **, struct dinode *, int *));
171 struct buf *lfs_fakebuf __P((struct vnode *, int, size_t, caddr_t));
172
173 /* lfs_vfsops.c */
174 int lfs_mountroot __P((void));
175 int lfs_mount __P((struct mount *, const char *, void *, struct nameidata *, struct proc *));
176 int lfs_mountfs __P((struct vnode *, struct mount *, struct proc *));
177 int lfs_unmount __P((struct mount *, int, struct proc *));
178 int lfs_statfs __P((struct mount *, struct statfs *, struct proc *));
179 int lfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
180 int lfs_vget __P((struct mount *, ino_t, struct vnode **));
181 int lfs_fhtovp __P((struct mount *, struct fid *, struct vnode **));
182 int lfs_vptofh __P((struct vnode *, struct fid *));
183 int lfs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
184 struct proc *));
185
186
187 int lfs_valloc __P((void *));
188 int lfs_vfree __P((void *));
189 int lfs_bwrite __P((void *));
190 int lfs_update __P((void *));
191 int lfs_truncate __P((void *));
192 int lfs_blkatoff __P((void *));
193 int lfs_fsync __P((void *));
194 int lfs_symlink __P((void *));
195 int lfs_mknod __P((void *));
196 int lfs_create __P((void *));
197 int lfs_mkdir __P((void *));
198 int lfs_read __P((void *));
199 int lfs_remove __P((void *));
200 int lfs_rmdir __P((void *));
201 int lfs_link __P((void *));
202 int lfs_rename __P((void *));
203 int lfs_getattr __P((void *));
204 int lfs_close __P((void *));
205 int lfs_inactive __P((void *));
206 int lfs_reclaim __P((void *));
207 int lfs_write __P((void *));
208 int lfs_whiteout __P((void *));
209
210 __END_DECLS
211 extern int lfs_mount_type;
212 extern int (**lfs_vnodeop_p) __P((void *));
213 extern int (**lfs_specop_p) __P((void *));
214 extern int (**lfs_fifoop_p) __P((void *));
215