]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/kern/vnode_if.src
MFC r287831 (by cem):
[FreeBSD/stable/10.git] / sys / kern / vnode_if.src
1 #-
2 # Copyright (c) 1992, 1993
3 #       The Regents of the University of California.  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 # 4. Neither the name of the University nor the names of its contributors
14 #    may be used to endorse or promote products derived from this software
15 #    without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 # SUCH DAMAGE.
28 #
29 #       @(#)vnode_if.src        8.12 (Berkeley) 5/14/95
30 # $FreeBSD$
31 #
32
33 #
34 # Above each of the vop descriptors in lines starting with %%
35 # is a specification of the locking protocol used by each vop call.
36 # The first column is the name of the variable, the remaining three
37 # columns are in, out and error respectively.  The "in" column defines
38 # the lock state on input, the "out" column defines the state on succesful
39 # return, and the "error" column defines the locking state on error exit.
40 #
41 # The locking value can take the following values:
42 # L: locked; not converted to type of lock.
43 # A: any lock type.
44 # S: locked with shared lock.
45 # E: locked with exclusive lock for this process.
46 # O: locked with exclusive lock for other process.
47 # U: unlocked.
48 # -: not applicable.  vnode does not yet (or no longer) exists.
49 # =: the same on input and output, may be either L or U.
50 # X: locked if not nil.
51 #
52 # The paramater named "vpp" is assumed to be always used with double
53 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
54 #
55 # Lines starting with %! specify a pre or post-condition function
56 # to call before/after the vop call.
57 #
58 # If other such parameters are introduced, they have to be added to
59 # the AWK script at the head of the definition of "add_debug_code()".
60 #
61
62 vop_islocked {
63         IN struct vnode *vp;
64 };
65
66 %% lookup       dvp     L L L
67 %% lookup       vpp     - L -
68
69 # XXX - the lookup locking protocol defies simple description and depends
70 #       on the flags and operation fields in the (cnp) structure.  Note
71 #       especially that *vpp may equal dvp and both may be locked.
72
73 vop_lookup {
74         IN struct vnode *dvp;
75         INOUT struct vnode **vpp;
76         IN struct componentname *cnp;
77 };
78
79 %% cachedlookup dvp     L L L
80 %% cachedlookup vpp     - L -
81
82 # This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
83
84 vop_cachedlookup {
85         IN struct vnode *dvp;
86         INOUT struct vnode **vpp;
87         IN struct componentname *cnp;
88 };
89
90 %% create       dvp     E E E
91 %% create       vpp     - L -
92 %! create       post    vop_create_post
93
94 vop_create {
95         IN struct vnode *dvp;
96         OUT struct vnode **vpp;
97         IN struct componentname *cnp;
98         IN struct vattr *vap;
99 };
100
101
102 %% whiteout     dvp     E E E
103
104 vop_whiteout {
105         IN struct vnode *dvp;
106         IN struct componentname *cnp;
107         IN int flags;
108 };
109
110
111 %% mknod        dvp     E E E
112 %% mknod        vpp     - L -
113 %! mknod        post    vop_mknod_post
114
115 vop_mknod {
116         IN struct vnode *dvp;
117         OUT struct vnode **vpp;
118         IN struct componentname *cnp;
119         IN struct vattr *vap;
120 };
121
122
123 %% open         vp      L L L
124
125 vop_open {
126         IN struct vnode *vp;
127         IN int mode;
128         IN struct ucred *cred;
129         IN struct thread *td;
130         IN struct file *fp;
131 };
132
133
134 %% close        vp      L L L
135
136 vop_close {
137         IN struct vnode *vp;
138         IN int fflag;
139         IN struct ucred *cred;
140         IN struct thread *td;
141 };
142
143
144 %% access       vp      L L L
145
146 vop_access {
147         IN struct vnode *vp;
148         IN accmode_t accmode;
149         IN struct ucred *cred;
150         IN struct thread *td;
151 };
152
153
154 %% accessx      vp      L L L
155
156 vop_accessx {
157         IN struct vnode *vp;
158         IN accmode_t accmode;
159         IN struct ucred *cred;
160         IN struct thread *td;
161 };
162
163
164 %% getattr      vp      L L L
165
166 vop_getattr {
167         IN struct vnode *vp;
168         OUT struct vattr *vap;
169         IN struct ucred *cred;
170 };
171
172
173 %% setattr      vp      E E E
174 %! setattr      post    vop_setattr_post
175
176 vop_setattr {
177         IN struct vnode *vp;
178         IN struct vattr *vap;
179         IN struct ucred *cred;
180 };
181
182 %% markatime    vp      L L L
183
184 vop_markatime {
185         IN struct vnode *vp;
186 };
187
188 %% read         vp      L L L
189
190 vop_read {
191         IN struct vnode *vp;
192         INOUT struct uio *uio;
193         IN int ioflag;
194         IN struct ucred *cred;
195 };
196
197
198 %% write        vp      L L L
199 %! write        pre     VOP_WRITE_PRE
200 %! write        post    VOP_WRITE_POST
201
202 vop_write {
203         IN struct vnode *vp;
204         INOUT struct uio *uio;
205         IN int ioflag;
206         IN struct ucred *cred;
207 };
208
209
210 %% ioctl        vp      U U U
211
212 vop_ioctl {
213         IN struct vnode *vp;
214         IN u_long command;
215         IN void *data;
216         IN int fflag;
217         IN struct ucred *cred;
218         IN struct thread *td;
219 };
220
221
222 %% poll         vp      U U U
223
224 vop_poll {
225         IN struct vnode *vp;
226         IN int events;
227         IN struct ucred *cred;
228         IN struct thread *td;
229 };
230
231
232 %% kqfilter     vp      U U U
233
234 vop_kqfilter {
235         IN struct vnode *vp;
236         IN struct knote *kn;
237 };
238
239
240 %% revoke       vp      L L L
241
242 vop_revoke {
243         IN struct vnode *vp;
244         IN int flags;
245 };
246
247
248 %% fsync        vp      L L L
249
250 vop_fsync {
251         IN struct vnode *vp;
252         IN int waitfor;
253         IN struct thread *td;
254 };
255
256
257 %% remove       dvp     E E E
258 %% remove       vp      E E E
259 %! remove       post    vop_remove_post
260
261 vop_remove {
262         IN struct vnode *dvp;
263         IN struct vnode *vp;
264         IN struct componentname *cnp;
265 };
266
267
268 %% link         tdvp    E E E
269 %% link         vp      E E E
270 %! link         post    vop_link_post
271
272 vop_link {
273         IN struct vnode *tdvp;
274         IN struct vnode *vp;
275         IN struct componentname *cnp;
276 };
277
278
279 %! rename       pre     vop_rename_pre
280 %! rename       post    vop_rename_post
281
282 vop_rename {
283         IN WILLRELE struct vnode *fdvp;
284         IN WILLRELE struct vnode *fvp;
285         IN struct componentname *fcnp;
286         IN WILLRELE struct vnode *tdvp;
287         IN WILLRELE struct vnode *tvp;
288         IN struct componentname *tcnp;
289 };
290
291
292 %% mkdir        dvp     E E E
293 %% mkdir        vpp     - E -
294 %! mkdir        post    vop_mkdir_post
295
296 vop_mkdir {
297         IN struct vnode *dvp;
298         OUT struct vnode **vpp;
299         IN struct componentname *cnp;
300         IN struct vattr *vap;
301 };
302
303
304 %% rmdir        dvp     E E E
305 %% rmdir        vp      E E E
306 %! rmdir        post    vop_rmdir_post
307
308 vop_rmdir {
309         IN struct vnode *dvp;
310         IN struct vnode *vp;
311         IN struct componentname *cnp;
312 };
313
314
315 %% symlink      dvp     E E E
316 %% symlink      vpp     - E -
317 %! symlink      post    vop_symlink_post
318
319 vop_symlink {
320         IN struct vnode *dvp;
321         OUT struct vnode **vpp;
322         IN struct componentname *cnp;
323         IN struct vattr *vap;
324         IN char *target;
325 };
326
327
328 %% readdir      vp      L L L
329
330 vop_readdir {
331         IN struct vnode *vp;
332         INOUT struct uio *uio;
333         IN struct ucred *cred;
334         INOUT int *eofflag;
335         OUT int *ncookies;
336         INOUT u_long **cookies;
337 };
338
339
340 %% readlink     vp      L L L
341
342 vop_readlink {
343         IN struct vnode *vp;
344         INOUT struct uio *uio;
345         IN struct ucred *cred;
346 };
347
348
349 %% inactive     vp      E E E
350
351 vop_inactive {
352         IN struct vnode *vp;
353         IN struct thread *td;
354 };
355
356
357 %% reclaim      vp      E E E
358 %! reclaim      post    vop_reclaim_post
359
360 vop_reclaim {
361         IN struct vnode *vp;
362         IN struct thread *td;
363 };
364
365
366 %! lock1        pre     vop_lock_pre
367 %! lock1        post    vop_lock_post
368
369 vop_lock1 {
370         IN struct vnode *vp;
371         IN int flags;
372         IN char *file;
373         IN int line;
374 };
375
376
377 %! unlock       pre     vop_unlock_pre
378 %! unlock       post    vop_unlock_post
379
380 vop_unlock {
381         IN struct vnode *vp;
382         IN int flags;
383 };
384
385
386 %% bmap         vp      L L L
387
388 vop_bmap {
389         IN struct vnode *vp;
390         IN daddr_t bn;
391         OUT struct bufobj **bop;
392         IN daddr_t *bnp;
393         OUT int *runp;
394         OUT int *runb;
395 };
396
397
398 %% strategy     vp      L L L
399 %! strategy     pre     vop_strategy_pre
400
401 vop_strategy {
402         IN struct vnode *vp;
403         IN struct buf *bp;
404 };
405
406
407 %% getwritemount vp     = = =
408
409 vop_getwritemount {
410         IN struct vnode *vp;
411         OUT struct mount **mpp;
412 };
413
414
415 %% print        vp      - - -
416
417 vop_print {
418         IN struct vnode *vp;
419 };
420
421
422 %% pathconf     vp      L L L
423
424 vop_pathconf {
425         IN struct vnode *vp;
426         IN int name;
427         OUT register_t *retval;
428 };
429
430
431 %% advlock      vp      U U U
432
433 vop_advlock {
434         IN struct vnode *vp;
435         IN void *id;
436         IN int op;
437         IN struct flock *fl;
438         IN int flags;
439 };
440
441
442 %% advlockasync vp      U U U
443
444 vop_advlockasync {
445         IN struct vnode *vp;
446         IN void *id;
447         IN int op;
448         IN struct flock *fl;
449         IN int flags;
450         IN struct task *task;   
451         INOUT void **cookiep;
452 };
453
454
455 %% advlockpurge vp      E E E
456
457 vop_advlockpurge {
458         IN struct vnode *vp;
459 };
460
461
462 %% reallocblks  vp      E E E
463
464 vop_reallocblks {
465         IN struct vnode *vp;
466         IN struct cluster_save *buflist;
467 };
468
469
470 %% getpages     vp      L L L
471
472 vop_getpages {
473         IN struct vnode *vp;
474         IN vm_page_t *m;
475         IN int count;
476         IN int reqpage;
477         IN vm_ooffset_t offset;
478 };
479
480
481 %% putpages     vp      L L L
482
483 vop_putpages {
484         IN struct vnode *vp;
485         IN vm_page_t *m;
486         IN int count;
487         IN int sync;
488         IN int *rtvals;
489         IN vm_ooffset_t offset;
490 };
491
492
493 %% getacl       vp      L L L
494
495 vop_getacl {
496         IN struct vnode *vp;
497         IN acl_type_t type;
498         OUT struct acl *aclp;
499         IN struct ucred *cred;
500         IN struct thread *td;
501 };
502
503
504 %% setacl       vp      E E E
505
506 vop_setacl {
507         IN struct vnode *vp;
508         IN acl_type_t type;
509         IN struct acl *aclp;
510         IN struct ucred *cred;
511         IN struct thread *td;
512 };
513
514
515 %% aclcheck     vp      = = =
516
517 vop_aclcheck {
518         IN struct vnode *vp;
519         IN acl_type_t type;
520         IN struct acl *aclp;
521         IN struct ucred *cred;
522         IN struct thread *td;
523 };
524
525
526 %% closeextattr vp      L L L
527
528 vop_closeextattr {
529         IN struct vnode *vp;
530         IN int commit;
531         IN struct ucred *cred;
532         IN struct thread *td;
533 };
534
535
536 %% getextattr   vp      L L L
537
538 vop_getextattr {
539         IN struct vnode *vp;
540         IN int attrnamespace;
541         IN const char *name;
542         INOUT struct uio *uio;
543         OUT size_t *size;
544         IN struct ucred *cred;
545         IN struct thread *td;
546 };
547
548
549 %% listextattr  vp      L L L
550
551 vop_listextattr {
552         IN struct vnode *vp;
553         IN int attrnamespace;
554         INOUT struct uio *uio;
555         OUT size_t *size;
556         IN struct ucred *cred;
557         IN struct thread *td;
558 };
559
560
561 %% openextattr  vp      L L L
562
563 vop_openextattr {
564         IN struct vnode *vp;
565         IN struct ucred *cred;
566         IN struct thread *td;
567 };
568
569
570 %% deleteextattr        vp      E E E
571 %! deleteextattr        post    vop_deleteextattr_post
572
573 vop_deleteextattr {
574         IN struct vnode *vp;
575         IN int attrnamespace;
576         IN const char *name;
577         IN struct ucred *cred;
578         IN struct thread *td;
579 };
580
581
582 %% setextattr   vp      E E E
583 %! setextattr   post    vop_setextattr_post
584
585 vop_setextattr {
586         IN struct vnode *vp;
587         IN int attrnamespace;
588         IN const char *name;
589         INOUT struct uio *uio;
590         IN struct ucred *cred;
591         IN struct thread *td;
592 };
593
594
595 %% setlabel     vp      E E E
596
597 vop_setlabel {
598         IN struct vnode *vp;
599         IN struct label *label;
600         IN struct ucred *cred;
601         IN struct thread *td;
602 };
603
604
605 %% vptofh       vp      = = =
606
607 vop_vptofh {
608         IN struct vnode *vp;
609         IN struct fid *fhp;
610 };
611
612
613 %% vptocnp              vp      L L L
614 %% vptocnp              vpp     - U -
615
616 vop_vptocnp {
617         IN struct vnode *vp;
618         OUT struct vnode **vpp;
619         IN struct ucred *cred;
620         INOUT char *buf;
621         INOUT int *buflen;
622 };
623
624
625 %% allocate     vp      E E E
626
627 vop_allocate {
628         IN struct vnode *vp;
629         INOUT off_t *offset;
630         INOUT off_t *len;
631 };
632
633 %% advise       vp      U U U
634
635 vop_advise {
636         IN struct vnode *vp;
637         IN off_t start;
638         IN off_t end;
639         IN int advice;
640 };
641
642 %% unp_bind     vp      E E E
643
644 vop_unp_bind {
645         IN struct vnode *vp;
646         IN struct socket *socket;
647 };
648
649 %% unp_connect  vp      L L L
650
651 vop_unp_connect {
652         IN struct vnode *vp;
653         OUT struct socket **socket;
654 };
655
656 %% unp_detach   vp      = = =
657
658 vop_unp_detach {
659         IN struct vnode *vp;
660 };
661
662 %% is_text      vp      L L L
663
664 vop_is_text {
665         IN struct vnode *vp;
666 };
667
668 %% set_text     vp      E E E
669
670 vop_set_text {
671         IN struct vnode *vp;
672 };
673
674 %% vop_unset_text       vp      E E E
675
676 vop_unset_text {
677         IN struct vnode *vp;
678 };
679
680 %% get_writecount       vp      L L L
681
682 vop_get_writecount {
683         IN struct vnode *vp;
684         OUT int *writecount;
685 };
686
687 %% add_writecount       vp      E E E
688
689 vop_add_writecount {
690         IN struct vnode *vp;
691         IN int inc;
692 };
693
694 # The VOPs below are spares at the end of the table to allow new VOPs to be
695 # added in stable branches without breaking the KBI.  New VOPs in HEAD should
696 # be added above these spares.  When merging a new VOP to a stable branch,
697 # the new VOP should replace one of the spares.
698
699 vop_spare1 {
700         IN struct vnode *vp;
701 };
702
703 vop_spare2 {
704         IN struct vnode *vp;
705 };
706
707 vop_spare3 {
708         IN struct vnode *vp;
709 };
710
711 vop_spare4 {
712         IN struct vnode *vp;
713 };
714
715 vop_spare5 {
716         IN struct vnode *vp;
717 };