]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/vnode_if.src
sysctl(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.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 # 3. 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 successful
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 # E: locked with exclusive lock for this process.
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 #
48 # The paramater named "vpp" is assumed to be always used with double
49 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
50 #
51 # Lines starting with %! specify a pre or post-condition function
52 # to call before/after the vop call.
53 #
54 # If other such parameters are introduced, they have to be added to
55 # the AWK script at the head of the definition of "add_debug_code()".
56 #
57
58 vop_islocked {
59         IN struct vnode *vp;
60 };
61
62
63 %% lookup       dvp     L L L
64 %% lookup       vpp     - L -
65
66 # XXX - the lookup locking protocol defies simple description and depends
67 #       on the flags and operation fields in the (cnp) structure.  Note
68 #       especially that *vpp may equal dvp and both may be locked.
69
70 vop_lookup {
71         IN struct vnode *dvp;
72         INOUT struct vnode **vpp;
73         IN struct componentname *cnp;
74 };
75
76
77 %% cachedlookup dvp     L L L
78 %% cachedlookup vpp     - L -
79
80 # This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
81
82 vop_cachedlookup {
83         IN struct vnode *dvp;
84         INOUT struct vnode **vpp;
85         IN struct componentname *cnp;
86 };
87
88
89 %% create       dvp     E E E
90 %% create       vpp     - L -
91 %! create       pre     vop_create_pre
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 %! whiteout     pre     vop_whiteout_pre
104 %! whiteout     post    vop_whiteout_post
105
106 vop_whiteout {
107         IN struct vnode *dvp;
108         IN struct componentname *cnp;
109         IN int flags;
110 };
111
112
113 %% mknod        dvp     E E E
114 %% mknod        vpp     - L -
115 %! mknod        pre     vop_mknod_pre
116 %! mknod        post    vop_mknod_post
117
118 vop_mknod {
119         IN struct vnode *dvp;
120         OUT struct vnode **vpp;
121         IN struct componentname *cnp;
122         IN struct vattr *vap;
123 };
124
125
126 %% open         vp      L L L
127 %! open         post    vop_open_post
128
129 vop_open {
130         IN struct vnode *vp;
131         IN int mode;
132         IN struct ucred *cred;
133         IN struct thread *td;
134         IN struct file *fp;
135 };
136
137
138 %% close        vp      L L L
139 %! close        post    vop_close_post
140
141 vop_close {
142         IN struct vnode *vp;
143         IN int fflag;
144         IN struct ucred *cred;
145         IN struct thread *td;
146 };
147
148
149 %% fplookup_vexec       vp      - - -
150 %! fplookup_vexec       debugpre        vop_fplookup_vexec_debugpre
151 %! fplookup_vexec       debugpost       vop_fplookup_vexec_debugpost
152
153 vop_fplookup_vexec {
154         IN struct vnode *vp;
155         IN struct ucred *cred;
156 };
157
158
159 %% access       vp      L L L
160
161 vop_access {
162         IN struct vnode *vp;
163         IN accmode_t accmode;
164         IN struct ucred *cred;
165         IN struct thread *td;
166 };
167
168
169 %% accessx      vp      L L L
170
171 vop_accessx {
172         IN struct vnode *vp;
173         IN accmode_t accmode;
174         IN struct ucred *cred;
175         IN struct thread *td;
176 };
177
178
179 %% stat vp      L L L
180
181 vop_stat {
182         IN struct vnode *vp;
183         OUT struct stat *sb;
184         IN struct ucred *active_cred;
185         IN struct ucred *file_cred;
186         IN struct thread *td;
187 };
188
189
190 %% getattr      vp      L L L
191
192 vop_getattr {
193         IN struct vnode *vp;
194         OUT struct vattr *vap;
195         IN struct ucred *cred;
196 };
197
198
199 %% setattr      vp      E E E
200 %! setattr      pre     vop_setattr_pre
201 %! setattr      post    vop_setattr_post
202
203 vop_setattr {
204         IN struct vnode *vp;
205         IN struct vattr *vap;
206         IN struct ucred *cred;
207 };
208
209
210 %% mmapped      vp      L L L
211
212 vop_mmapped {
213         IN struct vnode *vp;
214 };
215
216
217 %% read         vp      L L L
218 %! read         post    vop_read_post
219
220 vop_read {
221         IN struct vnode *vp;
222         INOUT struct uio *uio;
223         IN int ioflag;
224         IN struct ucred *cred;
225 };
226
227
228 %% read_pgcache vp      - - -
229 %! read_pgcache post    vop_read_pgcache_post
230
231 vop_read_pgcache {
232         IN struct vnode *vp;
233         INOUT struct uio *uio;
234         IN int ioflag;
235         IN struct ucred *cred;
236 };
237
238
239 %% write        vp      L L L
240 %! write        pre     VOP_WRITE_PRE
241 %! write        post    VOP_WRITE_POST
242
243 vop_write {
244         IN struct vnode *vp;
245         INOUT struct uio *uio;
246         IN int ioflag;
247         IN struct ucred *cred;
248 };
249
250
251 %% ioctl        vp      U U U
252
253 vop_ioctl {
254         IN struct vnode *vp;
255         IN u_long command;
256         IN void *data;
257         IN int fflag;
258         IN struct ucred *cred;
259         IN struct thread *td;
260 };
261
262
263 %% poll         vp      U U U
264
265 vop_poll {
266         IN struct vnode *vp;
267         IN int events;
268         IN struct ucred *cred;
269         IN struct thread *td;
270 };
271
272
273 %% kqfilter     vp      U U U
274
275 vop_kqfilter {
276         IN struct vnode *vp;
277         IN struct knote *kn;
278 };
279
280
281 %% revoke       vp      L L L
282
283 vop_revoke {
284         IN struct vnode *vp;
285         IN int flags;
286 };
287
288
289 %% fsync        vp      L L L
290
291 vop_fsync {
292         IN struct vnode *vp;
293         IN int waitfor;
294         IN struct thread *td;
295 };
296
297
298 %% remove       dvp     E E E
299 %% remove       vp      E E E
300 %! remove       pre     vop_remove_pre
301 %! remove       post    vop_remove_post
302
303 vop_remove {
304         IN struct vnode *dvp;
305         IN struct vnode *vp;
306         IN struct componentname *cnp;
307 };
308
309
310 %% link         tdvp    E E E
311 %% link         vp      E E E
312 %! link         pre     vop_link_pre
313 %! link         post    vop_link_post
314
315 vop_link {
316         IN struct vnode *tdvp;
317         IN struct vnode *vp;
318         IN struct componentname *cnp;
319 };
320
321
322 %! rename       pre     vop_rename_pre
323 %! rename       post    vop_rename_post
324
325 vop_rename {
326         IN WILLRELE struct vnode *fdvp;
327         IN WILLRELE struct vnode *fvp;
328         IN struct componentname *fcnp;
329         IN WILLRELE struct vnode *tdvp;
330         IN WILLRELE struct vnode *tvp;
331         IN struct componentname *tcnp;
332 };
333
334
335 %% mkdir        dvp     E E E
336 %% mkdir        vpp     - E -
337 %! mkdir        pre     vop_mkdir_pre
338 %! mkdir        post    vop_mkdir_post
339 %! mkdir        debugpost vop_mkdir_debugpost
340
341 vop_mkdir {
342         IN struct vnode *dvp;
343         OUT struct vnode **vpp;
344         IN struct componentname *cnp;
345         IN struct vattr *vap;
346 };
347
348
349 %% rmdir        dvp     E E E
350 %% rmdir        vp      E E E
351 %! rmdir        pre     vop_rmdir_pre
352 %! rmdir        post    vop_rmdir_post
353
354 vop_rmdir {
355         IN struct vnode *dvp;
356         IN struct vnode *vp;
357         IN struct componentname *cnp;
358 };
359
360
361 %% symlink      dvp     E E E
362 %% symlink      vpp     - E -
363 %! symlink      pre     vop_symlink_pre
364 %! symlink      post    vop_symlink_post
365
366 vop_symlink {
367         IN struct vnode *dvp;
368         OUT struct vnode **vpp;
369         IN struct componentname *cnp;
370         IN struct vattr *vap;
371         IN const char *target;
372 };
373
374
375 %% readdir      vp      L L L
376 %! readdir      post    vop_readdir_post
377
378 vop_readdir {
379         IN struct vnode *vp;
380         INOUT struct uio *uio;
381         IN struct ucred *cred;
382         INOUT int *eofflag;
383         OUT int *ncookies;
384         INOUT u_long **cookies;
385 };
386
387
388 %% readlink     vp      L L L
389
390 vop_readlink {
391         IN struct vnode *vp;
392         INOUT struct uio *uio;
393         IN struct ucred *cred;
394 };
395
396
397 %% inactive     vp      E E E
398
399 vop_inactive {
400         IN struct vnode *vp;
401 };
402
403 %! need_inactive        debugpre        vop_need_inactive_debugpre
404 %! need_inactive        debugpost       vop_need_inactive_debugpost
405
406 vop_need_inactive {
407         IN struct vnode *vp;
408 };
409
410 %% reclaim      vp      E E E
411 %! reclaim      post    vop_reclaim_post
412
413 vop_reclaim {
414         IN struct vnode *vp;
415 };
416
417
418 %! lock1        debugpre        vop_lock_debugpre
419 %! lock1        debugpost       vop_lock_debugpost
420
421 vop_lock1 {
422         IN struct vnode *vp;
423         IN int flags;
424         IN const char *file;
425         IN int line;
426 };
427
428
429 %! unlock       debugpre        vop_unlock_debugpre
430
431 vop_unlock {
432         IN struct vnode *vp;
433 };
434
435
436 %% bmap         vp      L L L
437
438 vop_bmap {
439         IN struct vnode *vp;
440         IN daddr_t bn;
441         OUT struct bufobj **bop;
442         IN daddr_t *bnp;
443         OUT int *runp;
444         OUT int *runb;
445 };
446
447
448 %% strategy     vp      L L L
449 %! strategy     debugpre        vop_strategy_debugpre
450
451 vop_strategy {
452         IN struct vnode *vp;
453         IN struct buf *bp;
454 };
455
456
457 %% getwritemount vp     = = =
458
459 vop_getwritemount {
460         IN struct vnode *vp;
461         OUT struct mount **mpp;
462 };
463
464
465 %% print        vp      - - -
466
467 vop_print {
468         IN struct vnode *vp;
469 };
470
471
472 %% pathconf     vp      L L L
473
474 vop_pathconf {
475         IN struct vnode *vp;
476         IN int name;
477         OUT long *retval;
478 };
479
480
481 %% advlock      vp      U U U
482
483 vop_advlock {
484         IN struct vnode *vp;
485         IN void *id;
486         IN int op;
487         IN struct flock *fl;
488         IN int flags;
489 };
490
491
492 %% advlockasync vp      U U U
493
494 vop_advlockasync {
495         IN struct vnode *vp;
496         IN void *id;
497         IN int op;
498         IN struct flock *fl;
499         IN int flags;
500         IN struct task *task;   
501         INOUT void **cookiep;
502 };
503
504
505 %% advlockpurge vp      E E E
506
507 vop_advlockpurge {
508         IN struct vnode *vp;
509 };
510
511
512 %% reallocblks  vp      E E E
513
514 vop_reallocblks {
515         IN struct vnode *vp;
516         IN struct cluster_save *buflist;
517 };
518
519
520 %% getpages     vp      L L L
521
522 vop_getpages {
523         IN struct vnode *vp;
524         IN vm_page_t *m;
525         IN int count;
526         IN int *rbehind;
527         IN int *rahead;
528 };
529
530
531 %% getpages_async       vp      L L L
532
533 vop_getpages_async {
534         IN struct vnode *vp;
535         IN vm_page_t *m;
536         IN int count;
537         IN int *rbehind;
538         IN int *rahead;
539         IN vop_getpages_iodone_t *iodone;
540         IN void *arg;
541 };
542
543
544 %% putpages     vp      L L L
545
546 vop_putpages {
547         IN struct vnode *vp;
548         IN vm_page_t *m;
549         IN int count;
550         IN int sync;
551         IN int *rtvals;
552 };
553
554
555 %% getacl       vp      L L L
556
557 vop_getacl {
558         IN struct vnode *vp;
559         IN acl_type_t type;
560         OUT struct acl *aclp;
561         IN struct ucred *cred;
562         IN struct thread *td;
563 };
564
565
566 %% setacl       vp      E E E
567 %! setacl       pre     vop_setacl_pre
568 %! setacl       post    vop_setacl_post
569
570 vop_setacl {
571         IN struct vnode *vp;
572         IN acl_type_t type;
573         IN struct acl *aclp;
574         IN struct ucred *cred;
575         IN struct thread *td;
576 };
577
578
579 %% aclcheck     vp      = = =
580
581 vop_aclcheck {
582         IN struct vnode *vp;
583         IN acl_type_t type;
584         IN struct acl *aclp;
585         IN struct ucred *cred;
586         IN struct thread *td;
587 };
588
589
590 %% closeextattr vp      L L L
591
592 vop_closeextattr {
593         IN struct vnode *vp;
594         IN int commit;
595         IN struct ucred *cred;
596         IN struct thread *td;
597 };
598
599
600 %% getextattr   vp      L L L
601
602 vop_getextattr {
603         IN struct vnode *vp;
604         IN int attrnamespace;
605         IN const char *name;
606         INOUT struct uio *uio;
607         OUT size_t *size;
608         IN struct ucred *cred;
609         IN struct thread *td;
610 };
611
612
613 %% listextattr  vp      L L L
614
615 vop_listextattr {
616         IN struct vnode *vp;
617         IN int attrnamespace;
618         INOUT struct uio *uio;
619         OUT size_t *size;
620         IN struct ucred *cred;
621         IN struct thread *td;
622 };
623
624
625 %% openextattr  vp      L L L
626
627 vop_openextattr {
628         IN struct vnode *vp;
629         IN struct ucred *cred;
630         IN struct thread *td;
631 };
632
633
634 %% deleteextattr        vp      E E E
635 %! deleteextattr        pre     vop_deleteextattr_pre
636 %! deleteextattr        post    vop_deleteextattr_post
637
638 vop_deleteextattr {
639         IN struct vnode *vp;
640         IN int attrnamespace;
641         IN const char *name;
642         IN struct ucred *cred;
643         IN struct thread *td;
644 };
645
646
647 %% setextattr   vp      E E E
648 %! setextattr   pre     vop_setextattr_pre
649 %! setextattr   post    vop_setextattr_post
650
651 vop_setextattr {
652         IN struct vnode *vp;
653         IN int attrnamespace;
654         IN const char *name;
655         INOUT struct uio *uio;
656         IN struct ucred *cred;
657         IN struct thread *td;
658 };
659
660
661 %% setlabel     vp      E E E
662
663 vop_setlabel {
664         IN struct vnode *vp;
665         IN struct label *label;
666         IN struct ucred *cred;
667         IN struct thread *td;
668 };
669
670
671 %% vptofh       vp      = = =
672
673 vop_vptofh {
674         IN struct vnode *vp;
675         IN struct fid *fhp;
676 };
677
678
679 %% vptocnp              vp      L L L
680 %% vptocnp              vpp     - U -
681
682 vop_vptocnp {
683         IN struct vnode *vp;
684         OUT struct vnode **vpp;
685         INOUT char *buf;
686         INOUT size_t *buflen;
687 };
688
689
690 %% allocate     vp      E E E
691
692 vop_allocate {
693         IN struct vnode *vp;
694         INOUT off_t *offset;
695         INOUT off_t *len;
696 };
697
698
699 %% advise       vp      U U U
700
701 vop_advise {
702         IN struct vnode *vp;
703         IN off_t start;
704         IN off_t end;
705         IN int advice;
706 };
707
708
709 %% unp_bind     vp      E E E
710
711 vop_unp_bind {
712         IN struct vnode *vp;
713         IN struct unpcb *unpcb;
714 };
715
716
717 %% unp_connect  vp      L L L
718
719 vop_unp_connect {
720         IN struct vnode *vp;
721         OUT struct unpcb **unpcb;
722 };
723
724
725 %% unp_detach   vp      = = =
726
727 vop_unp_detach {
728         IN struct vnode *vp;
729 };
730
731
732 %% is_text      vp      L L L
733
734 vop_is_text {
735         IN struct vnode *vp;
736 };
737
738
739 %% set_text     vp      = = =
740
741 vop_set_text {
742         IN struct vnode *vp;
743 };
744
745
746 %% vop_unset_text       vp      L L L
747
748 vop_unset_text {
749         IN struct vnode *vp;
750 };
751
752
753 %% add_writecount       vp      L L L
754
755 vop_add_writecount {
756         IN struct vnode *vp;
757         IN int inc;
758 };
759
760
761 %% fdatasync    vp      L L L
762
763 vop_fdatasync {
764         IN struct vnode *vp;
765         IN struct thread *td;
766 };
767
768
769 %% copy_file_range      invp    U U U
770 %% copy_file_range      outvp   U U U
771
772 vop_copy_file_range {
773         IN struct vnode *invp;
774         INOUT off_t *inoffp;
775         IN struct vnode *outvp;
776         INOUT off_t *outoffp;
777         INOUT size_t *lenp;
778         IN unsigned int flags;
779         IN struct ucred *incred;
780         IN struct ucred *outcred;
781         IN struct thread *fsizetd;
782 };
783
784
785 # The VOPs below are spares at the end of the table to allow new VOPs to be
786 # added in stable branches without breaking the KBI.  New VOPs in HEAD should
787 # be added above these spares.  When merging a new VOP to a stable branch,
788 # the new VOP should replace one of the spares.
789
790 vop_spare1 {
791         IN struct vnode *vp;
792 };
793
794 vop_spare2 {
795         IN struct vnode *vp;
796 };
797
798 vop_spare3 {
799         IN struct vnode *vp;
800 };
801
802 vop_spare4 {
803         IN struct vnode *vp;
804 };
805
806 vop_spare5 {
807         IN struct vnode *vp;
808 };