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