Commit | Line | Data |
---|---|---|
a4b514e3 | 1 | # |
71098a02 KB |
2 | # Copyright (c) 1992, 1993 |
3 | # The Regents of the University of California. All rights reserved. | |
a4b514e3 KM |
4 | # |
5 | # %sccs.include.redist.sh% | |
6 | # | |
7989fcd9 | 7 | # @(#)vnode_if.src 8.7 (Berkeley) %G% |
97484e7e JSP |
8 | # |
9 | ||
10 | # | |
11 | # Above each of the vop descriptors is a specification of the locking | |
12 | # protocol used by each vop call. The first column is the name of | |
13 | # the variable, the remaining three columns are in, out and error | |
14 | # respectively. The "in" column defines the lock state on input, | |
15 | # the "out" column defines the state on succesful return, and the | |
16 | # "error" column defines the locking state on error exit. | |
17 | # | |
18 | # The locking value can take the following values: | |
19 | # L: locked. | |
20 | # U: unlocked/ | |
21 | # -: not applicable. vnode does not yet (or no longer) exists. | |
22 | # =: the same on input and output, may be either L or U. | |
23 | # X: locked if not nil. | |
24 | # | |
25 | ||
26 | # | |
27 | #% lookup dvp L ? ? | |
28 | #% lookup vpp - L - | |
29 | # | |
30 | # XXX - the lookup locking protocol defies simple description and depends | |
31 | # on the flags and operation fields in the (cnp) structure. Note | |
32 | # especially that *vpp may equal dvp and both may be locked. | |
a4b514e3 KM |
33 | # |
34 | vop_lookup { | |
35 | IN struct vnode *dvp; | |
2b83eebf | 36 | INOUT struct vnode **vpp; |
a4b514e3 KM |
37 | IN struct componentname *cnp; |
38 | }; | |
39 | ||
97484e7e JSP |
40 | # |
41 | #% create dvp L U U | |
42 | #% create vpp - L - | |
43 | # | |
a4b514e3 | 44 | vop_create { |
c717e4c0 | 45 | IN WILLRELE struct vnode *dvp; |
a4b514e3 KM |
46 | OUT struct vnode **vpp; |
47 | IN struct componentname *cnp; | |
48 | IN struct vattr *vap; | |
49 | }; | |
50 | ||
0411e53b JSP |
51 | # |
52 | #% whiteout dvp L L L | |
53 | #% whiteout cnp - - - | |
54 | #% whiteout flag - - - | |
55 | vop_whiteout { | |
56 | IN WILLRELE struct vnode *dvp; | |
57 | IN struct componentname *cnp; | |
58 | IN int flags; | |
59 | }; | |
60 | ||
97484e7e JSP |
61 | # |
62 | #% mknod dvp L U U | |
63 | #% mknod vpp - X - | |
64 | # | |
a4b514e3 | 65 | vop_mknod { |
c717e4c0 JH |
66 | IN WILLRELE struct vnode *dvp; |
67 | OUT WILLRELE struct vnode **vpp; | |
a4b514e3 KM |
68 | IN struct componentname *cnp; |
69 | IN struct vattr *vap; | |
70 | }; | |
71 | ||
97484e7e JSP |
72 | # |
73 | #% open vp L L L | |
74 | # | |
a4b514e3 KM |
75 | vop_open { |
76 | IN struct vnode *vp; | |
77 | IN int mode; | |
78 | IN struct ucred *cred; | |
79 | IN struct proc *p; | |
80 | }; | |
81 | ||
97484e7e JSP |
82 | # |
83 | #% close vp U U U | |
84 | # | |
a4b514e3 KM |
85 | vop_close { |
86 | IN struct vnode *vp; | |
87 | IN int fflag; | |
88 | IN struct ucred *cred; | |
89 | IN struct proc *p; | |
90 | }; | |
91 | ||
97484e7e JSP |
92 | # |
93 | #% access vp L L L | |
94 | # | |
a4b514e3 KM |
95 | vop_access { |
96 | IN struct vnode *vp; | |
97 | IN int mode; | |
98 | IN struct ucred *cred; | |
99 | IN struct proc *p; | |
100 | }; | |
101 | ||
97484e7e JSP |
102 | # |
103 | #% getattr vp = = = | |
104 | # | |
a4b514e3 KM |
105 | vop_getattr { |
106 | IN struct vnode *vp; | |
107 | IN struct vattr *vap; | |
108 | IN struct ucred *cred; | |
109 | IN struct proc *p; | |
110 | }; | |
111 | ||
97484e7e JSP |
112 | # |
113 | #% setattr vp L L L | |
114 | # | |
a4b514e3 KM |
115 | vop_setattr { |
116 | IN struct vnode *vp; | |
117 | IN struct vattr *vap; | |
118 | IN struct ucred *cred; | |
119 | IN struct proc *p; | |
120 | }; | |
121 | ||
97484e7e JSP |
122 | # |
123 | #% read vp L L L | |
124 | # | |
a4b514e3 KM |
125 | vop_read { |
126 | IN struct vnode *vp; | |
127 | INOUT struct uio *uio; | |
128 | IN int ioflag; | |
129 | IN struct ucred *cred; | |
130 | }; | |
131 | ||
97484e7e JSP |
132 | # |
133 | #% write vp L L L | |
134 | # | |
a4b514e3 KM |
135 | vop_write { |
136 | IN struct vnode *vp; | |
137 | INOUT struct uio *uio; | |
138 | IN int ioflag; | |
139 | IN struct ucred *cred; | |
140 | }; | |
141 | ||
7989fcd9 KM |
142 | # |
143 | #% lease vp = = = | |
144 | # | |
145 | vop_lease { | |
146 | IN struct vnode *vp; | |
147 | IN struct proc *p; | |
148 | IN struct ucred *cred; | |
149 | IN int flag; | |
150 | }; | |
151 | ||
97484e7e JSP |
152 | # |
153 | #% ioctl vp U U U | |
154 | # | |
a4b514e3 KM |
155 | vop_ioctl { |
156 | IN struct vnode *vp; | |
157 | IN int command; | |
158 | IN caddr_t data; | |
159 | IN int fflag; | |
160 | IN struct ucred *cred; | |
161 | IN struct proc *p; | |
162 | }; | |
163 | ||
97484e7e JSP |
164 | # |
165 | #% select vp U U U | |
166 | # | |
a4b514e3 KM |
167 | # Needs work? (fflags) |
168 | vop_select { | |
169 | IN struct vnode *vp; | |
170 | IN int which; | |
171 | IN int fflags; | |
172 | IN struct ucred *cred; | |
173 | IN struct proc *p; | |
174 | }; | |
175 | ||
97484e7e | 176 | # XXX - not used |
a4b514e3 KM |
177 | vop_mmap { |
178 | IN struct vnode *vp; | |
179 | IN int fflags; | |
180 | IN struct ucred *cred; | |
181 | IN struct proc *p; | |
182 | }; | |
183 | ||
97484e7e JSP |
184 | # |
185 | #% fsync vp L L L | |
186 | # | |
a4b514e3 KM |
187 | vop_fsync { |
188 | IN struct vnode *vp; | |
189 | IN struct ucred *cred; | |
190 | IN int waitfor; | |
191 | IN struct proc *p; | |
192 | }; | |
193 | ||
97484e7e | 194 | # XXX - not used |
a4b514e3 KM |
195 | # Needs word: Is newoff right? What's it mean? |
196 | vop_seek { | |
197 | IN struct vnode *vp; | |
198 | IN off_t oldoff; | |
199 | IN off_t newoff; | |
200 | IN struct ucred *cred; | |
201 | }; | |
202 | ||
97484e7e JSP |
203 | # |
204 | #% remove dvp L U U | |
205 | #% remove vp L U U | |
206 | # | |
a4b514e3 | 207 | vop_remove { |
c717e4c0 JH |
208 | IN WILLRELE struct vnode *dvp; |
209 | IN WILLRELE struct vnode *vp; | |
a4b514e3 KM |
210 | IN struct componentname *cnp; |
211 | }; | |
212 | ||
97484e7e JSP |
213 | # |
214 | #% link vp L U U | |
215 | #% link tdvp U U U | |
216 | # | |
a4b514e3 | 217 | vop_link { |
c717e4c0 | 218 | IN WILLRELE struct vnode *vp; |
a4b514e3 KM |
219 | IN struct vnode *tdvp; |
220 | IN struct componentname *cnp; | |
221 | }; | |
222 | ||
97484e7e JSP |
223 | # |
224 | #% rename fdvp U U U | |
225 | #% rename fvp U U U | |
226 | #% rename tdvp L U U | |
227 | #% rename tvp X U U | |
228 | # | |
a4b514e3 | 229 | vop_rename { |
c717e4c0 JH |
230 | IN WILLRELE struct vnode *fdvp; |
231 | IN WILLRELE struct vnode *fvp; | |
a4b514e3 | 232 | IN struct componentname *fcnp; |
c717e4c0 JH |
233 | IN WILLRELE struct vnode *tdvp; |
234 | IN WILLRELE struct vnode *tvp; | |
a4b514e3 KM |
235 | IN struct componentname *tcnp; |
236 | }; | |
237 | ||
97484e7e JSP |
238 | # |
239 | #% mkdir dvp L U U | |
240 | #% mkdir vpp - L - | |
241 | # | |
a4b514e3 | 242 | vop_mkdir { |
c717e4c0 | 243 | IN WILLRELE struct vnode *dvp; |
a4b514e3 KM |
244 | OUT struct vnode **vpp; |
245 | IN struct componentname *cnp; | |
246 | IN struct vattr *vap; | |
247 | }; | |
248 | ||
97484e7e JSP |
249 | # |
250 | #% rmdir dvp L U U | |
251 | #% rmdir vp L U U | |
252 | # | |
a4b514e3 | 253 | vop_rmdir { |
c717e4c0 JH |
254 | IN WILLRELE struct vnode *dvp; |
255 | IN WILLRELE struct vnode *vp; | |
a4b514e3 KM |
256 | IN struct componentname *cnp; |
257 | }; | |
258 | ||
97484e7e JSP |
259 | # |
260 | #% symlink dvp L U U | |
261 | #% symlink vpp - U - | |
262 | # XXX - note that the return vnode has already been VRELE'ed | |
263 | # by the filesystem layer. To use it you must use vget, | |
264 | # possibly with a further namei. | |
265 | # | |
a4b514e3 | 266 | vop_symlink { |
c717e4c0 JH |
267 | IN WILLRELE struct vnode *dvp; |
268 | OUT WILLRELE struct vnode **vpp; | |
a4b514e3 KM |
269 | IN struct componentname *cnp; |
270 | IN struct vattr *vap; | |
271 | IN char *target; | |
272 | }; | |
273 | ||
97484e7e JSP |
274 | # |
275 | #% readdir vp L L L | |
276 | # | |
a4b514e3 KM |
277 | vop_readdir { |
278 | IN struct vnode *vp; | |
279 | INOUT struct uio *uio; | |
280 | IN struct ucred *cred; | |
7af5ed71 KM |
281 | INOUT int *eofflag; |
282 | OUT u_long *cookies; | |
283 | IN int ncookies; | |
a4b514e3 KM |
284 | }; |
285 | ||
97484e7e JSP |
286 | # |
287 | #% readlink vp L L L | |
288 | # | |
a4b514e3 KM |
289 | vop_readlink { |
290 | IN struct vnode *vp; | |
291 | INOUT struct uio *uio; | |
292 | IN struct ucred *cred; | |
293 | }; | |
294 | ||
97484e7e JSP |
295 | # |
296 | #% abortop dvp = = = | |
297 | # | |
a4b514e3 KM |
298 | vop_abortop { |
299 | IN struct vnode *dvp; | |
300 | IN struct componentname *cnp; | |
301 | }; | |
302 | ||
97484e7e JSP |
303 | # |
304 | #% inactive vp U U U | |
305 | # | |
a4b514e3 KM |
306 | vop_inactive { |
307 | IN struct vnode *vp; | |
308 | }; | |
309 | ||
97484e7e JSP |
310 | # |
311 | #% reclaim vp U U U | |
312 | # | |
a4b514e3 KM |
313 | vop_reclaim { |
314 | IN struct vnode *vp; | |
315 | }; | |
316 | ||
97484e7e JSP |
317 | # |
318 | #% lock vp U L U | |
319 | # | |
a4b514e3 KM |
320 | vop_lock { |
321 | IN struct vnode *vp; | |
322 | }; | |
323 | ||
97484e7e JSP |
324 | # |
325 | #% unlock vp L U L | |
326 | # | |
a4b514e3 KM |
327 | vop_unlock { |
328 | IN struct vnode *vp; | |
329 | }; | |
330 | ||
97484e7e JSP |
331 | # |
332 | #% bmap vp L L L | |
333 | #% bmap vpp - U - | |
334 | # | |
a4b514e3 KM |
335 | vop_bmap { |
336 | IN struct vnode *vp; | |
337 | IN daddr_t bn; | |
338 | OUT struct vnode **vpp; | |
339 | IN daddr_t *bnp; | |
2b84022a | 340 | OUT int *runp; |
a4b514e3 KM |
341 | }; |
342 | ||
343 | #vop_strategy { | |
344 | # IN struct buf *bp; | |
345 | #}; | |
346 | ||
97484e7e JSP |
347 | # |
348 | #% print vp = = = | |
349 | # | |
a4b514e3 KM |
350 | vop_print { |
351 | IN struct vnode *vp; | |
352 | }; | |
353 | ||
97484e7e JSP |
354 | # |
355 | #% islocked vp = = = | |
356 | # | |
a4b514e3 KM |
357 | vop_islocked { |
358 | IN struct vnode *vp; | |
359 | }; | |
360 | ||
97484e7e JSP |
361 | # |
362 | #% pathconf vp L L L | |
363 | # | |
9195aad9 KM |
364 | vop_pathconf { |
365 | IN struct vnode *vp; | |
366 | IN int name; | |
367 | OUT int *retval; | |
368 | }; | |
369 | ||
97484e7e JSP |
370 | # |
371 | #% advlock vp U U U | |
372 | # | |
a4b514e3 KM |
373 | vop_advlock { |
374 | IN struct vnode *vp; | |
375 | IN caddr_t id; | |
376 | IN int op; | |
377 | IN struct flock *fl; | |
378 | IN int flags; | |
379 | }; | |
380 | ||
97484e7e JSP |
381 | # |
382 | #% blkatoff vp L L L | |
383 | # | |
a4b514e3 KM |
384 | vop_blkatoff { |
385 | IN struct vnode *vp; | |
386 | IN off_t offset; | |
387 | OUT char **res; | |
388 | OUT struct buf **bpp; | |
389 | }; | |
390 | ||
97484e7e JSP |
391 | # |
392 | #% valloc pvp L L L | |
393 | # | |
a4b514e3 KM |
394 | vop_valloc { |
395 | IN struct vnode *pvp; | |
396 | IN int mode; | |
397 | IN struct ucred *cred; | |
398 | OUT struct vnode **vpp; | |
399 | }; | |
400 | ||
97484e7e JSP |
401 | # |
402 | #% reallocblks vp L L L | |
403 | # | |
a55504bc KM |
404 | vop_reallocblks { |
405 | IN struct vnode *vp; | |
406 | IN struct cluster_save *buflist; | |
407 | }; | |
408 | ||
97484e7e JSP |
409 | # |
410 | #% vfree pvp L L L | |
411 | # | |
a4b514e3 KM |
412 | vop_vfree { |
413 | IN struct vnode *pvp; | |
414 | IN ino_t ino; | |
415 | IN int mode; | |
416 | }; | |
417 | ||
97484e7e JSP |
418 | # |
419 | #% truncate vp L L L | |
420 | # | |
a4b514e3 KM |
421 | vop_truncate { |
422 | IN struct vnode *vp; | |
423 | IN off_t length; | |
424 | IN int flags; | |
425 | IN struct ucred *cred; | |
426 | IN struct proc *p; | |
427 | }; | |
428 | ||
97484e7e JSP |
429 | # |
430 | #% update vp L L L | |
431 | # | |
a4b514e3 KM |
432 | vop_update { |
433 | IN struct vnode *vp; | |
6c1c42d5 KB |
434 | IN struct timeval *access; |
435 | IN struct timeval *modify; | |
a4b514e3 KM |
436 | IN int waitfor; |
437 | }; | |
438 | ||
439 | # Needs work: no vp? | |
440 | #vop_bwrite { | |
441 | # IN struct buf *bp; | |
442 | #}; |