]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/vnode_if.src
Do not assert any locks for VOP_PRINT. In particular, do not assert that
[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 # 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-codeed 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 ? ?
67 %% lookup       vpp     - L -
68 %! lookup       pre     vop_lookup_pre
69 %! lookup       post    vop_lookup_post
70
71 # XXX - the lookup locking protocol defies simple description and depends
72 #       on the flags and operation fields in the (cnp) structure.  Note
73 #       especially that *vpp may equal dvp and both may be locked.
74
75 vop_lookup {
76         IN struct vnode *dvp;
77         INOUT struct vnode **vpp;
78         IN struct componentname *cnp;
79 };
80
81 %% cachedlookup dvp     L ? ?
82 %% cachedlookup vpp     - L -
83
84 # This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
85
86 vop_cachedlookup {
87         IN struct vnode *dvp;
88         INOUT struct vnode **vpp;
89         IN struct componentname *cnp;
90 };
91
92 %% create       dvp     E E E
93 %% create       vpp     - L -
94 %! create       post    vop_create_post
95
96 vop_create {
97         IN struct vnode *dvp;
98         OUT struct vnode **vpp;
99         IN struct componentname *cnp;
100         IN struct vattr *vap;
101 };
102
103
104 %% whiteout     dvp     E E E
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        post    vop_mknod_post
116
117 vop_mknod {
118         IN struct vnode *dvp;
119         OUT struct vnode **vpp;
120         IN struct componentname *cnp;
121         IN struct vattr *vap;
122 };
123
124
125 %% open         vp      L L L
126
127 vop_open {
128         IN struct vnode *vp;
129         IN int mode;
130         IN struct ucred *cred;
131         IN struct thread *td;
132         IN struct file *fp;
133 };
134
135
136 %% close        vp      E E E
137
138 vop_close {
139         IN struct vnode *vp;
140         IN int fflag;
141         IN struct ucred *cred;
142         IN struct thread *td;
143 };
144
145
146 %% access       vp      L L L
147
148 vop_access {
149         IN struct vnode *vp;
150         IN int mode;
151         IN struct ucred *cred;
152         IN struct thread *td;
153 };
154
155
156 %% getattr      vp      L L L
157
158 vop_getattr {
159         IN struct vnode *vp;
160         OUT struct vattr *vap;
161         IN struct ucred *cred;
162         IN struct thread *td;
163 };
164
165
166 %% setattr      vp      E E E
167 %! setattr      post    vop_setattr_post
168
169 vop_setattr {
170         IN struct vnode *vp;
171         IN struct vattr *vap;
172         IN struct ucred *cred;
173         IN struct thread *td;
174 };
175
176
177 %% read         vp      L L L
178
179 vop_read {
180         IN struct vnode *vp;
181         INOUT struct uio *uio;
182         IN int ioflag;
183         IN struct ucred *cred;
184 };
185
186
187 %% write        vp      E E E
188 %! write        pre     VOP_WRITE_PRE
189 %! write        post    VOP_WRITE_POST
190
191 vop_write {
192         IN struct vnode *vp;
193         INOUT struct uio *uio;
194         IN int ioflag;
195         IN struct ucred *cred;
196 };
197
198
199 %% lease        vp      = = =
200
201 vop_lease {
202         IN struct vnode *vp;
203         IN struct thread *td;
204         IN struct ucred *cred;
205         IN int flag;
206 };
207
208
209 %% ioctl        vp      U U U
210
211 vop_ioctl {
212         IN struct vnode *vp;
213         IN u_long command;
214         IN void *data;
215         IN int fflag;
216         IN struct ucred *cred;
217         IN struct thread *td;
218 };
219
220
221 %% poll vp      U U U
222
223 vop_poll {
224         IN struct vnode *vp;
225         IN int events;
226         IN struct ucred *cred;
227         IN struct thread *td;
228 };
229
230
231 %% kqfilter     vp      U U U
232
233 vop_kqfilter {
234         IN struct vnode *vp;
235         IN struct knote *kn;
236 };
237
238
239 %% revoke       vp      L L L
240
241 vop_revoke {
242         IN struct vnode *vp;
243         IN int flags;
244 };
245
246
247 %% fsync        vp      E E E
248
249 vop_fsync {
250         IN struct vnode *vp;
251         IN int waitfor;
252         IN struct thread *td;
253 };
254
255
256 %% remove       dvp     E E E
257 %% remove       vp      E E E
258 %! remove       post    vop_remove_post
259
260 vop_remove {
261         IN struct vnode *dvp;
262         IN struct vnode *vp;
263         IN struct componentname *cnp;
264 };
265
266
267 %% link         tdvp    E E E
268 %% link         vp      E E E
269 %! link         post    vop_link_post
270
271 vop_link {
272         IN struct vnode *tdvp;
273         IN struct vnode *vp;
274         IN struct componentname *cnp;
275 };
276
277
278 %! rename       pre     vop_rename_pre
279 %! rename       post    vop_rename_post
280
281 vop_rename {
282         IN WILLRELE struct vnode *fdvp;
283         IN WILLRELE struct vnode *fvp;
284         IN struct componentname *fcnp;
285         IN WILLRELE struct vnode *tdvp;
286         IN WILLRELE struct vnode *tvp;
287         IN struct componentname *tcnp;
288 };
289
290
291 %% mkdir        dvp     E E E
292 %% mkdir        vpp     - E -
293 %! mkdir        post    vop_mkdir_post
294
295 vop_mkdir {
296         IN struct vnode *dvp;
297         OUT struct vnode **vpp;
298         IN struct componentname *cnp;
299         IN struct vattr *vap;
300 };
301
302
303 %% rmdir        dvp     E E E
304 %% rmdir        vp      E E E
305 %! rmdir        post    vop_rmdir_post
306
307 vop_rmdir {
308         IN struct vnode *dvp;
309         IN struct vnode *vp;
310         IN struct componentname *cnp;
311 };
312
313
314 %% symlink      dvp     E E E
315 %% symlink      vpp     - E -
316 %! symlink      post    vop_symlink_post
317
318 vop_symlink {
319         IN struct vnode *dvp;
320         OUT struct vnode **vpp;
321         IN struct componentname *cnp;
322         IN struct vattr *vap;
323         IN char *target;
324 };
325
326
327 %% readdir      vp      L L L
328
329 vop_readdir {
330         IN struct vnode *vp;
331         INOUT struct uio *uio;
332         IN struct ucred *cred;
333         INOUT int *eofflag;
334         OUT int *ncookies;
335         INOUT u_long **cookies;
336 };
337
338
339 %% readlink     vp      L L L
340
341 vop_readlink {
342         IN struct vnode *vp;
343         INOUT struct uio *uio;
344         IN struct ucred *cred;
345 };
346
347
348 %% inactive     vp      E E E
349
350 vop_inactive {
351         IN struct vnode *vp;
352         IN struct thread *td;
353 };
354
355
356 %% reclaim      vp      E E E
357
358 vop_reclaim {
359         IN struct vnode *vp;
360         IN struct thread *td;
361 };
362
363
364 %! lock1        pre     vop_lock_pre
365 %! lock1        post    vop_lock_post
366
367 vop_lock1 {
368         IN struct vnode *vp;
369         IN int flags;
370         IN char *file;
371         IN int line;
372 };
373
374
375 %! unlock       pre     vop_unlock_pre
376 %! unlock       post    vop_unlock_post
377
378 vop_unlock {
379         IN struct vnode *vp;
380         IN int flags;
381 };
382
383
384 %% bmap         vp      L L L
385
386 vop_bmap {
387         IN struct vnode *vp;
388         IN daddr_t bn;
389         OUT struct bufobj **bop;
390         IN daddr_t *bnp;
391         OUT int *runp;
392         OUT int *runb;
393 };
394
395
396 %% strategy     vp      L L L
397 %! strategy     pre     vop_strategy_pre
398
399 vop_strategy {
400         IN struct vnode *vp;
401         IN struct buf *bp;
402 };
403
404
405 %% getwritemount vp     = = =
406
407 vop_getwritemount {
408         IN struct vnode *vp;
409         OUT struct mount **mpp;
410 };
411
412
413 %% print        vp      - - -
414
415 vop_print {
416         IN struct vnode *vp;
417 };
418
419
420 %% pathconf     vp      L L L
421
422 vop_pathconf {
423         IN struct vnode *vp;
424         IN int name;
425         OUT register_t *retval;
426 };
427
428
429 %% advlock      vp      U U U
430
431 vop_advlock {
432         IN struct vnode *vp;
433         IN void *id;
434         IN int op;
435         IN struct flock *fl;
436         IN int flags;
437 };
438
439
440 %% reallocblks  vp      E E E
441
442 vop_reallocblks {
443         IN struct vnode *vp;
444         IN struct cluster_save *buflist;
445 };
446
447
448 %% getpages     vp      L L L
449
450 vop_getpages {
451         IN struct vnode *vp;
452         IN vm_page_t *m;
453         IN int count;
454         IN int reqpage;
455         IN vm_ooffset_t offset;
456 };
457
458
459 %% putpages     vp      E E E
460
461 vop_putpages {
462         IN struct vnode *vp;
463         IN vm_page_t *m;
464         IN int count;
465         IN int sync;
466         IN int *rtvals;
467         IN vm_ooffset_t offset;
468 };
469
470
471 %% getacl       vp      L L L
472
473 vop_getacl {
474         IN struct vnode *vp;
475         IN acl_type_t type;
476         OUT struct acl *aclp;
477         IN struct ucred *cred;
478         IN struct thread *td;
479 };
480
481
482 %% setacl       vp      E E E
483
484 vop_setacl {
485         IN struct vnode *vp;
486         IN acl_type_t type;
487         IN struct acl *aclp;
488         IN struct ucred *cred;
489         IN struct thread *td;
490 };
491
492
493 %% aclcheck     vp      = = =
494
495 vop_aclcheck {
496         IN struct vnode *vp;
497         IN acl_type_t type;
498         IN struct acl *aclp;
499         IN struct ucred *cred;
500         IN struct thread *td;
501 };
502
503
504 %% closeextattr vp      L L L
505
506 vop_closeextattr {
507         IN struct vnode *vp;
508         IN int commit;
509         IN struct ucred *cred;
510         IN struct thread *td;
511 };
512
513
514 %% getextattr   vp      L L L
515
516 vop_getextattr {
517         IN struct vnode *vp;
518         IN int attrnamespace;
519         IN const char *name;
520         INOUT struct uio *uio;
521         OUT size_t *size;
522         IN struct ucred *cred;
523         IN struct thread *td;
524 };
525
526
527 %% listextattr  vp      L L L
528
529 vop_listextattr {
530         IN struct vnode *vp;
531         IN int attrnamespace;
532         INOUT struct uio *uio;
533         OUT size_t *size;
534         IN struct ucred *cred;
535         IN struct thread *td;
536 };
537
538
539 %% openextattr  vp      L L L
540
541 vop_openextattr {
542         IN struct vnode *vp;
543         IN struct ucred *cred;
544         IN struct thread *td;
545 };
546
547
548 %% deleteextattr        vp      E E E
549
550 vop_deleteextattr {
551         IN struct vnode *vp;
552         IN int attrnamespace;
553         IN const char *name;
554         IN struct ucred *cred;
555         IN struct thread *td;
556 };
557
558
559 %% setextattr   vp      E E E
560
561 vop_setextattr {
562         IN struct vnode *vp;
563         IN int attrnamespace;
564         IN const char *name;
565         INOUT struct uio *uio;
566         IN struct ucred *cred;
567         IN struct thread *td;
568 };
569
570
571 %% setlabel     vp      E E E
572
573 vop_setlabel {
574         IN struct vnode *vp;
575         IN struct label *label;
576         IN struct ucred *cred;
577         IN struct thread *td;
578 };
579
580
581 %% setlabel     vp      = = =
582
583 vop_vptofh {
584         IN struct vnode *vp;
585         IN struct fid *fhp;
586 };