vnode_if.src revision 1.74 1 # $NetBSD: vnode_if.src,v 1.74 2017/04/26 03:02:49 riastradh 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 L L
273 #% remove vp L U U
274 #
275 #! remove cnp DELETE, LOCKPARENT | LOCKLEAF
276 #
277 vop_remove {
278 VERSION 2
279 IN LOCKED=YES struct vnode *dvp;
280 IN LOCKED=YES WILLPUT struct vnode *vp;
281 IN struct componentname *cnp;
282 };
283
284 #
285 #% link dvp L L L
286 #% link vp U U U
287 #
288 #! link cnp CREATE, LOCKPARENT
289 #
290 vop_link {
291 VERSION 2
292 IN LOCKED=YES struct vnode *dvp;
293 IN LOCKED=NO struct vnode *vp;
294 IN struct componentname *cnp;
295 };
296
297 #
298 #% rename fdvp U U U
299 #% rename fvp U U U
300 #% rename tdvp L U U
301 #% rename tvp X U U
302 #
303 #! rename fcnp DELETE, LOCKPARENT
304 #! rename tcnp RENAME, LOCKPARENT | LOCKLEAF | NOCACHE
305 #
306 vop_rename {
307 IN LOCKED=NO WILLRELE struct vnode *fdvp;
308 IN LOCKED=NO WILLRELE struct vnode *fvp;
309 IN struct componentname *fcnp;
310 IN LOCKED=YES WILLPUT struct vnode *tdvp;
311 IN WILLPUT struct vnode *tvp;
312 IN struct componentname *tcnp;
313 };
314
315 #
316 #% mkdir dvp L L L
317 #% mkdir vpp - U -
318 #
319 #! mkdir cnp CREATE, LOCKPARENT
320 #
321 vop_mkdir {
322 VERSION 3
323 IN LOCKED=YES struct vnode *dvp;
324 OUT WILLMAKE struct vnode **vpp;
325 IN struct componentname *cnp;
326 IN struct vattr *vap;
327 };
328
329 #
330 #% rmdir dvp L L L
331 #% rmdir vp L U U
332 #
333 #! rmdir cnp DELETE, LOCKPARENT | LOCKLEAF
334 #
335 vop_rmdir {
336 VERSION 2
337 IN LOCKED=YES struct vnode *dvp;
338 IN LOCKED=YES WILLPUT struct vnode *vp;
339 IN struct componentname *cnp;
340 };
341
342 #
343 #% symlink dvp L L L
344 #% symlink vpp - U -
345 #
346 #! symlink cnp CREATE, LOCKPARENT
347 #
348 vop_symlink {
349 VERSION 3
350 IN LOCKED=YES struct vnode *dvp;
351 OUT WILLMAKE struct vnode **vpp;
352 IN struct componentname *cnp;
353 IN struct vattr *vap;
354 IN char *target;
355 };
356
357 #
358 #% readdir vp L L L
359 #
360 vop_readdir {
361 IN LOCKED=YES struct vnode *vp;
362 INOUT struct uio *uio;
363 IN kauth_cred_t cred;
364 OUT int *eofflag;
365 OUT off_t **cookies;
366 IN int *ncookies;
367 };
368
369 #
370 #% readlink vp L L L
371 #
372 vop_readlink {
373 IN LOCKED=YES struct vnode *vp;
374 INOUT struct uio *uio;
375 IN kauth_cred_t cred;
376 };
377
378 #
379 #% abortop dvp = = =
380 #
381 #! abortop cnp as appropriate.
382 #
383 vop_abortop {
384 IN struct vnode *dvp;
385 IN struct componentname *cnp;
386 };
387
388 #
389 #% inactive vp L L L
390 #
391 vop_inactive {
392 VERSION 2
393 IN LOCKED=YES struct vnode *vp;
394 INOUT bool *recycle;
395 };
396
397 #
398 #% reclaim vp U U U
399 #
400 vop_reclaim {
401 FSTRANS=NO
402 IN LOCKED=NO struct vnode *vp;
403 };
404
405 #
406 #% lock vp U L U
407 #
408 vop_lock {
409 FSTRANS=NO
410 IN LOCKED=NO struct vnode *vp;
411 IN int flags;
412 };
413
414 #
415 #% unlock vp L U L
416 #
417 vop_unlock {
418 FSTRANS=NO
419 IN LOCKED=YES struct vnode *vp;
420 };
421
422 #
423 #% bmap vp = = =
424 #% bmap vpp - U -
425 #
426 vop_bmap {
427 IN struct vnode *vp;
428 IN daddr_t bn;
429 OUT struct vnode **vpp;
430 IN daddr_t *bnp;
431 OUT int *runp;
432 };
433
434 #
435 #% strategy vp = = =
436 #
437 vop_strategy {
438 IN struct vnode *vp;
439 IN struct buf *bp;
440 };
441
442 #
443 #% print vp = = =
444 #
445 vop_print {
446 IN struct vnode *vp;
447 };
448
449 #
450 #% islocked vp = = =
451 #
452 vop_islocked {
453 FSTRANS=NO
454 IN struct vnode *vp;
455 };
456
457 #
458 #% pathconf vp L L L
459 #
460 vop_pathconf {
461 IN LOCKED=YES struct vnode *vp;
462 IN int name;
463 OUT register_t *retval;
464 };
465
466 #
467 #% advlock vp U U U
468 #
469 vop_advlock {
470 IN LOCKED=NO struct vnode *vp;
471 IN void *id;
472 IN int op;
473 IN struct flock *fl;
474 IN int flags;
475 };
476
477 #
478 #% whiteout dvp L L L
479 #% whiteout cnp - - -
480 #% whiteout flag - - -
481 #
482 #! whiteout cnp CREATE, LOCKPARENT
483 #
484 vop_whiteout {
485 IN LOCKED=YES struct vnode *dvp;
486 IN struct componentname *cnp;
487 IN int flags;
488 };
489
490 #
491 #% getpages vp = = =
492 #
493 vop_getpages {
494 FSTRANS=NO
495 IN struct vnode *vp;
496 IN voff_t offset;
497 IN struct vm_page **m;
498 IN int *count;
499 IN int centeridx;
500 IN vm_prot_t access_type;
501 IN int advice;
502 IN int flags;
503 };
504
505 #
506 #% putpages vp = = =
507 #
508 vop_putpages {
509 FSTRANS=NO
510 IN struct vnode *vp;
511 IN voff_t offlo;
512 IN voff_t offhi;
513 IN int flags;
514 };
515
516 #
517 #% closeextattr vp L L L
518 #
519 vop_closeextattr {
520 IN LOCKED=YES struct vnode *vp;
521 IN int commit;
522 IN kauth_cred_t cred;
523 };
524
525 #
526 #% getextattr vp L L L
527 #
528 vop_getextattr {
529 IN LOCKED=YES struct vnode *vp;
530 IN int attrnamespace;
531 IN const char *name;
532 INOUT struct uio *uio;
533 OUT size_t *size;
534 IN kauth_cred_t cred;
535 };
536
537 #
538 #% listextattr vp L L L
539 #
540 vop_listextattr {
541 IN LOCKED=YES struct vnode *vp;
542 IN int attrnamespace;
543 INOUT struct uio *uio;
544 OUT size_t *size;
545 IN int flag;
546 IN kauth_cred_t cred;
547 };
548
549 #
550 #% openextattr vp L L L
551 #
552 vop_openextattr {
553 IN LOCKED=YES struct vnode *vp;
554 IN kauth_cred_t cred;
555 };
556
557 #
558 #% deleteextattr vp L L L
559 #
560 vop_deleteextattr {
561 IN LOCKED=YES struct vnode *vp;
562 IN int attrnamespace;
563 IN const char *name;
564 IN kauth_cred_t cred;
565 };
566
567 #
568 #% setextattr vp L L L
569 #
570 vop_setextattr {
571 IN LOCKED=YES struct vnode *vp;
572 IN int attrnamespace;
573 IN const char *name;
574 INOUT struct uio *uio;
575 IN kauth_cred_t cred;
576 };
577