xref: /netbsd-src/sys/ufs/ext2fs/ext2fs_extern.h (revision 3b435a73967be44dfb4a27315acd72bfacde430c)
1 /*	$NetBSD: ext2fs_extern.h,v 1.7 1999/02/26 23:44:48 wrstuden Exp $	*/
2 
3 /*-
4  * Copyright (c) 1997 Manuel Bouyer.
5  * Copyright (c) 1991, 1993, 1994
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. All advertising materials mentioning features or use of this software
17  *    must display the following acknowledgement:
18  *	This product includes software developed by the University of
19  *	California, Berkeley and its contributors.
20  * 4. Neither the name of the University nor the names of its contributors
21  *    may be used to endorse or promote products derived from this software
22  *    without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  *	@(#)ffs_extern.h	8.3 (Berkeley) 4/16/94
37  * Modified for ext2fs by Manuel Bouyer.
38  */
39 
40 struct buf;
41 struct fid;
42 struct m_ext2fs;
43 struct inode;
44 struct mount;
45 struct nameidata;
46 struct proc;
47 struct statfs;
48 struct timeval;
49 struct ucred;
50 struct ufsmount;
51 struct uio;
52 struct vnode;
53 struct mbuf;
54 struct componentname;
55 
56 extern struct pool ext2fs_inode_pool;		/* memory pool for inodes */
57 
58 __BEGIN_DECLS
59 
60 /* ext2fs_alloc.c */
61 int ext2fs_alloc __P((struct inode *, ufs_daddr_t, ufs_daddr_t , struct ucred *,
62 		   ufs_daddr_t *));
63 int ext2fs_realloccg __P((struct inode *, ufs_daddr_t, ufs_daddr_t, int, int ,
64 			  struct ucred *, struct buf **));
65 int ext2fs_reallocblks __P((void *));
66 int ext2fs_valloc __P((void *));
67 ufs_daddr_t ext2fs_blkpref __P((struct inode *, ufs_daddr_t, int, ufs_daddr_t *));
68 void ext2fs_blkfree __P((struct inode *, ufs_daddr_t));
69 int ext2fs_vfree __P((void *));
70 
71 /* ext2fs_balloc.c */
72 int ext2fs_balloc __P((struct inode *, ufs_daddr_t, int, struct ucred *,
73 			struct buf **, int));
74 
75 /* ext2fs_bmap.c */
76 int ext2fs_bmap __P((void *));
77 
78 /* ext2fs_inode.c */
79 void ext2fs_init __P((void));
80 int ext2fs_update __P((void *));
81 int ext2fs_truncate __P((void *));
82 int ext2fs_inactive __P((void *));
83 
84 /* ext2fs_lookup.c */
85 int ext2fs_readdir __P((void *));
86 int ext2fs_lookup  __P((void *));
87 int ext2fs_direnter __P((struct inode *, struct vnode *,
88 									struct componentname *));
89 int ext2fs_dirremove __P((struct vnode *, struct componentname *));
90 int ext2fs_dirrewrite __P((struct inode *, struct inode *,
91 								struct componentname *));
92 int ext2fs_dirempty __P((struct inode *, ino_t, struct ucred *));
93 int ext2fs_checkpath __P((struct inode *, struct inode *, struct ucred *));
94 
95 /* ext2fs_subr.c */
96 int ext2fs_blkatoff __P((void *));
97 void ext2fs_fragacct __P((struct m_ext2fs *, int, int32_t[], int));
98 #ifdef DIAGNOSTIC
99 void	ext2fs_checkoverlap __P((struct buf *, struct inode *));
100 #endif
101 
102 /* ext2fs_vfsops.c */
103 int ext2fs_mountroot __P((void));
104 int ext2fs_mount __P((struct mount *, const char *, void *, struct nameidata *,
105 		   struct proc *));
106 int ext2fs_reload __P((struct mount *, struct ucred *, struct proc *));
107 int ext2fs_mountfs __P((struct vnode *, struct mount *, struct proc *));
108 int ext2fs_unmount __P((struct mount *, int, struct proc *));
109 int ext2fs_flushfiles __P((struct mount *, int, struct proc *));
110 int ext2fs_statfs __P((struct mount *, struct statfs *, struct proc *));
111 int ext2fs_sync __P((struct mount *, int, struct ucred *, struct proc *));
112 int ext2fs_vget __P((struct mount *, ino_t, struct vnode **));
113 int ext2fs_fhtovp __P((struct mount *, struct fid *, struct vnode **));
114 int ext2fs_vptofh __P((struct vnode *, struct fid *));
115 int ext2fs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
116 		       struct proc *));
117 int ext2fs_sbupdate __P((struct ufsmount *, int));
118 int ext2fs_cgupdate __P((struct ufsmount *, int));
119 
120 /* ext2fs_readwrite.c */
121 int ext2fs_read __P((void *));
122 int ext2fs_write __P((void *));
123 
124 /* ext2fs_vnops.c */
125 int ext2fs_create __P((void *));
126 int ext2fs_mknod __P((void *));
127 int ext2fs_open __P((void *));
128 int ext2fs_access __P((void *));
129 int ext2fs_getattr __P((void *));
130 int ext2fs_setattr __P((void *));
131 int ext2fs_remove __P((void *));
132 int ext2fs_link __P((void *));
133 int ext2fs_rename __P((void *));
134 int ext2fs_mkdir __P((void *));
135 int ext2fs_rmdir __P((void *));
136 int ext2fs_symlink __P((void *));
137 int ext2fs_readlink __P((void *));
138 int ext2fs_advlock __P((void *));
139 int ext2fs_vinit __P(( struct mount *, int (**specops) __P((void *)),
140 					   int (**fifoops) __P((void *)), struct vnode **));
141 int ext2fs_makeinode __P((int, struct vnode *, struct vnode **,
142 						  struct componentname *cnp));
143 int ext2fs_reclaim __P((void *));
144 
145 #define ext2fs_fsync genfs_fsync
146 __END_DECLS
147 
148 #define IS_EXT2_VNODE(vp)   (vp->v_tag == VT_EXT2FS)
149 
150 extern int (**ext2fs_vnodeop_p) __P((void *));
151 extern int (**ext2fs_specop_p) __P((void *));
152 extern int (**ext2fs_fifoop_p) __P((void *));
153 
154