xref: /freebsd/sys/kern/vnode_if.src (revision 6b3455a7665208c366849f0b2b3bc916fb97516e)
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 is a specification of the locking
35# protocol used by each vop call.  The first column is the name of
36# the variable, the remaining three columns are in, out and error
37# respectively.  The "in" column defines the lock state on input,
38# the "out" column defines the state on succesful return, and the
39# "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# If other such parameters are introduced, they have to be added to
56# the AWK script at the head of the definition of "add_debug_code()".
57#
58
59#
60# islocked	vp	= = =
61#
62vop_islocked {
63	IN struct vnode *vp;
64	IN struct thread *td;
65};
66
67#
68# lookup	dvp	L ? ?
69# lookup	vpp	- L -
70#! lookup	pre	vop_lookup_pre
71#! lookup	post	vop_lookup_post
72#
73# XXX - the lookup locking protocol defies simple description and depends
74#	on the flags and operation fields in the (cnp) structure.  Note
75#	especially that *vpp may equal dvp and both may be locked.
76#
77vop_lookup {
78	IN struct vnode *dvp;
79	INOUT struct vnode **vpp;
80	IN struct componentname *cnp;
81};
82
83#
84#% cachedlookup	dvp	L ? ?
85#% cachedlookup	vpp	- L -
86#
87# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
88#
89vop_cachedlookup {
90	IN struct vnode *dvp;
91	INOUT struct vnode **vpp;
92	IN struct componentname *cnp;
93};
94
95#
96#% create	dvp	L L L
97#% create	vpp	- L -
98#
99vop_create {
100	IN struct vnode *dvp;
101	OUT struct vnode **vpp;
102	IN struct componentname *cnp;
103	IN struct vattr *vap;
104};
105
106#
107#% whiteout	dvp	L L L
108#
109vop_whiteout {
110	IN struct vnode *dvp;
111	IN struct componentname *cnp;
112	IN int flags;
113};
114
115#
116#% mknod	dvp	L L L
117#% mknod	vpp	- L -
118#
119vop_mknod {
120	IN struct vnode *dvp;
121	OUT struct vnode **vpp;
122	IN struct componentname *cnp;
123	IN struct vattr *vap;
124};
125
126#
127#% open		vp	L L L
128#
129vop_open {
130	IN struct vnode *vp;
131	IN int mode;
132	IN struct ucred *cred;
133	IN struct thread *td;
134	IN int fdidx;
135};
136
137#
138#% close	vp	U U U
139#
140vop_close {
141	IN struct vnode *vp;
142	IN int fflag;
143	IN struct ucred *cred;
144	IN struct thread *td;
145};
146
147#
148#% access	vp	L L L
149#
150vop_access {
151	IN struct vnode *vp;
152	IN int mode;
153	IN struct ucred *cred;
154	IN struct thread *td;
155};
156
157#
158#% getattr	vp	L L L
159#
160vop_getattr {
161	IN struct vnode *vp;
162	OUT struct vattr *vap;
163	IN struct ucred *cred;
164	IN struct thread *td;
165};
166
167#
168#% setattr	vp	L L L
169#
170vop_setattr {
171	IN struct vnode *vp;
172	IN struct vattr *vap;
173	IN struct ucred *cred;
174	IN struct thread *td;
175};
176
177#
178#% read		vp	L L L
179#
180vop_read {
181	IN struct vnode *vp;
182	INOUT struct uio *uio;
183	IN int ioflag;
184	IN struct ucred *cred;
185};
186
187#
188#% write	vp	L L L
189#
190vop_write {
191	IN struct vnode *vp;
192	INOUT struct uio *uio;
193	IN int ioflag;
194	IN struct ucred *cred;
195};
196
197#
198#% lease	vp	= = =
199#
200vop_lease {
201	IN struct vnode *vp;
202	IN struct thread *td;
203	IN struct ucred *cred;
204	IN int flag;
205};
206
207#
208#% ioctl	vp	U U U
209#
210vop_ioctl {
211	IN struct vnode *vp;
212	IN u_long command;
213	IN caddr_t data;
214	IN int fflag;
215	IN struct ucred *cred;
216	IN struct thread *td;
217};
218
219#
220#% poll	vp	U U U
221#
222vop_poll {
223	IN struct vnode *vp;
224	IN int events;
225	IN struct ucred *cred;
226	IN struct thread *td;
227};
228
229#
230#% kqfilter	vp	U U U
231#
232vop_kqfilter {
233	IN struct vnode *vp;
234	IN struct knote *kn;
235};
236
237#
238#% revoke	vp	U U U
239#
240vop_revoke {
241	IN struct vnode *vp;
242	IN int flags;
243};
244
245#
246#% fsync	vp	L L L
247#
248vop_fsync {
249	IN struct vnode *vp;
250	IN struct ucred *cred;
251	IN int waitfor;
252	IN struct thread *td;
253};
254
255#
256#% remove	dvp	L L L
257#% remove	vp	L L L
258#
259vop_remove {
260	IN struct vnode *dvp;
261	IN struct vnode *vp;
262	IN struct componentname *cnp;
263};
264
265#
266#% link		tdvp	L L L
267#% link		vp	L L L
268#
269vop_link {
270	IN struct vnode *tdvp;
271	IN struct vnode *vp;
272	IN struct componentname *cnp;
273};
274
275#
276# rename	fdvp	U U U
277# rename	fvp	U U U
278# rename	tdvp	L U U
279# rename	tvp	X U U
280#! rename	pre	vop_rename_pre
281#
282vop_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	L L L
293#% mkdir	vpp	- L -
294#
295vop_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	L L L
304#% rmdir	vp	L L L
305#
306vop_rmdir {
307	IN struct vnode *dvp;
308	IN struct vnode *vp;
309	IN struct componentname *cnp;
310};
311
312#
313#% symlink	dvp	L L L
314#% symlink	vpp	- L -
315#
316vop_symlink {
317	IN struct vnode *dvp;
318	OUT struct vnode **vpp;
319	IN struct componentname *cnp;
320	IN struct vattr *vap;
321	IN char *target;
322};
323
324#
325#% readdir	vp	L L L
326#
327vop_readdir {
328	IN struct vnode *vp;
329	INOUT struct uio *uio;
330	IN struct ucred *cred;
331	INOUT int *eofflag;
332	OUT int *ncookies;
333	INOUT u_long **cookies;
334};
335
336#
337#% readlink	vp	L L L
338#
339vop_readlink {
340	IN struct vnode *vp;
341	INOUT struct uio *uio;
342	IN struct ucred *cred;
343};
344
345#
346#% inactive	vp	L U U
347#
348vop_inactive {
349	IN struct vnode *vp;
350	IN struct thread *td;
351};
352
353#
354#% reclaim	vp	U U U
355#
356vop_reclaim {
357	IN struct vnode *vp;
358	IN struct thread *td;
359};
360
361#
362#lock		vp	? ? ?
363#! lock		pre	vop_lock_pre
364#! lock		post	vop_lock_post
365#
366vop_lock {
367	IN struct vnode *vp;
368	IN int flags;
369	IN struct thread *td;
370};
371
372#
373#unlock		vp	L ? L
374#! unlock	pre	vop_unlock_pre
375#! unlock	post	vop_unlock_post
376#
377vop_unlock {
378	IN struct vnode *vp;
379	IN int flags;
380	IN struct thread *td;
381};
382
383#
384#% bmap		vp	L L L
385#% bmap		vpp	- U -
386#
387vop_bmap {
388	IN struct vnode *vp;
389	IN daddr_t bn;
390	OUT struct vnode **vpp;
391	IN daddr_t *bnp;
392	OUT int *runp;
393	OUT int *runb;
394};
395
396#
397# strategy	vp	L L L
398#! strategy	pre	vop_strategy_pre
399#
400vop_strategy {
401	IN struct vnode *vp;
402	IN struct buf *bp;
403};
404
405#
406# specstrategy	vp	L L L
407#! specstrategy	pre	vop_strategy_pre
408#
409vop_specstrategy {
410	IN struct vnode *vp;
411	IN struct buf *bp;
412};
413
414#
415#% getwritemount vp	= = =
416#
417vop_getwritemount {
418	IN struct vnode *vp;
419	OUT struct mount **mpp;
420};
421
422#
423#% print	vp	= = =
424#
425vop_print {
426	IN struct vnode *vp;
427};
428
429#
430#% pathconf	vp	L L L
431#
432vop_pathconf {
433	IN struct vnode *vp;
434	IN int name;
435	OUT register_t *retval;
436};
437
438#
439#% advlock	vp	U U U
440#
441vop_advlock {
442	IN struct vnode *vp;
443	IN caddr_t id;
444	IN int op;
445	IN struct flock *fl;
446	IN int flags;
447};
448
449#
450#% reallocblks	vp	L L L
451#
452vop_reallocblks {
453	IN struct vnode *vp;
454	IN struct cluster_save *buflist;
455};
456
457#
458#% getpages	vp	L L L
459#
460vop_getpages {
461	IN struct vnode *vp;
462	IN vm_page_t *m;
463	IN int count;
464	IN int reqpage;
465	IN vm_ooffset_t offset;
466};
467
468#
469#% putpages	vp	L L L
470#
471vop_putpages {
472	IN struct vnode *vp;
473	IN vm_page_t *m;
474	IN int count;
475	IN int sync;
476	IN int *rtvals;
477	IN vm_ooffset_t offset;
478};
479
480#
481#% freeblks	vp	- - -
482#
483# This call is used by the filesystem to release blocks back to
484# device-driver.  This is useful if the driver has a lengthy
485# erase handling or similar.
486#
487
488vop_freeblks {
489	IN struct vnode *vp;
490	IN daddr_t addr;
491	IN daddr_t length;
492};
493
494#
495#% getacl	vp	L L L
496#
497vop_getacl {
498	IN struct vnode *vp;
499	IN acl_type_t type;
500	OUT struct acl *aclp;
501	IN struct ucred *cred;
502	IN struct thread *td;
503};
504
505#
506#% setacl	vp	L L L
507#
508vop_setacl {
509	IN struct vnode *vp;
510	IN acl_type_t type;
511	IN struct acl *aclp;
512	IN struct ucred *cred;
513	IN struct thread *td;
514};
515
516#
517#% aclcheck	vp	= = =
518#
519vop_aclcheck {
520	IN struct vnode *vp;
521	IN acl_type_t type;
522	IN struct acl *aclp;
523	IN struct ucred *cred;
524	IN struct thread *td;
525};
526
527#
528#% closeextattr	vp	L L L
529#
530vop_closeextattr {
531	IN struct vnode *vp;
532	IN int commit;
533	IN struct ucred *cred;
534	IN struct thread *td;
535};
536
537#
538#% getextattr	vp	L L L
539#
540vop_getextattr {
541	IN struct vnode *vp;
542	IN int attrnamespace;
543	IN const char *name;
544	INOUT struct uio *uio;
545	OUT size_t *size;
546	IN struct ucred *cred;
547	IN struct thread *td;
548};
549
550#
551#% listextattr	vp	L L L
552#
553vop_listextattr {
554	IN struct vnode *vp;
555	IN int attrnamespace;
556	INOUT struct uio *uio;
557	OUT size_t *size;
558	IN struct ucred *cred;
559	IN struct thread *td;
560};
561
562#
563#% openextattr	vp	L L L
564#
565vop_openextattr {
566	IN struct vnode *vp;
567	IN struct ucred *cred;
568	IN struct thread *td;
569};
570
571#
572#% deleteextattr	vp	L L L
573#
574vop_deleteextattr {
575	IN struct vnode *vp;
576	IN int attrnamespace;
577	IN const char *name;
578	IN struct ucred *cred;
579	IN struct thread *td;
580};
581
582#
583#% setextattr	vp	L L L
584#
585vop_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#% createvobject	vp	L L L
596#
597vop_createvobject {
598	IN struct vnode *vp;
599	IN struct ucred *cred;
600	IN struct thread *td;
601};
602
603#
604#% destroyvobject	vp	L L L
605#
606vop_destroyvobject {
607	IN struct vnode *vp;
608};
609
610#
611#% getvobject	vp	L L L
612#
613vop_getvobject {
614	IN struct vnode *vp;
615	OUT struct vm_object **objpp;
616};
617
618#
619#% setlabel	vp	L L L
620#
621vop_setlabel {
622	IN struct vnode *vp;
623	IN struct label *label;
624	IN struct ucred *cred;
625	IN struct thread *td;
626};
627