Home | History | Annotate | Line # | Download | only in ffs
ffs_extern.h revision 1.9
      1 /*	$NetBSD: ffs_extern.h,v 1.9 1998/06/22 22:01:08 sommerfe 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. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	@(#)ffs_extern.h	8.6 (Berkeley) 3/30/95
     36  */
     37 
     38 #if defined(_KERNEL) && !defined(_LKM)
     39 #include "opt_fifo.h"
     40 #endif
     41 
     42 /*
     43  * Sysctl values for the fast filesystem.
     44  */
     45 #define FFS_CLUSTERREAD		1	/* cluster reading enabled */
     46 #define FFS_CLUSTERWRITE	2	/* cluster writing enabled */
     47 #define FFS_REALLOCBLKS		3	/* block reallocation enabled */
     48 #define FFS_ASYNCFREE		4	/* asynchronous block freeing enabled */
     49 #define FFS_MAXID		5	/* number of valid ffs ids */
     50 
     51 #define FFS_NAMES { \
     52 	{ 0, 0 }, \
     53 	{ "doclusterread", CTLTYPE_INT }, \
     54 	{ "doclusterwrite", CTLTYPE_INT }, \
     55 	{ "doreallocblks", CTLTYPE_INT }, \
     56 	{ "doasyncfree", CTLTYPE_INT }, \
     57 }
     58 
     59 struct buf;
     60 struct fid;
     61 struct fs;
     62 struct inode;
     63 struct dinode;
     64 struct mount;
     65 struct nameidata;
     66 struct proc;
     67 struct statfs;
     68 struct timeval;
     69 struct ucred;
     70 struct ufsmount;
     71 struct uio;
     72 struct vnode;
     73 struct mbuf;
     74 struct cg;
     75 
     76 __BEGIN_DECLS
     77 
     78 /* ffs_alloc.c */
     79 int ffs_alloc __P((struct inode *, ufs_daddr_t, ufs_daddr_t , int, struct ucred *,
     80 		   ufs_daddr_t *));
     81 int ffs_realloccg __P((struct inode *, ufs_daddr_t, ufs_daddr_t, int, int ,
     82 		       struct ucred *, struct buf **));
     83 int ffs_reallocblks __P((void *));
     84 int ffs_valloc __P((void *));
     85 ufs_daddr_t ffs_blkpref __P((struct inode *, ufs_daddr_t, int, ufs_daddr_t *));
     86 void ffs_blkfree __P((struct inode *, ufs_daddr_t, long));
     87 int ffs_vfree __P((void *));
     88 void ffs_clusteracct __P((int, struct fs *, struct cg *, ufs_daddr_t, int));
     89 
     90 /* ffs_balloc.c */
     91 int ffs_balloc __P((struct inode *, ufs_daddr_t, int, struct ucred *,
     92 		    struct buf **, int));
     93 
     94 /* ffs_bswap.c */
     95 void ffs_sb_swap __P((struct fs*, struct fs *, int));
     96 void ffs_dinode_swap __P((struct dinode *, struct dinode *));
     97 void ffs_csum_swap __P((struct csum *, struct csum *, int));
     98 
     99 /* ffs_inode.c */
    100 void ffs_init __P((void));
    101 int ffs_update __P((void *));
    102 int ffs_truncate __P((void *));
    103 
    104 /* ffs_subr.c */
    105 int ffs_blkatoff __P((void *));
    106 void ffs_fragacct __P((struct fs *, int, int32_t[], int, int));
    107 #ifdef DIAGNOSTIC
    108 void	ffs_checkoverlap __P((struct buf *, struct inode *));
    109 #endif
    110 int ffs_isblock __P((struct fs *, unsigned char *, ufs_daddr_t));
    111 void ffs_clrblock __P((struct fs *, u_char *, ufs_daddr_t));
    112 void ffs_setblock __P((struct fs *, unsigned char *, ufs_daddr_t));
    113 
    114 /* ffs_vfsops.c */
    115 int ffs_mountroot __P((void));
    116 int ffs_mount __P((struct mount *, const char *, void *, struct nameidata *,
    117 		   struct proc *));
    118 int ffs_reload __P((struct mount *, struct ucred *, struct proc *));
    119 int ffs_mountfs __P((struct vnode *, struct mount *, struct proc *));
    120 int ffs_oldfscompat __P((struct fs *));
    121 int ffs_unmount __P((struct mount *, int, struct proc *));
    122 int ffs_flushfiles __P((struct mount *, int, struct proc *));
    123 int ffs_statfs __P((struct mount *, struct statfs *, struct proc *));
    124 int ffs_sync __P((struct mount *, int, struct ucred *, struct proc *));
    125 int ffs_vget __P((struct mount *, ino_t, struct vnode **));
    126 int ffs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
    127 		    struct vnode **, int *, struct ucred **));
    128 int ffs_vptofh __P((struct vnode *, struct fid *));
    129 int ffs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
    130 		    struct proc *));
    131 int ffs_sbupdate __P((struct ufsmount *, int));
    132 int ffs_cgupdate __P((struct ufsmount *, int));
    133 
    134 /* ffs_vnops.c */
    135 int ffs_read __P((void *));
    136 int ffs_write __P((void *));
    137 #define ffs_fsync genfs_fsync
    138 int ffs_reclaim __P((void *));
    139 __END_DECLS
    140 
    141 extern int (**ffs_vnodeop_p) __P((void *));
    142 extern int (**ffs_specop_p) __P((void *));
    143 #ifdef FIFO
    144 extern int (**ffs_fifoop_p) __P((void *));
    145 #define FFS_FIFOOPS ffs_fifoop_p
    146 #else
    147 #define FFS_FIFOOPS NULL
    148 #endif
    149