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