xref: /minix3/sys/ufs/ext2fs/ext2fs_extern.h (revision d65f6f70097893d1dfe5e389f081f247bf3df183)
1*d65f6f70SBen Gras /*	$NetBSD: ext2fs_extern.h,v 1.43 2011/07/12 16:59:48 dholland Exp $	*/
2*d65f6f70SBen Gras 
3*d65f6f70SBen Gras /*-
4*d65f6f70SBen Gras  * Copyright (c) 1991, 1993, 1994
5*d65f6f70SBen Gras  *	The Regents of the University of California.  All rights reserved.
6*d65f6f70SBen Gras  *
7*d65f6f70SBen Gras  * Redistribution and use in source and binary forms, with or without
8*d65f6f70SBen Gras  * modification, are permitted provided that the following conditions
9*d65f6f70SBen Gras  * are met:
10*d65f6f70SBen Gras  * 1. Redistributions of source code must retain the above copyright
11*d65f6f70SBen Gras  *    notice, this list of conditions and the following disclaimer.
12*d65f6f70SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
13*d65f6f70SBen Gras  *    notice, this list of conditions and the following disclaimer in the
14*d65f6f70SBen Gras  *    documentation and/or other materials provided with the distribution.
15*d65f6f70SBen Gras  * 3. Neither the name of the University nor the names of its contributors
16*d65f6f70SBen Gras  *    may be used to endorse or promote products derived from this software
17*d65f6f70SBen Gras  *    without specific prior written permission.
18*d65f6f70SBen Gras  *
19*d65f6f70SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20*d65f6f70SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*d65f6f70SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*d65f6f70SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23*d65f6f70SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*d65f6f70SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25*d65f6f70SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26*d65f6f70SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27*d65f6f70SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28*d65f6f70SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29*d65f6f70SBen Gras  * SUCH DAMAGE.
30*d65f6f70SBen Gras  *
31*d65f6f70SBen Gras  *	@(#)ffs_extern.h	8.3 (Berkeley) 4/16/94
32*d65f6f70SBen Gras  * Modified for ext2fs by Manuel Bouyer.
33*d65f6f70SBen Gras  */
34*d65f6f70SBen Gras 
35*d65f6f70SBen Gras /*-
36*d65f6f70SBen Gras  * Copyright (c) 1997 Manuel Bouyer.
37*d65f6f70SBen Gras  *
38*d65f6f70SBen Gras  * Redistribution and use in source and binary forms, with or without
39*d65f6f70SBen Gras  * modification, are permitted provided that the following conditions
40*d65f6f70SBen Gras  * are met:
41*d65f6f70SBen Gras  * 1. Redistributions of source code must retain the above copyright
42*d65f6f70SBen Gras  *    notice, this list of conditions and the following disclaimer.
43*d65f6f70SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
44*d65f6f70SBen Gras  *    notice, this list of conditions and the following disclaimer in the
45*d65f6f70SBen Gras  *    documentation and/or other materials provided with the distribution.
46*d65f6f70SBen Gras  *
47*d65f6f70SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
48*d65f6f70SBen Gras  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49*d65f6f70SBen Gras  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
50*d65f6f70SBen Gras  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
51*d65f6f70SBen Gras  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
52*d65f6f70SBen Gras  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53*d65f6f70SBen Gras  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54*d65f6f70SBen Gras  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55*d65f6f70SBen Gras  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
56*d65f6f70SBen Gras  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57*d65f6f70SBen Gras  *
58*d65f6f70SBen Gras  *	@(#)ffs_extern.h	8.3 (Berkeley) 4/16/94
59*d65f6f70SBen Gras  * Modified for ext2fs by Manuel Bouyer.
60*d65f6f70SBen Gras  */
61*d65f6f70SBen Gras 
62*d65f6f70SBen Gras #ifndef _UFS_EXT2FS_EXT2FS_EXTERN_H_
63*d65f6f70SBen Gras #define _UFS_EXT2FS_EXT2FS_EXTERN_H_
64*d65f6f70SBen Gras 
65*d65f6f70SBen Gras struct buf;
66*d65f6f70SBen Gras struct fid;
67*d65f6f70SBen Gras struct m_ext2fs;
68*d65f6f70SBen Gras struct inode;
69*d65f6f70SBen Gras struct mount;
70*d65f6f70SBen Gras struct nameidata;
71*d65f6f70SBen Gras struct lwp;
72*d65f6f70SBen Gras struct proc;
73*d65f6f70SBen Gras struct statvfs;
74*d65f6f70SBen Gras struct timeval;
75*d65f6f70SBen Gras struct ufsmount;
76*d65f6f70SBen Gras struct uio;
77*d65f6f70SBen Gras struct vnode;
78*d65f6f70SBen Gras struct mbuf;
79*d65f6f70SBen Gras struct componentname;
80*d65f6f70SBen Gras 
81*d65f6f70SBen Gras extern struct pool ext2fs_inode_pool;		/* memory pool for inodes */
82*d65f6f70SBen Gras extern struct pool ext2fs_dinode_pool;		/* memory pool for dinodes */
83*d65f6f70SBen Gras 
84*d65f6f70SBen Gras #define	EXT2FS_ITIMES(ip, acc, mod, cre) \
85*d65f6f70SBen Gras 	while ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY)) \
86*d65f6f70SBen Gras 		ext2fs_itimes(ip, acc, mod, cre)
87*d65f6f70SBen Gras 
88*d65f6f70SBen Gras __BEGIN_DECLS
89*d65f6f70SBen Gras 
90*d65f6f70SBen Gras /* ext2fs_alloc.c */
91*d65f6f70SBen Gras int ext2fs_alloc(struct inode *, daddr_t, daddr_t , kauth_cred_t,
92*d65f6f70SBen Gras 		   daddr_t *);
93*d65f6f70SBen Gras int ext2fs_realloccg(struct inode *, daddr_t, daddr_t, int, int ,
94*d65f6f70SBen Gras 			  kauth_cred_t, struct buf **);
95*d65f6f70SBen Gras int ext2fs_valloc(struct vnode *, int, kauth_cred_t, struct vnode **);
96*d65f6f70SBen Gras /* XXX ondisk32 */
97*d65f6f70SBen Gras daddr_t ext2fs_blkpref(struct inode *, daddr_t, int, int32_t *);
98*d65f6f70SBen Gras void ext2fs_blkfree(struct inode *, daddr_t);
99*d65f6f70SBen Gras int ext2fs_vfree(struct vnode *, ino_t, int);
100*d65f6f70SBen Gras 
101*d65f6f70SBen Gras /* ext2fs_balloc.c */
102*d65f6f70SBen Gras int ext2fs_balloc(struct inode *, daddr_t, int, kauth_cred_t,
103*d65f6f70SBen Gras 			struct buf **, int);
104*d65f6f70SBen Gras int ext2fs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
105*d65f6f70SBen Gras 
106*d65f6f70SBen Gras /* ext2fs_bmap.c */
107*d65f6f70SBen Gras int ext2fs_bmap(void *);
108*d65f6f70SBen Gras 
109*d65f6f70SBen Gras /* ext2fs_inode.c */
110*d65f6f70SBen Gras u_int64_t ext2fs_size(struct inode *);
111*d65f6f70SBen Gras int ext2fs_setsize(struct inode *, u_int64_t);
112*d65f6f70SBen Gras int ext2fs_update(struct vnode *, const struct timespec *,
113*d65f6f70SBen Gras     const struct timespec *, int);
114*d65f6f70SBen Gras int ext2fs_truncate(struct vnode *, off_t, int, kauth_cred_t);
115*d65f6f70SBen Gras int ext2fs_inactive(void *);
116*d65f6f70SBen Gras 
117*d65f6f70SBen Gras /* ext2fs_lookup.c */
118*d65f6f70SBen Gras int ext2fs_readdir(void *);
119*d65f6f70SBen Gras int ext2fs_lookup(void *);
120*d65f6f70SBen Gras int ext2fs_direnter(struct inode *, struct vnode *,
121*d65f6f70SBen Gras 			 const struct ufs_lookup_results *,
122*d65f6f70SBen Gras 			 struct componentname *);
123*d65f6f70SBen Gras int ext2fs_dirremove(struct vnode *, const struct ufs_lookup_results *,
124*d65f6f70SBen Gras 		     struct componentname *);
125*d65f6f70SBen Gras int ext2fs_dirrewrite(struct inode *, const struct ufs_lookup_results *,
126*d65f6f70SBen Gras 			   struct inode *, struct componentname *);
127*d65f6f70SBen Gras int ext2fs_dirempty(struct inode *, ino_t, kauth_cred_t);
128*d65f6f70SBen Gras int ext2fs_checkpath(struct inode *, struct inode *, kauth_cred_t);
129*d65f6f70SBen Gras 
130*d65f6f70SBen Gras /* ext2fs_subr.c */
131*d65f6f70SBen Gras int ext2fs_blkatoff(struct vnode *, off_t, char **, struct buf **);
132*d65f6f70SBen Gras void ext2fs_fragacct(struct m_ext2fs *, int, int32_t[], int);
133*d65f6f70SBen Gras void ext2fs_itimes(struct inode *, const struct timespec *,
134*d65f6f70SBen Gras     const struct timespec *, const struct timespec *);
135*d65f6f70SBen Gras 
136*d65f6f70SBen Gras /* ext2fs_vfsops.c */
137*d65f6f70SBen Gras VFS_PROTOS(ext2fs);
138*d65f6f70SBen Gras int ext2fs_reload(struct mount *, kauth_cred_t, struct lwp *);
139*d65f6f70SBen Gras int ext2fs_mountfs(struct vnode *, struct mount *);
140*d65f6f70SBen Gras int ext2fs_flushfiles(struct mount *, int);
141*d65f6f70SBen Gras int ext2fs_sbupdate(struct ufsmount *, int);
142*d65f6f70SBen Gras int ext2fs_cgupdate(struct ufsmount *, int);
143*d65f6f70SBen Gras void ext2fs_set_inode_guid(struct inode *);
144*d65f6f70SBen Gras 
145*d65f6f70SBen Gras /* ext2fs_readwrite.c */
146*d65f6f70SBen Gras int ext2fs_read(void *);
147*d65f6f70SBen Gras int ext2fs_write(void *);
148*d65f6f70SBen Gras 
149*d65f6f70SBen Gras /* ext2fs_vnops.c */
150*d65f6f70SBen Gras int ext2fs_create(void *);
151*d65f6f70SBen Gras int ext2fs_mknod(void *);
152*d65f6f70SBen Gras int ext2fs_open(void *);
153*d65f6f70SBen Gras int ext2fs_access(void *);
154*d65f6f70SBen Gras int ext2fs_getattr(void *);
155*d65f6f70SBen Gras int ext2fs_setattr(void *);
156*d65f6f70SBen Gras int ext2fs_remove(void *);
157*d65f6f70SBen Gras int ext2fs_link(void *);
158*d65f6f70SBen Gras int ext2fs_rename(void *);
159*d65f6f70SBen Gras int ext2fs_mkdir(void *);
160*d65f6f70SBen Gras int ext2fs_rmdir(void *);
161*d65f6f70SBen Gras int ext2fs_symlink(void *);
162*d65f6f70SBen Gras int ext2fs_readlink(void *);
163*d65f6f70SBen Gras int ext2fs_advlock(void *);
164*d65f6f70SBen Gras int ext2fs_fsync(void *);
165*d65f6f70SBen Gras int ext2fs_vinit(struct mount *, int (**specops)(void *),
166*d65f6f70SBen Gras 		      int (**fifoops)(void *), struct vnode **);
167*d65f6f70SBen Gras int ext2fs_makeinode(int, struct vnode *, struct vnode **,
168*d65f6f70SBen Gras 			  struct componentname *cnp);
169*d65f6f70SBen Gras int ext2fs_reclaim(void *);
170*d65f6f70SBen Gras 
171*d65f6f70SBen Gras __END_DECLS
172*d65f6f70SBen Gras 
173*d65f6f70SBen Gras #define IS_EXT2_VNODE(vp)   (vp->v_tag == VT_EXT2FS)
174*d65f6f70SBen Gras 
175*d65f6f70SBen Gras extern int (**ext2fs_vnodeop_p)(void *);
176*d65f6f70SBen Gras extern int (**ext2fs_specop_p)(void *);
177*d65f6f70SBen Gras extern int (**ext2fs_fifoop_p)(void *);
178*d65f6f70SBen Gras 
179*d65f6f70SBen Gras #endif /* !_UFS_EXT2FS_EXT2FS_EXTERN_H_ */
180