This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / sys / ufs / mfsnode.h
CommitLineData
15637ed4
RG
1/*
2 * Copyright (c) 1989 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1eb58e01 33 * from: @(#)mfsnode.h 7.3 (Berkeley) 4/16/91
4c45483e 34 * $Id: mfsnode.h,v 1.3 1993/11/07 17:53:42 wollman Exp $
15637ed4
RG
35 */
36
bbc3f849
GW
37#ifndef _UFS_MFSNODE_H_
38#define _UFS_MFSNODE_H_ 1
39
15637ed4
RG
40/*
41 * This structure defines the control data for the memory
42 * based file system.
43 */
44
45struct mfsnode {
46 struct vnode *mfs_vnode; /* vnode associated with this mfsnode */
47 caddr_t mfs_baseoff; /* base of file system in memory */
48 long mfs_size; /* size of memory file system */
49 pid_t mfs_pid; /* supporting process pid */
50 struct buf *mfs_buflist; /* list of I/O requests */
51 long mfs_spare[4];
52};
53
54/*
55 * Convert between mfsnode pointers and vnode pointers
56 */
57#define VTOMFS(vp) ((struct mfsnode *)(vp)->v_data)
58#define MFSTOV(mfsp) ((mfsp)->mfs_vnode)
59
60/*
61 * Prototypes for MFS operations on vnodes.
62 */
63int mfs_badop();
64#define mfs_lookup ((int (*) __P(( \
65 struct vnode *vp, \
66 struct nameidata *ndp, \
67 struct proc *p))) mfs_badop)
68#define mfs_create ((int (*) __P(( \
69 struct nameidata *ndp, \
70 struct vattr *vap, \
71 struct proc *p))) mfs_badop)
72#define mfs_mknod ((int (*) __P(( \
73 struct nameidata *ndp, \
74 struct vattr *vap, \
75 struct ucred *cred, \
76 struct proc *p))) mfs_badop)
77int mfs_open __P((
78 struct vnode *vp,
79 int mode,
80 struct ucred *cred,
81 struct proc *p));
82int mfs_close __P((
83 struct vnode *vp,
84 int fflag,
85 struct ucred *cred,
86 struct proc *p));
87#define mfs_access ((int (*) __P(( \
88 struct vnode *vp, \
89 int mode, \
90 struct ucred *cred, \
91 struct proc *p))) mfs_badop)
92#define mfs_getattr ((int (*) __P(( \
93 struct vnode *vp, \
94 struct vattr *vap, \
95 struct ucred *cred, \
96 struct proc *p))) mfs_badop)
97#define mfs_setattr ((int (*) __P(( \
98 struct vnode *vp, \
99 struct vattr *vap, \
100 struct ucred *cred, \
101 struct proc *p))) mfs_badop)
102#define mfs_read ((int (*) __P(( \
103 struct vnode *vp, \
104 struct uio *uio, \
105 int ioflag, \
106 struct ucred *cred))) mfs_badop)
107#define mfs_write ((int (*) __P(( \
108 struct vnode *vp, \
109 struct uio *uio, \
110 int ioflag, \
111 struct ucred *cred))) mfs_badop)
112int mfs_ioctl __P((
113 struct vnode *vp,
114 int command,
115 caddr_t data,
116 int fflag,
117 struct ucred *cred,
118 struct proc *p));
119#define mfs_select ((int (*) __P(( \
120 struct vnode *vp, \
121 int which, \
122 int fflags, \
123 struct ucred *cred, \
124 struct proc *p))) mfs_badop)
125#define mfs_mmap ((int (*) __P(( \
126 struct vnode *vp, \
127 int fflags, \
128 struct ucred *cred, \
129 struct proc *p))) mfs_badop)
130#define mfs_fsync ((int (*) __P(( \
131 struct vnode *vp, \
132 int fflags, \
133 struct ucred *cred, \
134 int waitfor, \
135 struct proc *p))) mfs_badop)
136#define mfs_seek ((int (*) __P(( \
137 struct vnode *vp, \
138 off_t oldoff, \
139 off_t newoff, \
140 struct ucred *cred))) mfs_badop)
141#define mfs_remove ((int (*) __P(( \
142 struct nameidata *ndp, \
143 struct proc *p))) mfs_badop)
144#define mfs_link ((int (*) __P(( \
145 struct vnode *vp, \
146 struct nameidata *ndp, \
147 struct proc *p))) mfs_badop)
148#define mfs_rename ((int (*) __P(( \
149 struct nameidata *fndp, \
150 struct nameidata *tdnp, \
151 struct proc *p))) mfs_badop)
152#define mfs_mkdir ((int (*) __P(( \
153 struct nameidata *ndp, \
154 struct vattr *vap, \
155 struct proc *p))) mfs_badop)
156#define mfs_rmdir ((int (*) __P(( \
157 struct nameidata *ndp, \
158 struct proc *p))) mfs_badop)
159#define mfs_symlink ((int (*) __P(( \
160 struct nameidata *ndp, \
161 struct vattr *vap, \
162 char *target, \
163 struct proc *p))) mfs_badop)
164#define mfs_readdir ((int (*) __P(( \
165 struct vnode *vp, \
166 struct uio *uio, \
167 struct ucred *cred, \
168 int *eofflagp))) mfs_badop)
169#define mfs_readlink ((int (*) __P(( \
170 struct vnode *vp, \
171 struct uio *uio, \
172 struct ucred *cred))) mfs_badop)
173#define mfs_abortop ((int (*) __P(( \
174 struct nameidata *ndp))) mfs_badop)
175int mfs_inactive __P((
176 struct vnode *vp,
177 struct proc *p));
178#define mfs_reclaim ((int (*) __P(( \
179 struct vnode *vp))) nullop)
180#define mfs_lock ((int (*) __P(( \
181 struct vnode *vp))) nullop)
182#define mfs_unlock ((int (*) __P(( \
183 struct vnode *vp))) nullop)
184int mfs_bmap __P((
185 struct vnode *vp,
186 daddr_t bn,
187 struct vnode **vpp,
188 daddr_t *bnp));
189int mfs_strategy __P((
190 struct buf *bp));
4c45483e 191void mfs_print __P((
15637ed4
RG
192 struct vnode *vp));
193#define mfs_islocked ((int (*) __P(( \
194 struct vnode *vp))) nullop)
195#define mfs_advlock ((int (*) __P(( \
196 struct vnode *vp, \
197 caddr_t id, \
198 int op, \
199 struct flock *fl, \
200 int flags))) mfs_badop)
4c45483e
GW
201
202void mfs_doio(struct buf *, caddr_t);
203
bbc3f849 204#endif /* _UFS_MFSNODE_H_ */