vnode_if.src revision 116615
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. All advertising materials mentioning features or use of this software
14#    must display the following acknowledgement:
15#	This product includes software developed by the University of
16#	California, Berkeley and its contributors.
17# 4. Neither the name of the University nor the names of its contributors
18#    may be used to endorse or promote products derived from this software
19#    without specific prior written permission.
20#
21# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31# SUCH DAMAGE.
32#
33#	@(#)vnode_if.src	8.12 (Berkeley) 5/14/95
34# $FreeBSD: head/sys/kern/vnode_if.src 116615 2003-06-20 12:24:06Z se $
35#
36
37#
38# Above each of the vop descriptors is a specification of the locking
39# protocol used by each vop call.  The first column is the name of
40# the variable, the remaining three columns are in, out and error
41# respectively.  The "in" column defines the lock state on input,
42# the "out" column defines the state on succesful return, and the
43# "error" column defines the locking state on error exit.
44#
45# The locking value can take the following values:
46# L: locked; not converted to type of lock.
47# A: any lock type.
48# S: locked with shared lock.
49# E: locked with exclusive lock for this process.
50# O: locked with exclusive lock for other process.
51# U: unlocked.
52# -: not applicable.  vnode does not yet (or no longer) exists.
53# =: the same on input and output, may be either L or U.
54# X: locked if not nil.
55#
56# The paramater named "vpp" is assumed to be always used with double
57# indirection (**vpp) and that name is hard-codeed in vnode_if.awk !
58#
59# If other such parameters are introduced, they have to be added to
60# the AWK script at the head of the definition of "add_debug_code()".
61#
62
63#
64# islocked	vp	= = =
65#
66vop_islocked {
67	IN struct vnode *vp;
68	IN struct thread *td;
69};
70
71#
72# lookup	dvp	L ? ?
73# lookup	vpp	- L -
74#! lookup	pre	vop_lookup_pre
75#! lookup	post	vop_lookup_post
76#
77# XXX - the lookup locking protocol defies simple description and depends
78#	on the flags and operation fields in the (cnp) structure.  Note
79#	especially that *vpp may equal dvp and both may be locked.
80#
81vop_lookup {
82	IN struct vnode *dvp;
83	INOUT struct vnode **vpp;
84	IN struct componentname *cnp;
85};
86
87#
88#% cachedlookup	dvp	L ? ?
89#% cachedlookup	vpp	- L -
90#
91# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
92#
93vop_cachedlookup {
94	IN struct vnode *dvp;
95	INOUT struct vnode **vpp;
96	IN struct componentname *cnp;
97};
98
99#
100#% create	dvp	L L L
101#% create	vpp	- L -
102#
103vop_create {
104	IN struct vnode *dvp;
105	OUT struct vnode **vpp;
106	IN struct componentname *cnp;
107	IN struct vattr *vap;
108};
109
110#
111#% whiteout	dvp	L L L
112#
113vop_whiteout {
114	IN struct vnode *dvp;
115	IN struct componentname *cnp;
116	IN int flags;
117};
118
119#
120#% mknod	dvp	L L L
121#% mknod	vpp	- L -
122#
123vop_mknod {
124	IN struct vnode *dvp;
125	OUT struct vnode **vpp;
126	IN struct componentname *cnp;
127	IN struct vattr *vap;
128};
129
130#
131#% open		vp	L L L
132#
133vop_open {
134	IN struct vnode *vp;
135	IN int mode;
136	IN struct ucred *cred;
137	IN struct thread *td;
138};
139
140#
141#% close	vp	U U U
142#
143vop_close {
144	IN struct vnode *vp;
145	IN int fflag;
146	IN struct ucred *cred;
147	IN struct thread *td;
148};
149
150#
151#% access	vp	L L L
152#
153vop_access {
154	IN struct vnode *vp;
155	IN int mode;
156	IN struct ucred *cred;
157	IN struct thread *td;
158};
159
160#
161#% getattr	vp	L L L
162#
163vop_getattr {
164	IN struct vnode *vp;
165	OUT struct vattr *vap;
166	IN struct ucred *cred;
167	IN struct thread *td;
168};
169
170#
171#% setattr	vp	L L L
172#
173vop_setattr {
174	IN struct vnode *vp;
175	IN struct vattr *vap;
176	IN struct ucred *cred;
177	IN struct thread *td;
178};
179
180#
181#% read		vp	L L L
182#
183vop_read {
184	IN struct vnode *vp;
185	INOUT struct uio *uio;
186	IN int ioflag;
187	IN struct ucred *cred;
188};
189
190#
191#% write	vp	L L L
192#
193vop_write {
194	IN struct vnode *vp;
195	INOUT struct uio *uio;
196	IN int ioflag;
197	IN struct ucred *cred;
198};
199
200#
201#% lease	vp	= = =
202#
203vop_lease {
204	IN struct vnode *vp;
205	IN struct thread *td;
206	IN struct ucred *cred;
207	IN int flag;
208};
209
210#
211#% ioctl	vp	U U U
212#
213vop_ioctl {
214	IN struct vnode *vp;
215	IN u_long command;
216	IN caddr_t data;
217	IN int fflag;
218	IN struct ucred *cred;
219	IN struct thread *td;
220};
221
222#
223#% poll	vp	U U U
224#
225vop_poll {
226	IN struct vnode *vp;
227	IN int events;
228	IN struct ucred *cred;
229	IN struct thread *td;
230};
231
232#
233#% kqfilter	vp	U U U
234#
235vop_kqfilter {
236	IN struct vnode *vp;
237	IN struct knote *kn;
238};
239
240#
241#% revoke	vp	U U U
242#
243vop_revoke {
244	IN struct vnode *vp;
245	IN int flags;
246};
247
248#
249#% fsync	vp	L L L
250#
251vop_fsync {
252	IN struct vnode *vp;
253	IN struct ucred *cred;
254	IN int waitfor;
255	IN struct thread *td;
256};
257
258#
259#% remove	dvp	L L L
260#% remove	vp	L L L
261#
262vop_remove {
263	IN struct vnode *dvp;
264	IN struct vnode *vp;
265	IN struct componentname *cnp;
266};
267
268#
269#% link		tdvp	L L L
270#% link		vp	L L L
271#
272vop_link {
273	IN struct vnode *tdvp;
274	IN struct vnode *vp;
275	IN struct componentname *cnp;
276};
277
278#
279# rename	fdvp	U U U
280# rename	fvp	U U U
281# rename	tdvp	L U U
282# rename	tvp	X U U
283#! rename	pre	vop_rename_pre
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	L L L
296#% mkdir	vpp	- L -
297#
298vop_mkdir {
299	IN struct vnode *dvp;
300	OUT struct vnode **vpp;
301	IN struct componentname *cnp;
302	IN struct vattr *vap;
303};
304
305#
306#% rmdir	dvp	L L L
307#% rmdir	vp	L L L
308#
309vop_rmdir {
310	IN struct vnode *dvp;
311	IN struct vnode *vp;
312	IN struct componentname *cnp;
313};
314
315#
316#% symlink	dvp	L L L
317#% symlink	vpp	- L -
318#
319vop_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#
330vop_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#
342vop_readlink {
343	IN struct vnode *vp;
344	INOUT struct uio *uio;
345	IN struct ucred *cred;
346};
347
348#
349#% inactive	vp	L U U
350#
351vop_inactive {
352	IN struct vnode *vp;
353	IN struct thread *td;
354};
355
356#
357#% reclaim	vp	U U U
358#
359vop_reclaim {
360	IN struct vnode *vp;
361	IN struct thread *td;
362};
363
364#
365#lock		vp	? ? ?
366#! lock		pre	vop_lock_pre
367#! lock		post	vop_lock_post
368#
369vop_lock {
370	IN struct vnode *vp;
371	IN int flags;
372	IN struct thread *td;
373};
374
375#
376#unlock		vp	L ? L
377#! unlock	pre	vop_unlock_pre
378#! unlock	post	vop_unlock_post
379#
380vop_unlock {
381	IN struct vnode *vp;
382	IN int flags;
383	IN struct thread *td;
384};
385
386#
387#% bmap		vp	L L L
388#% bmap		vpp	- U -
389#
390vop_bmap {
391	IN struct vnode *vp;
392	IN daddr_t bn;
393	OUT struct vnode **vpp;
394	IN daddr_t *bnp;
395	OUT int *runp;
396	OUT int *runb;
397};
398
399#
400# strategy	vp	L L L
401#! strategy	pre	vop_strategy_pre
402#
403vop_strategy {
404	IN struct vnode *vp;
405	IN struct buf *bp;
406};
407
408#
409# specstrategy	vp	L L L
410#! specstrategy	pre	vop_strategy_pre
411#
412vop_specstrategy {
413	IN struct vnode *vp;
414	IN struct buf *bp;
415};
416
417#
418#% getwritemount vp	= = =
419#
420vop_getwritemount {
421	IN struct vnode *vp;
422	OUT struct mount **mpp;
423};
424
425#
426#% print	vp	= = =
427#
428vop_print {
429	IN struct vnode *vp;
430};
431
432#
433#% pathconf	vp	L L L
434#
435vop_pathconf {
436	IN struct vnode *vp;
437	IN int name;
438	OUT register_t *retval;
439};
440
441#
442#% advlock	vp	U U U
443#
444vop_advlock {
445	IN struct vnode *vp;
446	IN caddr_t id;
447	IN int op;
448	IN struct flock *fl;
449	IN int flags;
450};
451
452#
453#% reallocblks	vp	L L L
454#
455vop_reallocblks {
456	IN struct vnode *vp;
457	IN struct cluster_save *buflist;
458};
459
460#
461#% getpages	vp	L L L
462#
463vop_getpages {
464	IN struct vnode *vp;
465	IN vm_page_t *m;
466	IN int count;
467	IN int reqpage;
468	IN vm_ooffset_t offset;
469};
470
471#
472#% putpages	vp	L L L
473#
474vop_putpages {
475	IN struct vnode *vp;
476	IN vm_page_t *m;
477	IN int count;
478	IN int sync;
479	IN int *rtvals;
480	IN vm_ooffset_t offset;
481};
482
483#
484#% freeblks	vp	- - -
485#
486# This call is used by the filesystem to release blocks back to 
487# device-driver.  This is useful if the driver has a lengthy 
488# erase handling or similar.
489#
490
491vop_freeblks {
492	IN struct vnode *vp;
493	IN daddr_t addr;
494	IN daddr_t length;
495};
496
497#
498#% getacl	vp	L L L
499#
500vop_getacl {
501	IN struct vnode *vp;
502	IN acl_type_t type;
503	OUT struct acl *aclp;
504	IN struct ucred *cred;
505	IN struct thread *td;
506};
507
508#
509#% setacl	vp	L L L
510#
511vop_setacl {
512	IN struct vnode *vp;
513	IN acl_type_t type;
514	IN struct acl *aclp;
515	IN struct ucred *cred;
516	IN struct thread *td;
517};
518
519#
520#% aclcheck	vp	= = =
521#
522vop_aclcheck {
523	IN struct vnode *vp;
524	IN acl_type_t type;
525	IN struct acl *aclp;
526	IN struct ucred *cred;
527	IN struct thread *td;
528};
529
530#
531#% closeextattr	vp	L L L
532#
533vop_closeextattr {
534	IN struct vnode *vp;
535	IN int commit;
536	IN struct ucred *cred;
537	IN struct thread *td;
538};
539
540#
541#% getextattr	vp	L L L
542#
543vop_getextattr {
544	IN struct vnode *vp;
545	IN int attrnamespace;
546	IN const char *name;
547	INOUT struct uio *uio;
548	OUT size_t *size;
549	IN struct ucred *cred;
550	IN struct thread *td;
551};
552
553#
554#% listextattr	vp	L L L
555#
556vop_listextattr {
557	IN struct vnode *vp;
558	IN int attrnamespace;
559	INOUT struct uio *uio;
560	OUT size_t *size;
561	IN struct ucred *cred;
562	IN struct thread *td;
563};
564
565#
566#% openextattr	vp	L L L
567#
568vop_openextattr {
569	IN struct vnode *vp;
570	IN struct ucred *cred;
571	IN struct thread *td;
572};
573
574#
575#% setextattr	vp	L L L
576#
577vop_setextattr {
578	IN struct vnode *vp;
579	IN int attrnamespace;
580	IN const char *name;
581	INOUT struct uio *uio;
582	IN struct ucred *cred;
583	IN struct thread *td;
584};
585
586#
587#% createvobject	vp	L L L
588#
589vop_createvobject {
590	IN struct vnode *vp;
591	IN struct ucred *cred;
592	IN struct thread *td;
593};
594
595#
596#% destroyvobject	vp	L L L
597#
598vop_destroyvobject {
599	IN struct vnode *vp;
600};
601
602#
603#% getvobject	vp	L L L
604#
605vop_getvobject {
606	IN struct vnode *vp;
607	OUT struct vm_object **objpp;
608};
609
610#
611#% setlabel	vp	L L L
612#
613vop_setlabel {
614	IN struct vnode *vp;
615	IN struct label *label;
616	IN struct ucred *cred;
617	IN struct thread *td;
618};
619