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