ffs_extern.h revision 34826
11541Srgrimes/*-
21541Srgrimes * Copyright (c) 1991, 1993, 1994
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * Redistribution and use in source and binary forms, with or without
61541Srgrimes * modification, are permitted provided that the following conditions
71541Srgrimes * are met:
81541Srgrimes * 1. Redistributions of source code must retain the above copyright
91541Srgrimes *    notice, this list of conditions and the following disclaimer.
101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111541Srgrimes *    notice, this list of conditions and the following disclaimer in the
121541Srgrimes *    documentation and/or other materials provided with the distribution.
131541Srgrimes * 3. All advertising materials mentioning features or use of this software
141541Srgrimes *    must display the following acknowledgement:
151541Srgrimes *	This product includes software developed by the University of
161541Srgrimes *	California, Berkeley and its contributors.
171541Srgrimes * 4. Neither the name of the University nor the names of its contributors
181541Srgrimes *    may be used to endorse or promote products derived from this software
191541Srgrimes *    without specific prior written permission.
201541Srgrimes *
211541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311541Srgrimes * SUCH DAMAGE.
321541Srgrimes *
3322521Sdyson *	@(#)ffs_extern.h	8.6 (Berkeley) 3/30/95
3434826Sbde * $Id: ffs_extern.h,v 1.23 1998/03/08 09:58:50 julian Exp $
351541Srgrimes */
361541Srgrimes
3715493Sbde#ifndef _UFS_FFS_EXTERN_H
3815493Sbde#define	_UFS_FFS_EXTERN_H
3915493Sbde
4022521Sdyson/*
4122521Sdyson * Sysctl values for the fast filesystem.
4222521Sdyson */
4322521Sdyson#define FFS_REALLOCBLKS		3	/* block reallocation enabled */
4422521Sdyson#define FFS_ASYNCFREE		4	/* asynchronous block freeing enabled */
4522521Sdyson#define	FFS_MAXID		5	/* number of valid ffs ids */
4622521Sdyson
4722521Sdyson#define FFS_NAMES { \
4822521Sdyson	{ 0, 0 }, \
4929888Skato	{ 0, 0 }, \
5029888Skato	{ 0, 0 }, \
5122521Sdyson	{ "doreallocblks", CTLTYPE_INT }, \
5222521Sdyson	{ "doasyncfree", CTLTYPE_INT }, \
5322521Sdyson}
5422521Sdyson
5522521Sdysonstruct buf;
561541Srgrimesstruct fid;
571541Srgrimesstruct fs;
581541Srgrimesstruct inode;
5933054Sbdestruct malloc_type;
601541Srgrimesstruct mount;
6133054Sbdestruct proc;
6228270Swollmanstruct sockaddr;
631541Srgrimesstruct statfs;
6433054Sbdestruct ucred;
651541Srgrimesstruct vnode;
6634826Sbdestruct vop_balloc_args;
6733054Sbdestruct vop_bmap_args;
6834826Sbdestruct vop_fsync_args;
6933054Sbdestruct vop_reallocblks_args;
701541Srgrimes
711541Srgrimesint	ffs_alloc __P((struct inode *,
7222521Sdyson	    ufs_daddr_t, ufs_daddr_t, int, struct ucred *, ufs_daddr_t *));
7334266Sjulianint	ffs_balloc __P((struct vop_balloc_args *));
7430474Sphkint	ffs_blkatoff __P((struct vnode *, off_t, char **, struct buf **));
7522521Sdysonvoid	ffs_blkfree __P((struct inode *, ufs_daddr_t, long));
7622521Sdysonufs_daddr_t ffs_blkpref __P((struct inode *, ufs_daddr_t, int, ufs_daddr_t *));
771541Srgrimesint	ffs_bmap __P((struct vop_bmap_args *));
7822521Sdysonvoid	ffs_clrblock __P((struct fs *, u_char *, ufs_daddr_t));
7928270Swollmanint	ffs_fhtovp __P((struct mount *, struct fid *, struct sockaddr *,
801541Srgrimes	    struct vnode **, int *, struct ucred **));
8122579Smppint	ffs_flushfiles __P((struct mount *, int, struct proc *));
8222521Sdysonvoid	ffs_fragacct __P((struct fs *, int, int32_t [], int));
8334266Sjulianint	ffs_freefile __P(( struct vnode *, ino_t, int ));
8422521Sdysonint	ffs_isblock __P((struct fs *, u_char *, ufs_daddr_t));
8534266Sjulianint	ffs_isfreeblock __P((struct fs *, unsigned char *, ufs_daddr_t));
8630283Sphkint	ffs_mountfs __P((struct vnode *, struct mount *, struct proc *,
8730283Sphk	     struct malloc_type *));
881541Srgrimesint	ffs_mountroot __P((void));
891541Srgrimesint	ffs_reallocblks __P((struct vop_reallocblks_args *));
901541Srgrimesint	ffs_realloccg __P((struct inode *,
9122521Sdyson	    ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **));
9222521Sdysonvoid	ffs_setblock __P((struct fs *, u_char *, ufs_daddr_t));
931541Srgrimesint	ffs_statfs __P((struct mount *, struct statfs *, struct proc *));
941541Srgrimesint	ffs_sync __P((struct mount *, int, struct ucred *, struct proc *));
9530474Sphkint	ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
961541Srgrimesint	ffs_unmount __P((struct mount *, int, struct proc *));
9730492Sphkint	ffs_update __P((struct vnode *, struct timeval *, struct timeval *, int));
9830474Sphkint	ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
9930474Sphk
10030474Sphkint	ffs_vfree __P((struct vnode *, ino_t, int));
1011541Srgrimesint	ffs_vget __P((struct mount *, ino_t, struct vnode **));
1021541Srgrimesint	ffs_vptofh __P((struct vnode *, struct fid *));
1031541Srgrimes
10412158Sbdeextern vop_t **ffs_vnodeop_p;
10512158Sbdeextern vop_t **ffs_specop_p;
10612158Sbdeextern vop_t **ffs_fifoop_p;
10715493Sbde
10834266Sjulian/*
10934266Sjulian * Soft update function prototypes.
11034266Sjulian */
11134266Sjulianvoid	softdep_initialize __P((void));
11234266Sjulianint	softdep_process_worklist __P((struct mount *));
11334266Sjulianint	softdep_mount __P((struct vnode *, struct mount *, struct fs *,
11434266Sjulian	    struct ucred *));
11534266Sjulianint	softdep_flushfiles __P((struct mount *, int, struct proc *));
11634266Sjulianvoid	softdep_update_inodeblock __P((struct inode *, struct buf *, int));
11734266Sjulianvoid	softdep_load_inodeblock __P((struct inode *));
11834266Sjulianint	softdep_fsync __P((struct vnode *));
11934266Sjulianvoid	softdep_freefile __P((struct vnode *, ino_t, int));
12034266Sjulianvoid	softdep_setup_freeblocks __P((struct inode *, off_t));
12134266Sjulianvoid	softdep_deallocate_dependencies __P((struct buf *));
12234266Sjulianvoid	softdep_setup_inomapdep __P((struct buf *, struct inode *, ino_t));
12334266Sjulianvoid	softdep_setup_blkmapdep __P((struct buf *, struct fs *, ufs_daddr_t));
12434266Sjulianvoid	softdep_setup_allocdirect __P((struct inode *, ufs_lbn_t, ufs_daddr_t,
12534266Sjulian	    ufs_daddr_t, long, long, struct buf *));
12634266Sjulianvoid	softdep_setup_allocindir_meta __P((struct buf *, struct inode *,
12734266Sjulian	    struct buf *, int, ufs_daddr_t));
12834266Sjulianvoid	softdep_setup_allocindir_page __P((struct inode *, ufs_lbn_t,
12934266Sjulian	    struct buf *, int, ufs_daddr_t, ufs_daddr_t, struct buf *));
13034266Sjulianvoid	softdep_disk_io_initiation __P((struct buf *));
13134266Sjulianvoid	softdep_disk_write_complete __P((struct buf *));
13234266Sjulianint	softdep_sync_metadata __P((struct vop_fsync_args *));
13334266Sjulian
13415493Sbde#endif /* !_UFS_FFS_EXTERN_H */
135