1*307cfebbSjsg /* $OpenBSD: ext2fs_extern.h,v 1.39 2024/10/08 02:58:26 jsg Exp $ */ 21414b0faSart /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */ 35ac2d602Sdownsj 45ac2d602Sdownsj /*- 51f3ff51cSdownsj * Copyright (c) 1997 Manuel Bouyer. 65ac2d602Sdownsj * Copyright (c) 1991, 1993, 1994 75ac2d602Sdownsj * The Regents of the University of California. All rights reserved. 85ac2d602Sdownsj * 95ac2d602Sdownsj * Redistribution and use in source and binary forms, with or without 105ac2d602Sdownsj * modification, are permitted provided that the following conditions 115ac2d602Sdownsj * are met: 125ac2d602Sdownsj * 1. Redistributions of source code must retain the above copyright 135ac2d602Sdownsj * notice, this list of conditions and the following disclaimer. 145ac2d602Sdownsj * 2. Redistributions in binary form must reproduce the above copyright 155ac2d602Sdownsj * notice, this list of conditions and the following disclaimer in the 165ac2d602Sdownsj * documentation and/or other materials provided with the distribution. 1729295d1cSmillert * 3. Neither the name of the University nor the names of its contributors 185ac2d602Sdownsj * may be used to endorse or promote products derived from this software 195ac2d602Sdownsj * without specific prior written permission. 205ac2d602Sdownsj * 215ac2d602Sdownsj * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 225ac2d602Sdownsj * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 235ac2d602Sdownsj * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 245ac2d602Sdownsj * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 255ac2d602Sdownsj * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 265ac2d602Sdownsj * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 275ac2d602Sdownsj * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 285ac2d602Sdownsj * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 295ac2d602Sdownsj * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 305ac2d602Sdownsj * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 315ac2d602Sdownsj * SUCH DAMAGE. 325ac2d602Sdownsj * 335ac2d602Sdownsj * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94 341f3ff51cSdownsj * Modified for ext2fs by Manuel Bouyer. 355ac2d602Sdownsj */ 365ac2d602Sdownsj 375ac2d602Sdownsj struct buf; 385ac2d602Sdownsj struct fid; 395ac2d602Sdownsj struct m_ext2fs; 405ac2d602Sdownsj struct inode; 415ac2d602Sdownsj struct mount; 425ac2d602Sdownsj struct nameidata; 435ac2d602Sdownsj struct proc; 445ac2d602Sdownsj struct statfs; 455ac2d602Sdownsj struct timeval; 465ac2d602Sdownsj struct ucred; 475ac2d602Sdownsj struct ufsmount; 485ac2d602Sdownsj struct uio; 495ac2d602Sdownsj struct vnode; 5007feb63cScsapuntz struct vfsconf; 515ac2d602Sdownsj struct mbuf; 525ac2d602Sdownsj struct componentname; 535ac2d602Sdownsj 54b7ade7a9Spedro extern struct pool ext2fs_inode_pool; /* memory pool for inodes */ 552374824dSpedro extern struct pool ext2fs_dinode_pool; /* memory pool for dinodes */ 56f5ee6277Sjasoni 575ac2d602Sdownsj __BEGIN_DECLS 585ac2d602Sdownsj 595ac2d602Sdownsj /* ext2fs_alloc.c */ 605970a65fSpelikan int ext2fs_alloc(struct inode *, u_int32_t, u_int32_t , struct ucred *, 615970a65fSpelikan u_int32_t *); 625970a65fSpelikan int ext2fs_inode_alloc(struct inode *, mode_t mode, struct ucred *, 63b080ad39Scsapuntz struct vnode **); 645970a65fSpelikan daddr_t ext2fs_blkpref(struct inode *, u_int32_t, int, u_int32_t *); 655970a65fSpelikan void ext2fs_blkfree(struct inode *, u_int32_t); 665970a65fSpelikan void ext2fs_inode_free(struct inode *, ufsino_t, mode_t); 675ac2d602Sdownsj 685ac2d602Sdownsj /* ext2fs_balloc.c */ 695970a65fSpelikan int ext2fs_buf_alloc(struct inode *, u_int32_t, int, struct ucred *, 70b080ad39Scsapuntz struct buf **, int); 715ac2d602Sdownsj 725ac2d602Sdownsj /* ext2fs_bmap.c */ 73c4071fd1Smillert int ext2fs_bmap(void *); 745ac2d602Sdownsj 755ac2d602Sdownsj /* ext2fs_inode.c */ 764dcbbbb0Sniallo u_int64_t ext2fs_size(struct inode *); 775970a65fSpelikan int ext2fs_init(struct vfsconf *); 784dcbbbb0Sniallo int ext2fs_setsize(struct inode *, u_int64_t); 79d4fc1c49Sguenther int ext2fs_update(struct inode *ip, int waitfor); 80b080ad39Scsapuntz int ext2fs_truncate(struct inode *, off_t, int, struct ucred *); 81c4071fd1Smillert int ext2fs_inactive(void *); 825ac2d602Sdownsj 835ac2d602Sdownsj /* ext2fs_lookup.c */ 84c4071fd1Smillert int ext2fs_readdir(void *); 85c4071fd1Smillert int ext2fs_lookup(void *); 865970a65fSpelikan int ext2fs_direnter(struct inode *, struct vnode *, struct componentname *); 87c4071fd1Smillert int ext2fs_dirremove(struct vnode *, struct componentname *); 885970a65fSpelikan int ext2fs_dirrewrite(struct inode *, struct inode *, struct componentname *); 89e012d6d3Sguenther int ext2fs_dirempty(struct inode *, ufsino_t, struct ucred *); 90c4071fd1Smillert int ext2fs_checkpath(struct inode *, struct inode *, struct ucred *); 915ac2d602Sdownsj 925ac2d602Sdownsj /* ext2fs_subr.c */ 93b080ad39Scsapuntz int ext2fs_bufatoff(struct inode *, off_t, char **, struct buf **); 944af3a708Snatano int ext2fs_vinit(struct mount *, struct vnode **); 955ac2d602Sdownsj 965ac2d602Sdownsj /* ext2fs_vfsops.c */ 97c4071fd1Smillert int ext2fs_mountroot(void); 985970a65fSpelikan int ext2fs_mount(struct mount *, const char *, void *, struct nameidata *, 995970a65fSpelikan struct proc *); 100c4071fd1Smillert int ext2fs_reload(struct mount *, struct ucred *, struct proc *); 101c4071fd1Smillert int ext2fs_mountfs(struct vnode *, struct mount *, struct proc *); 102c4071fd1Smillert int ext2fs_unmount(struct mount *, int, struct proc *); 103c4071fd1Smillert int ext2fs_flushfiles(struct mount *, int, struct proc *); 104c4071fd1Smillert int ext2fs_statfs(struct mount *, struct statfs *, struct proc *); 105976e9839Sderaadt int ext2fs_sync(struct mount *, int, int, struct ucred *, struct proc *); 106c4071fd1Smillert int ext2fs_vget(struct mount *, ino_t, struct vnode **); 107c4071fd1Smillert int ext2fs_fhtovp(struct mount *, struct fid *, struct vnode **); 108c4071fd1Smillert int ext2fs_vptofh(struct vnode *, struct fid *); 109c4071fd1Smillert int ext2fs_sbupdate(struct ufsmount *, int); 110c4071fd1Smillert int ext2fs_cgupdate(struct ufsmount *, int); 111c4071fd1Smillert int ext2fs_sysctl(int *, u_int, void *, size_t *, void *, size_t, 112c4071fd1Smillert struct proc *); 1135ac2d602Sdownsj 1145ac2d602Sdownsj /* ext2fs_readwrite.c */ 115c4071fd1Smillert int ext2fs_read(void *); 116c4071fd1Smillert int ext2fs_write(void *); 1175ac2d602Sdownsj 1185ac2d602Sdownsj /* ext2fs_vnops.c */ 119c4071fd1Smillert int ext2fs_create(void *); 120c4071fd1Smillert int ext2fs_mknod(void *); 121c4071fd1Smillert int ext2fs_open(void *); 122c4071fd1Smillert int ext2fs_access(void *); 123c4071fd1Smillert int ext2fs_getattr(void *); 124c4071fd1Smillert int ext2fs_setattr(void *); 125c4071fd1Smillert int ext2fs_remove(void *); 126c4071fd1Smillert int ext2fs_link(void *); 127c4071fd1Smillert int ext2fs_rename(void *); 128c4071fd1Smillert int ext2fs_mkdir(void *); 129c4071fd1Smillert int ext2fs_rmdir(void *); 130c4071fd1Smillert int ext2fs_symlink(void *); 131c4071fd1Smillert int ext2fs_readlink(void *); 132d4648cd6Sguenther int ext2fs_pathconf(void *); 133c4071fd1Smillert int ext2fs_advlock(void *); 134c4071fd1Smillert int ext2fs_makeinode(int, struct vnode *, struct vnode **, 135c4071fd1Smillert struct componentname *cnp); 136c4071fd1Smillert int ext2fs_fsync(void *); 137c4071fd1Smillert int ext2fs_reclaim(void *); 1381816238dStedu int ext2fsfifo_reclaim(void *); 139f5ee6277Sjasoni 1405ac2d602Sdownsj __END_DECLS 1415ac2d602Sdownsj 1425ac2d602Sdownsj #define IS_EXT2_VNODE(vp) (vp->v_tag == VT_EXT2FS) 1435ac2d602Sdownsj 1442d6b9e38Sclaudio extern const struct vops ext2fs_vops; 1452d6b9e38Sclaudio extern const struct vops ext2fs_specvops; 1465ac2d602Sdownsj #ifdef FIFO 1472d6b9e38Sclaudio extern const struct vops ext2fs_fifovops; 1485ac2d602Sdownsj #endif 149