]> git.saurik.com Git - apple/xnu.git/blame - bsd/ufs/ffs/ffs_extern.h
xnu-792.12.6.tar.gz
[apple/xnu.git] / bsd / ufs / ffs / ffs_extern.h
CommitLineData
1c79356b 1/*
8ad349bb 2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
1c79356b 3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
31
32/*-
33 * Copyright (c) 1991, 1993, 1994
34 * The Regents of the University of California. All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. All advertising materials mentioning features or use of this software
45 * must display the following acknowledgement:
46 * This product includes software developed by the University of
47 * California, Berkeley and its contributors.
48 * 4. Neither the name of the University nor the names of its contributors
49 * may be used to endorse or promote products derived from this software
50 * without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95
65 */
9bccf70c
A
66#ifndef __UFS_FFS_FFS_EXTERN_H__
67#define __UFS_FFS_FFS_EXTERN_H__
1c79356b 68
9bccf70c
A
69#include <sys/appleapiopts.h>
70
71#ifdef __APPLE_API_UNSTABLE
1c79356b
A
72/*
73 * Sysctl values for the fast filesystem.
74 */
75#define FFS_CLUSTERREAD 1 /* cluster reading enabled */
76#define FFS_CLUSTERWRITE 2 /* cluster writing enabled */
77#define FFS_REALLOCBLKS 3 /* block reallocation enabled */
78#define FFS_ASYNCFREE 4 /* asynchronous block freeing enabled */
79#define FFS_MAXID 5 /* number of valid ffs ids */
80
81#define FFS_NAMES { \
82 { 0, 0 }, \
83 { "doclusterread", CTLTYPE_INT }, \
84 { "doclusterwrite", CTLTYPE_INT }, \
85 { "doreallocblks", CTLTYPE_INT }, \
86 { "doasyncfree", CTLTYPE_INT }, \
87}
9bccf70c 88#endif /* __APPLE_API_UNSTABLE */
1c79356b
A
89
90struct buf;
1c79356b
A
91struct fs;
92struct inode;
93struct mount;
94struct nameidata;
95struct proc;
91447636 96struct vfsstatfs;
1c79356b
A
97struct timeval;
98struct ucred;
99struct uio;
100struct vnode;
101struct mbuf;
102struct vfsconf;
103
9bccf70c 104#ifdef __APPLE_API_PRIVATE
1c79356b 105__BEGIN_DECLS
91447636
A
106int ffs_fsync_internal(vnode_t, int);
107
108int ffs_blkatoff(vnode_t, off_t, char **, buf_t *);
109
110int ffs_alloc(struct inode *,
111 ufs_daddr_t, ufs_daddr_t, int, struct ucred *, ufs_daddr_t *);
112int ffs_balloc(struct inode *,
113 ufs_daddr_t, int, struct ucred *, struct buf **, int, int *);
114void ffs_blkfree(struct inode *, ufs_daddr_t, long);
115ufs_daddr_t ffs_blkpref(struct inode *, ufs_daddr_t, int, ufs_daddr_t *);
116void ffs_clrblock(struct fs *, u_char *, ufs_daddr_t);
117int ffs_fhtovp(struct mount *, int, unsigned char *, struct vnode **, vfs_context_t);
118void ffs_fragacct(struct fs *, int, int32_t [], int);
119int ffs_fsync(struct vnop_fsync_args *);
120int ffs_init(struct vfsconf *);
121int ffs_isblock(struct fs *, u_char *, ufs_daddr_t);
122int ffs_mount(struct mount *, vnode_t , user_addr_t, vfs_context_t);
123int ffs_mountfs(struct vnode *, struct mount *, vfs_context_t);
124int ffs_mountroot(mount_t, vnode_t, vfs_context_t);
125int ffs_read(struct vnop_read_args *);
126int ffs_realloccg(struct inode *,
127 ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **);
128int ffs_reclaim(struct vnop_reclaim_args *);
129void ffs_setblock(struct fs *, u_char *, ufs_daddr_t);
130int ffs_vfs_getattr(struct mount *, struct vfs_attr *, vfs_context_t);
131int ffs_vfs_setattr(struct mount *, struct vfs_attr *, vfs_context_t);
132int ffs_sync(struct mount *, int, vfs_context_t);
133int ffs_sysctl(int *, u_int, user_addr_t, size_t *, user_addr_t, size_t, vfs_context_t);
134int ffs_unmount(struct mount *, int, vfs_context_t);
135int ffs_update(struct vnode *, struct timeval *, struct timeval *, int);
136int ffs_valloc(vnode_t dvp, mode_t mode, kauth_cred_t cred, vnode_t *vpp);
137int ffs_vfree(struct vnode *vp, ino_t ino, int mode);
138int ffs_vget(struct mount *, ino64_t, struct vnode **, vfs_context_t);
139int ffs_vptofh(struct vnode *, int *, unsigned char *, vfs_context_t);
140int ffs_write(struct vnop_write_args *);
141int ffs_pagein(struct vnop_pagein_args *);
142int ffs_pageout(struct vnop_pageout_args *);
143int ffs_blktooff(struct vnop_blktooff_args *);
144int ffs_offtoblk(struct vnop_offtoblk_args *);
1c79356b 145
1c79356b
A
146__END_DECLS
147
148extern int (**ffs_vnodeop_p)(void *);
149extern int (**ffs_specop_p)(void *);
150#if FIFO
151extern int (**ffs_fifoop_p)(void *);
152#define FFS_FIFOOPS ffs_fifoop_p
153#else
154#define FFS_FIFOOPS NULL
155#endif
9bccf70c
A
156
157#endif /* __APPLE_API_PRIVATE */
158#endif /* __UFS_FFS_FFS_EXTERN_H__ */