filecore_extern.h revision 1.4.2.8 1 /* $NetBSD: filecore_extern.h,v 1.4.2.8 2005/11/10 14:09:27 skrll Exp $ */
2
3 /*-
4 * Copyright (c) 1994 The Regents of the University of California.
5 * 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. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * filecore_extern.h 1.1 1998/6/26
32 */
33
34 /*-
35 * Copyright (c) 1998 Andrew McMurry
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by the University of
48 * California, Berkeley and its contributors.
49 * 4. Neither the name of the University nor the names of its contributors
50 * may be used to endorse or promote products derived from this software
51 * without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE.
64 *
65 * filecore_extern.h 1.1 1998/6/26
66 */
67
68 /*
69 * Definitions used in the kernel for Acorn Filecore file system support.
70 */
71
72 #ifndef FILECOREMNT_ROOT
73 #define FILECOREMNT_ROOT 0
74 #endif
75
76 #include <sys/mallocvar.h>
77
78 MALLOC_DECLARE(M_FILECOREMNT);
79
80 struct filecore_mnt {
81 struct mount *fc_mountp;
82 dev_t fc_dev;
83 struct vnode *fc_devvp;
84
85 u_int32_t blksize;
86 u_int32_t log2bsize;
87 u_int32_t map;
88 u_int32_t idspz;
89 u_int32_t mask;
90 u_int64_t nblks;
91
92 uid_t fc_uid; /* uid to set as owner of the files */
93 gid_t fc_gid; /* gid to set as owner of the files */
94 int fc_mntflags;
95 struct filecore_disc_record drec;
96 };
97
98 #define VFSTOFILECORE(mp) ((struct filecore_mnt *)((mp)->mnt_data))
99
100 #define blkoff(fcp, loc) ((loc) & ((fcp)->blksize-1))
101 #define lblktosize(fcp, blk) ((blk) << (fcp)->log2bsize)
102 #define lblkno(fcp, loc) ((loc) >> (fcp)->log2bsize)
103 #define blksize(fcp, ip, lbn) ((fcp)->blksize)
104
105 extern struct pool filecore_node_pool;
106
107 int filecore_mount __P((struct mount *,
108 const char *, void *, struct nameidata *, struct lwp *));
109 int filecore_start __P((struct mount *, int, struct lwp *));
110 int filecore_unmount __P((struct mount *, int, struct lwp *));
111 int filecore_root __P((struct mount *, struct vnode **));
112 int filecore_quotactl __P((struct mount *, int, uid_t, void *, struct lwp *));
113 int filecore_statvfs __P((struct mount *, struct statvfs *, struct lwp *));
114 int filecore_sync __P((struct mount *, int, struct ucred *, struct lwp *));
115 int filecore_vget __P((struct mount *, ino_t, struct vnode **));
116 int filecore_fhtovp __P((struct mount *, struct fid *, struct vnode **));
117 int filecore_checkexp __P((struct mount *, struct mbuf *, int *,
118 struct ucred **));
119 int filecore_vptofh __P((struct vnode *, struct fid *));
120 void filecore_init __P((void));
121 void filecore_reinit __P((void));
122 void filecore_done __P((void));
123
124 #ifdef SYSCTL_SETUP_PROTO
125 SYSCTL_SETUP_PROTO(sysctl_vfs_filecore_setup);
126 #endif /* SYSCTL_SETUP_PROTO */
127
128 extern int (**filecore_vnodeop_p) __P((void *));
129
130 int filecore_bbchecksum __P((void *));
131 int filecore_bread __P((struct filecore_mnt *, u_int32_t, int, struct ucred *,
132 struct buf **));
133 int filecore_map __P((struct filecore_mnt *, u_int32_t, daddr_t, daddr_t *));
134