filecore_extern.h revision 1.1.2.2 1 /* $NetBSD: filecore_extern.h,v 1.1.2.2 2002/12/29 19:55:48 thorpej Exp $ */
2
3 /*-
4 * Copyright (c) 1998 Andrew McMurry
5 * Copyright (c) 1994 The Regents of the University of California.
6 * 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. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * filecore_extern.h 1.1 1998/6/26
37 */
38
39 /*
40 * Definitions used in the kernel for Acorn Filecore file system support.
41 */
42
43 #ifndef FILECOREMNT_ROOT
44 #define FILECOREMNT_ROOT 0
45 #endif
46
47 struct filecore_mnt {
48 struct mount *fc_mountp;
49 dev_t fc_dev;
50 struct vnode *fc_devvp;
51
52 u_int32_t blksize;
53 u_int32_t log2bsize;
54 u_int32_t map;
55 u_int32_t idspz;
56 u_int32_t mask;
57 u_int64_t nblks;
58
59 uid_t fc_uid; /* uid to set as owner of the files */
60 gid_t fc_gid; /* gid to set as owner of the files */
61 int fc_mntflags;
62 struct netexport fc_export;
63 struct filecore_disc_record drec;
64 };
65
66 #define VFSTOFILECORE(mp) ((struct filecore_mnt *)((mp)->mnt_data))
67
68 #define blkoff(fcp, loc) ((loc) & ((fcp)->blksize-1))
69 #define lblktosize(fcp, blk) ((blk) << (fcp)->log2bsize)
70 #define lblkno(fcp, loc) ((loc) >> (fcp)->log2bsize)
71 #define blksize(fcp, ip, lbn) ((fcp)->blksize)
72
73 extern struct pool filecore_node_pool;
74
75 int filecore_mount __P((struct mount *,
76 const char *, void *, struct nameidata *, struct proc *));
77 int filecore_start __P((struct mount *, int, struct proc *));
78 int filecore_unmount __P((struct mount *, int, struct proc *));
79 int filecore_root __P((struct mount *, struct vnode **));
80 int filecore_quotactl __P((struct mount *, int, uid_t, caddr_t, struct proc *));
81 int filecore_statfs __P((struct mount *, struct statfs *, struct proc *));
82 int filecore_sync __P((struct mount *, int, struct ucred *, struct proc *));
83 int filecore_vget __P((struct mount *, ino_t, struct vnode **));
84 int filecore_fhtovp __P((struct mount *, struct fid *, struct vnode **));
85 int filecore_checkexp __P((struct mount *, struct mbuf *, int *,
86 struct ucred **));
87 int filecore_vptofh __P((struct vnode *, struct fid *));
88 void filecore_init __P((void));
89 void filecore_reinit __P((void));
90 void filecore_done __P((void));
91 int filecore_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
92 struct proc *));
93
94 extern int (**filecore_vnodeop_p) __P((void *));
95
96 int filecore_bbchecksum __P((void *));
97 int filecore_bread __P((struct filecore_mnt *, u_int32_t, int, struct ucred *,
98 struct buf **));
99 int filecore_map __P((struct filecore_mnt *, u_int32_t, daddr_t, daddr_t *));
100