vnode_if.src revision 302234
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: stable/10/sys/kern/vnode_if.src 302234 2016-06-27 21:50:30Z bdrewery $
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# 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
62vop_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
73vop_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
84vop_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
94vop_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
104vop_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
115vop_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%! open		post	vop_open_post
125
126vop_open {
127	IN struct vnode *vp;
128	IN int mode;
129	IN struct ucred *cred;
130	IN struct thread *td;
131	IN struct file *fp;
132};
133
134
135%% close	vp	L L L
136%! close	post	vop_close_post
137
138vop_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
148vop_access {
149	IN struct vnode *vp;
150	IN accmode_t accmode;
151	IN struct ucred *cred;
152	IN struct thread *td;
153};
154
155
156%% accessx	vp	L L L
157
158vop_accessx {
159	IN struct vnode *vp;
160	IN accmode_t accmode;
161	IN struct ucred *cred;
162	IN struct thread *td;
163};
164
165
166%% getattr	vp	L L L
167
168vop_getattr {
169	IN struct vnode *vp;
170	OUT struct vattr *vap;
171	IN struct ucred *cred;
172};
173
174
175%% setattr	vp	E E E
176%! setattr	post	vop_setattr_post
177
178vop_setattr {
179	IN struct vnode *vp;
180	IN struct vattr *vap;
181	IN struct ucred *cred;
182};
183
184%% markatime	vp	L L L
185
186vop_markatime {
187	IN struct vnode *vp;
188};
189
190%% read		vp	L L L
191%! read		post	vop_read_post
192
193vop_read {
194	IN struct vnode *vp;
195	INOUT struct uio *uio;
196	IN int ioflag;
197	IN struct ucred *cred;
198};
199
200
201%% write	vp	L L L
202%! write	pre	VOP_WRITE_PRE
203%! write	post	VOP_WRITE_POST
204
205vop_write {
206	IN struct vnode *vp;
207	INOUT struct uio *uio;
208	IN int ioflag;
209	IN struct ucred *cred;
210};
211
212
213%% ioctl	vp	U U U
214
215vop_ioctl {
216	IN struct vnode *vp;
217	IN u_long command;
218	IN void *data;
219	IN int fflag;
220	IN struct ucred *cred;
221	IN struct thread *td;
222};
223
224
225%% poll		vp	U U U
226
227vop_poll {
228	IN struct vnode *vp;
229	IN int events;
230	IN struct ucred *cred;
231	IN struct thread *td;
232};
233
234
235%% kqfilter	vp	U U U
236
237vop_kqfilter {
238	IN struct vnode *vp;
239	IN struct knote *kn;
240};
241
242
243%% revoke	vp	L L L
244
245vop_revoke {
246	IN struct vnode *vp;
247	IN int flags;
248};
249
250
251%% fsync	vp	L L L
252
253vop_fsync {
254	IN struct vnode *vp;
255	IN int waitfor;
256	IN struct thread *td;
257};
258
259
260%% remove	dvp	E E E
261%% remove	vp	E E E
262%! remove	post	vop_remove_post
263
264vop_remove {
265	IN struct vnode *dvp;
266	IN struct vnode *vp;
267	IN struct componentname *cnp;
268};
269
270
271%% link		tdvp	E E E
272%% link		vp	E E E
273%! link		post	vop_link_post
274
275vop_link {
276	IN struct vnode *tdvp;
277	IN struct vnode *vp;
278	IN struct componentname *cnp;
279};
280
281
282%! rename	pre	vop_rename_pre
283%! rename	post	vop_rename_post
284
285vop_rename {
286	IN WILLRELE struct vnode *fdvp;
287	IN WILLRELE struct vnode *fvp;
288	IN struct componentname *fcnp;
289	IN WILLRELE struct vnode *tdvp;
290	IN WILLRELE struct vnode *tvp;
291	IN struct componentname *tcnp;
292};
293
294
295%% mkdir	dvp	E E E
296%% mkdir	vpp	- E -
297%! mkdir	post	vop_mkdir_post
298
299vop_mkdir {
300	IN struct vnode *dvp;
301	OUT struct vnode **vpp;
302	IN struct componentname *cnp;
303	IN struct vattr *vap;
304};
305
306
307%% rmdir	dvp	E E E
308%% rmdir	vp	E E E
309%! rmdir	post	vop_rmdir_post
310
311vop_rmdir {
312	IN struct vnode *dvp;
313	IN struct vnode *vp;
314	IN struct componentname *cnp;
315};
316
317
318%% symlink	dvp	E E E
319%% symlink	vpp	- E -
320%! symlink	post	vop_symlink_post
321
322vop_symlink {
323	IN struct vnode *dvp;
324	OUT struct vnode **vpp;
325	IN struct componentname *cnp;
326	IN struct vattr *vap;
327	IN char *target;
328};
329
330
331%% readdir	vp	L L L
332%! readdir	post	vop_readdir_post
333
334vop_readdir {
335	IN struct vnode *vp;
336	INOUT struct uio *uio;
337	IN struct ucred *cred;
338	INOUT int *eofflag;
339	OUT int *ncookies;
340	INOUT u_long **cookies;
341};
342
343
344%% readlink	vp	L L L
345
346vop_readlink {
347	IN struct vnode *vp;
348	INOUT struct uio *uio;
349	IN struct ucred *cred;
350};
351
352
353%% inactive	vp	E E E
354
355vop_inactive {
356	IN struct vnode *vp;
357	IN struct thread *td;
358};
359
360
361%% reclaim	vp	E E E
362%! reclaim	post	vop_reclaim_post
363
364vop_reclaim {
365	IN struct vnode *vp;
366	IN struct thread *td;
367};
368
369
370%! lock1	pre	vop_lock_pre
371%! lock1	post	vop_lock_post
372
373vop_lock1 {
374	IN struct vnode *vp;
375	IN int flags;
376	IN char *file;
377	IN int line;
378};
379
380
381%! unlock	pre	vop_unlock_pre
382%! unlock	post	vop_unlock_post
383
384vop_unlock {
385	IN struct vnode *vp;
386	IN int flags;
387};
388
389
390%% bmap		vp	L L L
391
392vop_bmap {
393	IN struct vnode *vp;
394	IN daddr_t bn;
395	OUT struct bufobj **bop;
396	IN daddr_t *bnp;
397	OUT int *runp;
398	OUT int *runb;
399};
400
401
402%% strategy	vp	L L L
403%! strategy	pre	vop_strategy_pre
404
405vop_strategy {
406	IN struct vnode *vp;
407	IN struct buf *bp;
408};
409
410
411%% getwritemount vp	= = =
412
413vop_getwritemount {
414	IN struct vnode *vp;
415	OUT struct mount **mpp;
416};
417
418
419%% print	vp	- - -
420
421vop_print {
422	IN struct vnode *vp;
423};
424
425
426%% pathconf	vp	L L L
427
428vop_pathconf {
429	IN struct vnode *vp;
430	IN int name;
431	OUT register_t *retval;
432};
433
434
435%% advlock	vp	U U U
436
437vop_advlock {
438	IN struct vnode *vp;
439	IN void *id;
440	IN int op;
441	IN struct flock *fl;
442	IN int flags;
443};
444
445
446%% advlockasync	vp	U U U
447
448vop_advlockasync {
449	IN struct vnode *vp;
450	IN void *id;
451	IN int op;
452	IN struct flock *fl;
453	IN int flags;
454	IN struct task *task;	
455	INOUT void **cookiep;
456};
457
458
459%% advlockpurge	vp	E E E
460
461vop_advlockpurge {
462	IN struct vnode *vp;
463};
464
465
466%% reallocblks	vp	E E E
467
468vop_reallocblks {
469	IN struct vnode *vp;
470	IN struct cluster_save *buflist;
471};
472
473
474%% getpages	vp	L L L
475
476vop_getpages {
477	IN struct vnode *vp;
478	IN vm_page_t *m;
479	IN int count;
480	IN int reqpage;
481	IN vm_ooffset_t offset;
482};
483
484
485%% putpages	vp	L L L
486
487vop_putpages {
488	IN struct vnode *vp;
489	IN vm_page_t *m;
490	IN int count;
491	IN int sync;
492	IN int *rtvals;
493	IN vm_ooffset_t offset;
494};
495
496
497%% getacl	vp	L L L
498
499vop_getacl {
500	IN struct vnode *vp;
501	IN acl_type_t type;
502	OUT struct acl *aclp;
503	IN struct ucred *cred;
504	IN struct thread *td;
505};
506
507
508%% setacl	vp	E E E
509
510vop_setacl {
511	IN struct vnode *vp;
512	IN acl_type_t type;
513	IN struct acl *aclp;
514	IN struct ucred *cred;
515	IN struct thread *td;
516};
517
518
519%% aclcheck	vp	= = =
520
521vop_aclcheck {
522	IN struct vnode *vp;
523	IN acl_type_t type;
524	IN struct acl *aclp;
525	IN struct ucred *cred;
526	IN struct thread *td;
527};
528
529
530%% closeextattr	vp	L L L
531
532vop_closeextattr {
533	IN struct vnode *vp;
534	IN int commit;
535	IN struct ucred *cred;
536	IN struct thread *td;
537};
538
539
540%% getextattr	vp	L L L
541
542vop_getextattr {
543	IN struct vnode *vp;
544	IN int attrnamespace;
545	IN const char *name;
546	INOUT struct uio *uio;
547	OUT size_t *size;
548	IN struct ucred *cred;
549	IN struct thread *td;
550};
551
552
553%% listextattr	vp	L L L
554
555vop_listextattr {
556	IN struct vnode *vp;
557	IN int attrnamespace;
558	INOUT struct uio *uio;
559	OUT size_t *size;
560	IN struct ucred *cred;
561	IN struct thread *td;
562};
563
564
565%% openextattr	vp	L L L
566
567vop_openextattr {
568	IN struct vnode *vp;
569	IN struct ucred *cred;
570	IN struct thread *td;
571};
572
573
574%% deleteextattr	vp	E E E
575%! deleteextattr	post	vop_deleteextattr_post
576
577vop_deleteextattr {
578	IN struct vnode *vp;
579	IN int attrnamespace;
580	IN const char *name;
581	IN struct ucred *cred;
582	IN struct thread *td;
583};
584
585
586%% setextattr	vp	E E E
587%! setextattr	post	vop_setextattr_post
588
589vop_setextattr {
590	IN struct vnode *vp;
591	IN int attrnamespace;
592	IN const char *name;
593	INOUT struct uio *uio;
594	IN struct ucred *cred;
595	IN struct thread *td;
596};
597
598
599%% setlabel	vp	E E E
600
601vop_setlabel {
602	IN struct vnode *vp;
603	IN struct label *label;
604	IN struct ucred *cred;
605	IN struct thread *td;
606};
607
608
609%% vptofh	vp	= = =
610
611vop_vptofh {
612	IN struct vnode *vp;
613	IN struct fid *fhp;
614};
615
616
617%% vptocnp		vp	L L L
618%% vptocnp		vpp	- U -
619
620vop_vptocnp {
621	IN struct vnode *vp;
622	OUT struct vnode **vpp;
623	IN struct ucred *cred;
624	INOUT char *buf;
625	INOUT int *buflen;
626};
627
628
629%% allocate	vp	E E E
630
631vop_allocate {
632	IN struct vnode *vp;
633	INOUT off_t *offset;
634	INOUT off_t *len;
635};
636
637%% advise	vp	U U U
638
639vop_advise {
640	IN struct vnode *vp;
641	IN off_t start;
642	IN off_t end;
643	IN int advice;
644};
645
646%% unp_bind	vp	E E E
647
648vop_unp_bind {
649	IN struct vnode *vp;
650	IN struct socket *socket;
651};
652
653%% unp_connect	vp	L L L
654
655vop_unp_connect {
656	IN struct vnode *vp;
657	OUT struct socket **socket;
658};
659
660%% unp_detach	vp	= = =
661
662vop_unp_detach {
663	IN struct vnode *vp;
664};
665
666%% is_text	vp	L L L
667
668vop_is_text {
669	IN struct vnode *vp;
670};
671
672%% set_text	vp	E E E
673
674vop_set_text {
675	IN struct vnode *vp;
676};
677
678%% vop_unset_text	vp	E E E
679
680vop_unset_text {
681	IN struct vnode *vp;
682};
683
684%% get_writecount	vp	L L L
685
686vop_get_writecount {
687	IN struct vnode *vp;
688	OUT int *writecount;
689};
690
691%% add_writecount	vp	E E E
692
693vop_add_writecount {
694	IN struct vnode *vp;
695	IN int inc;
696};
697
698# The VOPs below are spares at the end of the table to allow new VOPs to be
699# added in stable branches without breaking the KBI.  New VOPs in HEAD should
700# be added above these spares.  When merging a new VOP to a stable branch,
701# the new VOP should replace one of the spares.
702
703vop_spare1 {
704	IN struct vnode *vp;
705};
706
707vop_spare2 {
708	IN struct vnode *vp;
709};
710
711vop_spare3 {
712	IN struct vnode *vp;
713};
714
715vop_spare4 {
716	IN struct vnode *vp;
717};
718
719vop_spare5 {
720	IN struct vnode *vp;
721};
722