Home | History | Annotate | Line # | Download | only in lfs
ulfs_extern.h revision 1.1
      1  1.1  dholland /*	$NetBSD: ulfs_extern.h,v 1.1 2013/06/06 00:40:55 dholland Exp $	*/
      2  1.1  dholland /*  from NetBSD: ufs_extern.h,v 1.72 2012/05/09 00:21:18 riastradh Exp  */
      3  1.1  dholland 
      4  1.1  dholland /*-
      5  1.1  dholland  * Copyright (c) 1991, 1993, 1994
      6  1.1  dholland  *	The Regents of the University of California.  All rights reserved.
      7  1.1  dholland  *
      8  1.1  dholland  * Redistribution and use in source and binary forms, with or without
      9  1.1  dholland  * modification, are permitted provided that the following conditions
     10  1.1  dholland  * are met:
     11  1.1  dholland  * 1. Redistributions of source code must retain the above copyright
     12  1.1  dholland  *    notice, this list of conditions and the following disclaimer.
     13  1.1  dholland  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.1  dholland  *    notice, this list of conditions and the following disclaimer in the
     15  1.1  dholland  *    documentation and/or other materials provided with the distribution.
     16  1.1  dholland  * 3. Neither the name of the University nor the names of its contributors
     17  1.1  dholland  *    may be used to endorse or promote products derived from this software
     18  1.1  dholland  *    without specific prior written permission.
     19  1.1  dholland  *
     20  1.1  dholland  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     21  1.1  dholland  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22  1.1  dholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23  1.1  dholland  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     24  1.1  dholland  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25  1.1  dholland  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26  1.1  dholland  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27  1.1  dholland  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28  1.1  dholland  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29  1.1  dholland  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30  1.1  dholland  * SUCH DAMAGE.
     31  1.1  dholland  *
     32  1.1  dholland  *	@(#)ufs_extern.h	8.10 (Berkeley) 5/14/95
     33  1.1  dholland  */
     34  1.1  dholland 
     35  1.1  dholland #ifndef _UFS_UFS_EXTERN_H_
     36  1.1  dholland #define _UFS_UFS_EXTERN_H_
     37  1.1  dholland 
     38  1.1  dholland #include <sys/mutex.h>
     39  1.1  dholland 
     40  1.1  dholland struct buf;
     41  1.1  dholland struct componentname;
     42  1.1  dholland struct direct;
     43  1.1  dholland struct disklabel;
     44  1.1  dholland struct dquot;
     45  1.1  dholland struct fid;
     46  1.1  dholland struct flock;
     47  1.1  dholland struct indir;
     48  1.1  dholland struct inode;
     49  1.1  dholland struct mbuf;
     50  1.1  dholland struct mount;
     51  1.1  dholland struct nameidata;
     52  1.1  dholland struct lwp;
     53  1.1  dholland struct ufid;
     54  1.1  dholland struct ufs_args;
     55  1.1  dholland struct ufs_lookup_results;
     56  1.1  dholland struct ufsmount;
     57  1.1  dholland struct uio;
     58  1.1  dholland struct vattr;
     59  1.1  dholland struct vnode;
     60  1.1  dholland 
     61  1.1  dholland extern pool_cache_t ufs_direct_cache;	/* memory pool for directs */
     62  1.1  dholland 
     63  1.1  dholland __BEGIN_DECLS
     64  1.1  dholland #define	ufs_abortop	genfs_abortop
     65  1.1  dholland int	ufs_access(void *);
     66  1.1  dholland int	ufs_advlock(void *);
     67  1.1  dholland int	ufs_bmap(void *);
     68  1.1  dholland int	ufs_close(void *);
     69  1.1  dholland int	ufs_create(void *);
     70  1.1  dholland int	ufs_getattr(void *);
     71  1.1  dholland int	ufs_inactive(void *);
     72  1.1  dholland #define	ufs_fcntl	genfs_fcntl
     73  1.1  dholland #define	ufs_ioctl	genfs_enoioctl
     74  1.1  dholland #define	ufs_islocked	genfs_islocked
     75  1.1  dholland int	ufs_link(void *);
     76  1.1  dholland #define	ufs_lock	genfs_lock
     77  1.1  dholland int	ufs_lookup(void *);
     78  1.1  dholland int	ufs_mkdir(void *);
     79  1.1  dholland int	ufs_mknod(void *);
     80  1.1  dholland #define	ufs_mmap	genfs_mmap
     81  1.1  dholland #define	ufs_revoke	genfs_revoke
     82  1.1  dholland int	ufs_open(void *);
     83  1.1  dholland int	ufs_pathconf(void *);
     84  1.1  dholland int	ufs_print(void *);
     85  1.1  dholland int	ufs_readdir(void *);
     86  1.1  dholland int	ufs_readlink(void *);
     87  1.1  dholland int	ufs_remove(void *);
     88  1.1  dholland int	ufs_rename(void *);
     89  1.1  dholland int	ufs_rmdir(void *);
     90  1.1  dholland #define	ufs_seek	genfs_seek
     91  1.1  dholland #define	ufs_poll	genfs_poll
     92  1.1  dholland int	ufs_setattr(void *);
     93  1.1  dholland int	ufs_strategy(void *);
     94  1.1  dholland int	ufs_symlink(void *);
     95  1.1  dholland #define	ufs_unlock	genfs_unlock
     96  1.1  dholland int	ufs_whiteout(void *);
     97  1.1  dholland int	ufsspec_close(void *);
     98  1.1  dholland int	ufsspec_read(void *);
     99  1.1  dholland int	ufsspec_write(void *);
    100  1.1  dholland 
    101  1.1  dholland int	ufsfifo_read(void *);
    102  1.1  dholland int	ufsfifo_write(void *);
    103  1.1  dholland int	ufsfifo_close(void *);
    104  1.1  dholland 
    105  1.1  dholland /* ufs_bmap.c */
    106  1.1  dholland typedef	bool (*ufs_issequential_callback_t)(const struct ufsmount *,
    107  1.1  dholland 						 daddr_t, daddr_t);
    108  1.1  dholland int	ufs_bmaparray(struct vnode *, daddr_t, daddr_t *, struct indir *,
    109  1.1  dholland 		      int *, int *, ufs_issequential_callback_t);
    110  1.1  dholland int	ufs_getlbns(struct vnode *, daddr_t, struct indir *, int *);
    111  1.1  dholland 
    112  1.1  dholland /* ufs_ihash.c */
    113  1.1  dholland void	ufs_ihashinit(void);
    114  1.1  dholland void	ufs_ihashreinit(void);
    115  1.1  dholland void	ufs_ihashdone(void);
    116  1.1  dholland struct vnode *ufs_ihashlookup(dev_t, ino_t);
    117  1.1  dholland struct vnode *ufs_ihashget(dev_t, ino_t, int);
    118  1.1  dholland void	ufs_ihashins(struct inode *);
    119  1.1  dholland void	ufs_ihashrem(struct inode *);
    120  1.1  dholland 
    121  1.1  dholland /* ufs_inode.c */
    122  1.1  dholland int	ufs_reclaim(struct vnode *);
    123  1.1  dholland int	ufs_balloc_range(struct vnode *, off_t, off_t, kauth_cred_t, int);
    124  1.1  dholland 
    125  1.1  dholland /* ufs_lookup.c */
    126  1.1  dholland void	ufs_dirbad(struct inode *, doff_t, const char *);
    127  1.1  dholland int	ufs_dirbadentry(struct vnode *, struct direct *, int);
    128  1.1  dholland void	ufs_makedirentry(struct inode *, struct componentname *,
    129  1.1  dholland 			 struct direct *);
    130  1.1  dholland int	ufs_direnter(struct vnode *, const struct ufs_lookup_results *,
    131  1.1  dholland 		     struct vnode *, struct direct *,
    132  1.1  dholland 		     struct componentname *, struct buf *);
    133  1.1  dholland int	ufs_dirremove(struct vnode *, const struct ufs_lookup_results *,
    134  1.1  dholland 		      struct inode *, int, int);
    135  1.1  dholland int	ufs_dirrewrite(struct inode *, off_t,
    136  1.1  dholland 		       struct inode *, ino_t, int, int, int);
    137  1.1  dholland int	ufs_dirempty(struct inode *, ino_t, kauth_cred_t);
    138  1.1  dholland int	ufs_checkpath(struct inode *, struct inode *, kauth_cred_t);
    139  1.1  dholland int	ufs_parentcheck(struct vnode *, struct vnode *, kauth_cred_t,
    140  1.1  dholland 			int *, struct vnode **);
    141  1.1  dholland int	ufs_blkatoff(struct vnode *, off_t, char **, struct buf **, bool);
    142  1.1  dholland 
    143  1.1  dholland /* ufs_rename.c -- for lfs */
    144  1.1  dholland bool	ufs_gro_directory_empty_p(struct mount *, kauth_cred_t,
    145  1.1  dholland 	    struct vnode *, struct vnode *);
    146  1.1  dholland int	ufs_gro_rename_check_possible(struct mount *,
    147  1.1  dholland 	    struct vnode *, struct vnode *, struct vnode *, struct vnode *);
    148  1.1  dholland int	ufs_gro_rename_check_permitted(struct mount *, kauth_cred_t,
    149  1.1  dholland 	    struct vnode *, struct vnode *, struct vnode *, struct vnode *);
    150  1.1  dholland int	ufs_gro_remove_check_possible(struct mount *,
    151  1.1  dholland 	    struct vnode *, struct vnode *);
    152  1.1  dholland int	ufs_gro_remove_check_permitted(struct mount *, kauth_cred_t,
    153  1.1  dholland 	    struct vnode *, struct vnode *);
    154  1.1  dholland int	ufs_gro_rename(struct mount *, kauth_cred_t,
    155  1.1  dholland 	    struct vnode *, struct componentname *, void *, struct vnode *,
    156  1.1  dholland 	    struct vnode *, struct componentname *, void *, struct vnode *);
    157  1.1  dholland int	ufs_gro_remove(struct mount *, kauth_cred_t,
    158  1.1  dholland 	    struct vnode *, struct componentname *, void *, struct vnode *);
    159  1.1  dholland int	ufs_gro_lookup(struct mount *, struct vnode *,
    160  1.1  dholland 	    struct componentname *, void *, struct vnode **);
    161  1.1  dholland int	ufs_gro_genealogy(struct mount *, kauth_cred_t,
    162  1.1  dholland 	    struct vnode *, struct vnode *, struct vnode **);
    163  1.1  dholland int	ufs_gro_lock_directory(struct mount *, struct vnode *);
    164  1.1  dholland 
    165  1.1  dholland 
    166  1.1  dholland /* ufs_quota.c */
    167  1.1  dholland /*
    168  1.1  dholland  * Flags to chkdq() and chkiq()
    169  1.1  dholland  */
    170  1.1  dholland #define	FORCE	0x01	/* force usage changes independent of limits */
    171  1.1  dholland void	ufsquota_init(struct inode *);
    172  1.1  dholland void	ufsquota_free(struct inode *);
    173  1.1  dholland int	chkdq(struct inode *, int64_t, kauth_cred_t, int);
    174  1.1  dholland int	chkiq(struct inode *, int32_t, kauth_cred_t, int);
    175  1.1  dholland int	quota_handle_cmd(struct mount *, struct lwp *,
    176  1.1  dholland 			 struct quotactl_args *);
    177  1.1  dholland 
    178  1.1  dholland int	qsync(struct mount *);
    179  1.1  dholland 
    180  1.1  dholland /* ufs_quota1.c */
    181  1.1  dholland int	quota1_umount(struct mount *, int);
    182  1.1  dholland 
    183  1.1  dholland /* ufs_quota2.c */
    184  1.1  dholland int	quota2_umount(struct mount *, int);
    185  1.1  dholland 
    186  1.1  dholland /* ufs_vfsops.c */
    187  1.1  dholland void	ufs_init(void);
    188  1.1  dholland void	ufs_reinit(void);
    189  1.1  dholland void	ufs_done(void);
    190  1.1  dholland int	ufs_start(struct mount *, int);
    191  1.1  dholland int	ufs_root(struct mount *, struct vnode **);
    192  1.1  dholland int	ufs_quotactl(struct mount *, struct quotactl_args *);
    193  1.1  dholland int	ufs_fhtovp(struct mount *, struct ufid *, struct vnode **);
    194  1.1  dholland 
    195  1.1  dholland /* ufs_vnops.c */
    196  1.1  dholland void	ufs_vinit(struct mount *, int (**)(void *),
    197  1.1  dholland 		  int (**)(void *), struct vnode **);
    198  1.1  dholland int	ufs_makeinode(int, struct vnode *, const struct ufs_lookup_results *,
    199  1.1  dholland 		      struct vnode **, struct componentname *);
    200  1.1  dholland int	ufs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
    201  1.1  dholland void	ufs_gop_markupdate(struct vnode *, int);
    202  1.1  dholland 
    203  1.1  dholland /*
    204  1.1  dholland  * Snapshot function prototypes.
    205  1.1  dholland  */
    206  1.1  dholland 
    207  1.1  dholland void	ffs_snapgone(struct inode *);
    208  1.1  dholland 
    209  1.1  dholland __END_DECLS
    210  1.1  dholland 
    211  1.1  dholland extern kmutex_t ufs_ihash_lock;
    212  1.1  dholland extern kmutex_t ufs_hashlock;
    213  1.1  dholland 
    214  1.1  dholland #endif /* !_UFS_UFS_EXTERN_H_ */
    215