1/* $NetBSD: ulfs_extern.h,v 1.26 2021/07/18 23:57:15 dholland Exp $ */ 2/* from NetBSD: ufs_extern.h,v 1.79 2015/03/27 17:27:56 riastradh Exp */ 3 4/*- 5 * Copyright (c) 1991, 1993, 1994 6 * The Regents of the University of California. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. Neither the name of the University nor the names of its contributors 17 * may be used to endorse or promote products derived from this software 18 * without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 33 */ 34 35#ifndef _UFS_LFS_ULFS_EXTERN_H_ 36#define _UFS_LFS_ULFS_EXTERN_H_ 37 38#include <sys/mutex.h> 39 40struct buf; 41struct componentname; 42struct disklabel; 43struct dquot; 44struct fid; 45struct flock; 46struct indir; 47struct inode; 48struct mbuf; 49struct mount; 50struct nameidata; 51struct lfs_direct; 52struct lwp; 53struct ulfs_args; 54struct ulfs_lookup_results; 55struct ulfs_ufid; 56struct ulfsmount; 57struct uio; 58struct vattr; 59struct vnode; 60 61__BEGIN_DECLS 62int ulfs_access(void *); 63int ulfs_advlock(void *); 64int ulfs_bmap(void *); 65int ulfs_close(void *); 66int ulfs_create(void *); 67int ulfs_getattr(void *); 68int ulfs_inactive(void *); 69int ulfs_link(void *); 70int ulfs_lookup(void *); 71int ulfs_open(void *); 72int ulfs_pathconf(void *); 73int ulfs_print(void *); 74int ulfs_readdir(void *); 75int ulfs_readlink(void *); 76int ulfs_remove(void *); 77int ulfs_rmdir(void *); 78int ulfs_setattr(void *); 79int ulfs_strategy(void *); 80int ulfs_whiteout(void *); 81int ulfsspec_close(void *); 82int ulfsspec_read(void *); 83int ulfsspec_write(void *); 84 85int ulfsfifo_read(void *); 86int ulfsfifo_write(void *); 87int ulfsfifo_close(void *); 88 89/* ulfs_bmap.c */ 90typedef bool (*ulfs_issequential_callback_t)(const struct lfs *, 91 daddr_t, daddr_t); 92int ulfs_bmaparray(struct vnode *, daddr_t, daddr_t *, struct indir *, 93 int *, int *, ulfs_issequential_callback_t); 94int ulfs_getlbns(struct vnode *, daddr_t, struct indir *, int *); 95 96/* ulfs_inode.c */ 97int ulfs_reclaim(struct vnode *); 98int ulfs_balloc_range(struct vnode *, off_t, off_t, kauth_cred_t, int); 99 100/* ulfs_lookup.c */ 101void ulfs_dirbad(struct inode *, doff_t, const char *); 102int ulfs_dirbadentry(struct vnode *, LFS_DIRHEADER *, int); 103int ulfs_direnter(struct vnode *, const struct ulfs_lookup_results *, 104 struct vnode *, 105 struct componentname *, ino_t, unsigned, 106 struct buf *); 107int ulfs_dirremove(struct vnode *, const struct ulfs_lookup_results *, 108 struct inode *, int, int); 109int ulfs_dirrewrite(struct inode *, off_t, 110 struct inode *, ino_t, int, int, int); 111int ulfs_dirempty(struct inode *, ino_t, kauth_cred_t); 112int ulfs_blkatoff(struct vnode *, off_t, char **, struct buf **, bool); 113 114/* ulfs_quota.c */ 115/* 116 * Flags to lfs_chkdq() and lfs_chkiq() 117 */ 118#define FORCE 0x01 /* force usage changes independent of limits */ 119void ulfsquota_init(struct inode *); 120void ulfsquota_free(struct inode *); 121int lfs_chkdq(struct inode *, int64_t, kauth_cred_t, int); 122int lfs_chkiq(struct inode *, int32_t, kauth_cred_t, int); 123int lfsquota_handle_cmd(struct mount *, struct lwp *, 124 struct quotactl_args *); 125 126int lfs_qsync(struct mount *); 127 128/* ulfs_quota1.c */ 129int lfsquota1_umount(struct mount *, int); 130 131/* ulfs_quota2.c */ 132int lfsquota2_umount(struct mount *, int); 133int lfs_quota2_mount(struct mount *); 134 135/* ulfs_vfsops.c */ 136void ulfs_init(void); 137void ulfs_reinit(void); 138void ulfs_done(void); 139int ulfs_start(struct mount *, int); 140int ulfs_root(struct mount *, int, struct vnode **); 141int ulfs_quotactl(struct mount *, struct quotactl_args *); 142int ulfs_fhtovp(struct mount *, struct ulfs_ufid *, int, struct vnode **); 143 144/* ulfs_vnops.c */ 145void ulfs_vinit(struct mount *, int (**)(void *), 146 int (**)(void *), struct vnode **); 147int ulfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t); 148void ulfs_gop_markupdate(struct vnode *, int); 149int ulfs_bufio(enum uio_rw, struct vnode *, void *, size_t, off_t, int, 150 kauth_cred_t, size_t *, struct lwp *); 151 152/* 153 * Snapshot function prototypes. 154 */ 155 156void ulfs_snapgone(struct inode *); 157 158__END_DECLS 159 160#endif /* !_UFS_LFS_ULFS_EXTERN_H_ */ 161