vnode_if.src revision 1.69.2.1 1 # $NetBSD: vnode_if.src,v 1.69.2.1 2017/03/20 06:57:48 pgoyette Exp $
2 #
3 # Copyright (c) 1992, 1993
4 # The Regents of the University of California. All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # 3. Neither the name of the University nor the names of its contributors
15 # may be used to endorse or promote products derived from this software
16 # without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 # SUCH DAMAGE.
29 #
30 # @(#)vnode_if.src 8.14 (Berkeley) 8/6/95
31 #
32 #
33
34 #
35 # Above each of the vop descriptors is a specification of the locking
36 # protocol used by each vop call. The first column is the name of
37 # the variable, the remaining three columns are in, out and error
38 # respectively. The "in" column defines the lock state on input,
39 # the "out" column defines the state on successful return, and the
40 # "error" column defines the locking state on error exit.
41 #
42 # The locking value can take the following values:
43 # L: locked.
44 # U: unlocked.
45 # -: not applicable. vnode does not yet (or no longer) exists.
46 # =: the same on input and output, may be either L or U.
47 # X: locked if not nil.
48 #
49 # For operations other than VOP_LOOKUP which require a component name
50 # parameter, the flags required for the initial namei() call are listed.
51 # Additional flags may be added to the namei() call, but these are required.
52 #
53
54 #
55 #% bwrite vp = = =
56 #
57 vop_bwrite {
58 IN struct vnode *vp;
59 IN struct buf *bp;
60 };
61
62 #
63 #% lookup dvp L L L
64 #% lookup vpp - U -
65 #
66 # Note especially that *vpp may equal dvp.
67 #
68 # More details:
69 # All lookups find the named node (creating the vnode if needed) and
70 # return it, referenced and unlocked, in *vpp.
71 # On failure, *vpp is NULL, and *dvp is left locked.
72 #
73 vop_lookup {
74 VERSION 2
75 IN LOCKED=YES struct vnode *dvp;
76 OUT WILLMAKE struct vnode **vpp;
77 IN struct componentname *cnp;
78 };
79
80 #
81 #% create dvp L L L
82 #% create vpp - U -
83 #
84 #! create cnp CREATE, LOCKPARENT
85 #
86 vop_create {
87 VERSION 3
88 IN LOCKED=YES struct vnode *dvp;
89 OUT WILLMAKE struct vnode **vpp;
90 IN struct componentname *cnp;
91 IN struct vattr *vap;
92 };
93
94 #
95 #% mknod dvp L L L
96 #% mknod vpp - U -
97 #
98 #! mknod cnp CREATE, LOCKPARENT
99 #
100 vop_mknod {
101 VERSION 3
102 IN LOCKED=YES struct vnode *dvp;
103 OUT WILLMAKE struct vnode **vpp;
104 IN struct componentname *cnp;
105 IN struct vattr *vap;
106 };
107
108 #
109 #% open vp L L L
110 #
111 vop_open {
112 IN LOCKED=YES struct vnode *vp;
113 IN int mode;
114 IN kauth_cred_t cred;
115 };
116
117 #
118 #% close vp L L L
119 #
120 vop_close {
121 IN LOCKED=YES struct vnode *vp;
122 IN int fflag;
123 IN kauth_cred_t cred;
124 };
125
126 #
127 #% access vp L L L
128 #
129 vop_access {
130 IN LOCKED=YES struct vnode *vp;
131 IN int mode;
132 IN kauth_cred_t cred;
133 };
134
135 #
136 #% getattr vp L L L
137 #
138 vop_getattr {
139 IN LOCKED=YES struct vnode *vp;
140 IN struct vattr *vap;
141 IN kauth_cred_t cred;
142 };
143
144 #
145 #% setattr vp L L L
146 #
147 vop_setattr {
148 IN LOCKED=YES struct vnode *vp;
149 IN struct vattr *vap;
150 IN kauth_cred_t cred;
151 };
152
153 #
154 #% read vp L L L
155 #
156 vop_read {
157 IN LOCKED=YES struct vnode *vp;
158 INOUT struct uio *uio;
159 IN int ioflag;
160 IN kauth_cred_t cred;
161 };
162
163 #
164 #% write vp L L L
165 #
166 vop_write {
167 IN LOCKED=YES struct vnode *vp;
168 INOUT struct uio *uio;
169 IN int ioflag;
170 IN kauth_cred_t cred;
171 };
172
173 #
174 #% fallocate vp L L L
175 #
176 vop_fallocate {
177 IN LOCKED=YES struct vnode *vp;
178 IN off_t pos;
179 IN off_t len;
180 };
181
182 #
183 #% fdiscard vp L L L
184 #
185 vop_fdiscard {
186 IN LOCKED=YES struct vnode *vp;
187 IN off_t pos;
188 IN off_t len;
189 };
190
191 #
192 #% ioctl vp U U U
193 #
194 vop_ioctl {
195 FSTRANS=NO
196 IN LOCKED=NO struct vnode *vp;
197 IN u_long command;
198 IN void *data;
199 IN int fflag;
200 IN kauth_cred_t cred;
201 };
202
203 #
204 #% fcntl vp U U U
205 #
206 vop_fcntl {
207 FSTRANS=NO
208 IN LOCKED=NO struct vnode *vp;
209 IN u_int command;
210 IN void *data;
211 IN int fflag;
212 IN kauth_cred_t cred;
213 };
214
215 #
216 #% poll vp U U U
217 #
218 vop_poll {
219 IN LOCKED=NO struct vnode *vp;
220 IN int events;
221 };
222
223 #
224 #% kqfilter vp U U U
225 #
226 vop_kqfilter {
227 IN LOCKED=NO struct vnode *vp;
228 IN struct knote *kn;
229 };
230
231 #
232 #% revoke vp U U U
233 #
234 vop_revoke {
235 FSTRANS=NO
236 IN LOCKED=NO struct vnode *vp;
237 IN int flags;
238 };
239
240 #
241 #% mmap vp = = =
242 #
243 vop_mmap {
244 IN struct vnode *vp;
245 IN vm_prot_t prot;
246 IN kauth_cred_t cred;
247 };
248
249 #
250 #% fsync vp L L L
251 #
252 vop_fsync {
253 IN LOCKED=YES struct vnode *vp;
254 IN kauth_cred_t cred;
255 IN int flags;
256 IN off_t offlo;
257 IN off_t offhi;
258 };
259
260 #
261 # Needs work: Is newoff right? What's it mean?
262 # XXX Locking protocol?
263 #
264 vop_seek {
265 IN struct vnode *vp;
266 IN off_t oldoff;
267 IN off_t newoff;
268 IN kauth_cred_t cred;
269 };
270
271 #
272 #% remove dvp L U U
273 #% remove vp L U U
274 #
275 #! remove cnp DELETE, LOCKPARENT | LOCKLEAF
276 #
277 vop_remove {
278 IN LOCKED=YES WILLPUT struct vnode *dvp;
279 IN LOCKED=YES WILLPUT struct vnode *vp;
280 IN struct componentname *cnp;
281 };
282
283 #
284 #% link dvp L L L
285 #% link vp U U U
286 #
287 #! link cnp CREATE, LOCKPARENT
288 #
289 vop_link {
290 VERSION 2
291 IN LOCKED=YES struct vnode *dvp;
292 IN LOCKED=NO struct vnode *vp;
293 IN struct componentname *cnp;
294 };
295
296 #
297 #% rename fdvp U U U
298 #% rename fvp U U U
299 #% rename tdvp L U U
300 #% rename tvp X U U
301 #
302 #! rename fcnp DELETE, LOCKPARENT
303 #! rename tcnp RENAME, LOCKPARENT | LOCKLEAF | NOCACHE
304 #
305 vop_rename {
306 IN LOCKED=NO WILLRELE struct vnode *fdvp;
307 IN LOCKED=NO WILLRELE struct vnode *fvp;
308 IN struct componentname *fcnp;
309 IN LOCKED=YES WILLPUT struct vnode *tdvp;
310 IN WILLPUT struct vnode *tvp;
311 IN struct componentname *tcnp;
312 };
313
314 #
315 #% mkdir dvp L L L
316 #% mkdir vpp - U -
317 #
318 #! mkdir cnp CREATE, LOCKPARENT
319 #
320 vop_mkdir {
321 VERSION 3
322 IN LOCKED=YES struct vnode *dvp;
323 OUT WILLMAKE struct vnode **vpp;
324 IN struct componentname *cnp;
325 IN struct vattr *vap;
326 };
327
328 #
329 #% rmdir dvp L U U
330 #% rmdir vp L U U
331 #
332 #! rmdir cnp DELETE, LOCKPARENT | LOCKLEAF
333 #
334 vop_rmdir {
335 IN LOCKED=YES WILLPUT struct vnode *dvp;
336 IN LOCKED=YES WILLPUT struct vnode *vp;
337 IN struct componentname *cnp;
338 };
339
340 #
341 #% symlink dvp L L L
342 #% symlink vpp - U -
343 #
344 #! symlink cnp CREATE, LOCKPARENT
345 #
346 vop_symlink {
347 VERSION 3
348 IN LOCKED=YES struct vnode *dvp;
349 OUT WILLMAKE struct vnode **vpp;
350 IN struct componentname *cnp;
351 IN struct vattr *vap;
352 IN char *target;
353 };
354
355 #
356 #% readdir vp L L L
357 #
358 vop_readdir {
359 IN LOCKED=YES struct vnode *vp;
360 INOUT struct uio *uio;
361 IN kauth_cred_t cred;
362 OUT int *eofflag;
363 OUT off_t **cookies;
364 IN int *ncookies;
365 };
366
367 #
368 #% readlink vp L L L
369 #
370 vop_readlink {
371 IN LOCKED=YES struct vnode *vp;
372 INOUT struct uio *uio;
373 IN kauth_cred_t cred;
374 };
375
376 #
377 #% abortop dvp = = =
378 #
379 #! abortop cnp as appropriate.
380 #
381 vop_abortop {
382 IN struct vnode *dvp;
383 IN struct componentname *cnp;
384 };
385
386 #
387 #% inactive vp L U U
388 #
389 vop_inactive {
390 IN LOCKED=YES WILLUNLOCK struct vnode *vp;
391 INOUT bool *recycle;
392 };
393
394 #
395 #% reclaim vp U U U
396 #
397 vop_reclaim {
398 FSTRANS=NO
399 IN LOCKED=NO struct vnode *vp;
400 };
401
402 #
403 #% lock vp U L U
404 #
405 vop_lock {
406 FSTRANS=NO
407 IN LOCKED=NO struct vnode *vp;
408 IN int flags;
409 };
410
411 #
412 #% unlock vp L U L
413 #
414 vop_unlock {
415 FSTRANS=NO
416 IN LOCKED=YES struct vnode *vp;
417 };
418
419 #
420 #% bmap vp = = =
421 #% bmap vpp - U -
422 #
423 vop_bmap {
424 IN struct vnode *vp;
425 IN daddr_t bn;
426 OUT struct vnode **vpp;
427 IN daddr_t *bnp;
428 OUT int *runp;
429 };
430
431 #
432 #% strategy vp = = =
433 #
434 vop_strategy {
435 IN struct vnode *vp;
436 IN struct buf *bp;
437 };
438
439 #
440 #% print vp = = =
441 #
442 vop_print {
443 IN struct vnode *vp;
444 };
445
446 #
447 #% islocked vp = = =
448 #
449 vop_islocked {
450 FSTRANS=NO
451 IN struct vnode *vp;
452 };
453
454 #
455 #% pathconf vp L L L
456 #
457 vop_pathconf {
458 IN LOCKED=YES struct vnode *vp;
459 IN int name;
460 OUT register_t *retval;
461 };
462
463 #
464 #% advlock vp U U U
465 #
466 vop_advlock {
467 IN LOCKED=NO struct vnode *vp;
468 IN void *id;
469 IN int op;
470 IN struct flock *fl;
471 IN int flags;
472 };
473
474 #
475 #% whiteout dvp L L L
476 #% whiteout cnp - - -
477 #% whiteout flag - - -
478 #
479 #! whiteout cnp CREATE, LOCKPARENT
480 #
481 vop_whiteout {
482 IN LOCKED=YES struct vnode *dvp;
483 IN struct componentname *cnp;
484 IN int flags;
485 };
486
487 #
488 #% getpages vp = = =
489 #
490 vop_getpages {
491 FSTRANS=NO
492 IN struct vnode *vp;
493 IN voff_t offset;
494 IN struct vm_page **m;
495 IN int *count;
496 IN int centeridx;
497 IN vm_prot_t access_type;
498 IN int advice;
499 IN int flags;
500 };
501
502 #
503 #% putpages vp = = =
504 #
505 vop_putpages {
506 FSTRANS=NO
507 IN struct vnode *vp;
508 IN voff_t offlo;
509 IN voff_t offhi;
510 IN int flags;
511 };
512
513 #
514 #% closeextattr vp L L L
515 #
516 vop_closeextattr {
517 IN LOCKED=YES struct vnode *vp;
518 IN int commit;
519 IN kauth_cred_t cred;
520 };
521
522 #
523 #% getextattr vp L L L
524 #
525 vop_getextattr {
526 IN LOCKED=YES struct vnode *vp;
527 IN int attrnamespace;
528 IN const char *name;
529 INOUT struct uio *uio;
530 OUT size_t *size;
531 IN kauth_cred_t cred;
532 };
533
534 #
535 #% listextattr vp L L L
536 #
537 vop_listextattr {
538 IN LOCKED=YES struct vnode *vp;
539 IN int attrnamespace;
540 INOUT struct uio *uio;
541 OUT size_t *size;
542 IN int flag;
543 IN kauth_cred_t cred;
544 };
545
546 #
547 #% openextattr vp L L L
548 #
549 vop_openextattr {
550 IN LOCKED=YES struct vnode *vp;
551 IN kauth_cred_t cred;
552 };
553
554 #
555 #% deleteextattr vp L L L
556 #
557 vop_deleteextattr {
558 IN LOCKED=YES struct vnode *vp;
559 IN int attrnamespace;
560 IN const char *name;
561 IN kauth_cred_t cred;
562 };
563
564 #
565 #% setextattr vp L L L
566 #
567 vop_setextattr {
568 IN LOCKED=YES struct vnode *vp;
569 IN int attrnamespace;
570 IN const char *name;
571 INOUT struct uio *uio;
572 IN kauth_cred_t cred;
573 };
574