1/* $OpenBSD: ext2fs_extern.h,v 1.40 2025/07/07 00:55:15 jsg 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. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94
34 * Modified for ext2fs by Manuel Bouyer.
35 */
36
37struct buf;
38struct fid;
39struct m_ext2fs;
40struct inode;
41struct mount;
42struct nameidata;
43struct proc;
44struct statfs;
45struct timeval;
46struct ucred;
47struct ufsmount;
48struct uio;
49struct vnode;
50struct vfsconf;
51struct mbuf;
52struct componentname;
53
54extern struct pool ext2fs_inode_pool; /* memory pool for inodes */
55extern struct pool ext2fs_dinode_pool; /* memory pool for dinodes */
56
57__BEGIN_DECLS
58
59/* ext2fs_alloc.c */
60int ext2fs_alloc(struct inode *, u_int32_t, u_int32_t , struct ucred *,
61 u_int32_t *);
62int ext2fs_inode_alloc(struct inode *, mode_t mode, struct ucred *,
63 struct vnode **);
64daddr_t ext2fs_blkpref(struct inode *, u_int32_t, int, u_int32_t *);
65void ext2fs_blkfree(struct inode *, u_int32_t);
66void ext2fs_inode_free(struct inode *, ufsino_t, mode_t);
67
68/* ext2fs_balloc.c */
69int ext2fs_buf_alloc(struct inode *, u_int32_t, int, struct ucred *,
70 struct buf **, int);
71
72/* ext2fs_bmap.c */
73int ext2fs_bmap(void *);
74
75/* ext2fs_inode.c */
76u_int64_t ext2fs_size(struct inode *);
77int ext2fs_init(struct vfsconf *);
78int ext2fs_setsize(struct inode *, u_int64_t);
79int ext2fs_update(struct inode *ip, int waitfor);
80int ext2fs_truncate(struct inode *, off_t, int, struct ucred *);
81int ext2fs_inactive(void *);
82
83/* ext2fs_lookup.c */
84int ext2fs_readdir(void *);
85int ext2fs_lookup(void *);
86int ext2fs_direnter(struct inode *, struct vnode *, struct componentname *);
87int ext2fs_dirremove(struct vnode *, struct componentname *);
88int ext2fs_dirrewrite(struct inode *, struct inode *, struct componentname *);
89int ext2fs_dirempty(struct inode *, ufsino_t, struct ucred *);
90int ext2fs_checkpath(struct inode *, struct inode *, struct ucred *);
91
92/* ext2fs_subr.c */
93int ext2fs_bufatoff(struct inode *, off_t, char **, struct buf **);
94int ext2fs_vinit(struct mount *, struct vnode **);
95
96/* ext2fs_vfsops.c */
97int ext2fs_mountroot(void);
98int ext2fs_mount(struct mount *, const char *, void *, struct nameidata *,
99 struct proc *);
100int ext2fs_reload(struct mount *, struct ucred *, struct proc *);
101int ext2fs_mountfs(struct vnode *, struct mount *, struct proc *);
102int ext2fs_unmount(struct mount *, int, struct proc *);
103int ext2fs_flushfiles(struct mount *, int, struct proc *);
104int ext2fs_statfs(struct mount *, struct statfs *, struct proc *);
105int ext2fs_sync(struct mount *, int, int, struct ucred *, struct proc *);
106int ext2fs_vget(struct mount *, ino_t, struct vnode **);
107int ext2fs_fhtovp(struct mount *, struct fid *, struct vnode **);
108int ext2fs_vptofh(struct vnode *, struct fid *);
109int ext2fs_sbupdate(struct ufsmount *, int);
110int ext2fs_cgupdate(struct ufsmount *, int);
111
112/* ext2fs_readwrite.c */
113int ext2fs_read(void *);
114int ext2fs_write(void *);
115
116/* ext2fs_vnops.c */
117int ext2fs_create(void *);
118int ext2fs_mknod(void *);
119int ext2fs_open(void *);
120int ext2fs_access(void *);
121int ext2fs_getattr(void *);
122int ext2fs_setattr(void *);
123int ext2fs_remove(void *);
124int ext2fs_link(void *);
125int ext2fs_rename(void *);
126int ext2fs_mkdir(void *);
127int ext2fs_rmdir(void *);
128int ext2fs_symlink(void *);
129int ext2fs_readlink(void *);
130int ext2fs_pathconf(void *);
131int ext2fs_advlock(void *);
132int ext2fs_makeinode(int, struct vnode *, struct vnode **,
133 struct componentname *cnp);
134int ext2fs_fsync(void *);
135int ext2fs_reclaim(void *);
136int ext2fsfifo_reclaim(void *);
137
138__END_DECLS
139
140#define IS_EXT2_VNODE(vp) (vp->v_tag == VT_EXT2FS)
141
142extern const struct vops ext2fs_vops;
143extern const struct vops ext2fs_specvops;
144#ifdef FIFO
145extern const struct vops ext2fs_fifovops;
146#endif