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