vnode_if.src revision 103636
1294332Sdes#
2276707Sdes# Copyright (c) 1992, 1993
3276707Sdes#	The Regents of the University of California.  All rights reserved.
4276707Sdes#
5276707Sdes# Redistribution and use in source and binary forms, with or without
6276707Sdes# modification, are permitted provided that the following conditions
7276707Sdes# are met:
8276707Sdes# 1. Redistributions of source code must retain the above copyright
9276707Sdes#    notice, this list of conditions and the following disclaimer.
10276707Sdes# 2. Redistributions in binary form must reproduce the above copyright
11276707Sdes#    notice, this list of conditions and the following disclaimer in the
12276707Sdes#    documentation and/or other materials provided with the distribution.
13276707Sdes# 3. All advertising materials mentioning features or use of this software
14276707Sdes#    must display the following acknowledgement:
15276707Sdes#	This product includes software developed by the University of
16276707Sdes#	California, Berkeley and its contributors.
17276707Sdes# 4. Neither the name of the University nor the names of its contributors
18276707Sdes#    may be used to endorse or promote products derived from this software
19276707Sdes#    without specific prior written permission.
20276707Sdes#
21276707Sdes# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22276707Sdes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23294332Sdes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24276707Sdes# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25276707Sdes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26276707Sdes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27276707Sdes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28276707Sdes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29276707Sdes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30276707Sdes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31276707Sdes# SUCH DAMAGE.
32276707Sdes#
33294332Sdes#	@(#)vnode_if.src	8.12 (Berkeley) 5/14/95
34294332Sdes# $FreeBSD: head/sys/kern/vnode_if.src 103636 2002-09-19 13:32:45Z truckman $
35276707Sdes#
36276707Sdes
37294332Sdes#
38276707Sdes# Above each of the vop descriptors is a specification of the locking
39276707Sdes# protocol used by each vop call.  The first column is the name of
40276707Sdes# the variable, the remaining three columns are in, out and error
41276707Sdes# respectively.  The "in" column defines the lock state on input,
42276707Sdes# the "out" column defines the state on succesful return, and the
43276707Sdes# "error" column defines the locking state on error exit.
44276707Sdes#
45276707Sdes# The locking value can take the following values:
46276707Sdes# L: locked; not converted to type of lock.
47276707Sdes# A: any lock type.
48276707Sdes# S: locked with shared lock.
49276707Sdes# E: locked with exclusive lock for this process.
50276707Sdes# O: locked with exclusive lock for other process.
51276707Sdes# U: unlocked.
52276707Sdes# -: not applicable.  vnode does not yet (or no longer) exists.
53276707Sdes# =: the same on input and output, may be either L or U.
54276707Sdes# X: locked if not nil.
55276707Sdes#
56276707Sdes
57276707Sdes#
58276707Sdes#% islocked	vp	= = =
59276707Sdes#
60276707Sdesvop_islocked {
61276707Sdes	IN struct vnode *vp;
62276707Sdes	IN struct thread *td;
63276707Sdes};
64276707Sdes
65276707Sdes#
66276707Sdes# lookup	dvp	L ? ?
67276707Sdes# lookup	vpp	- L -
68276707Sdes#! lookup	pre	vop_lookup_pre
69276707Sdes#! lookup	post	vop_lookup_post
70276707Sdes#
71276707Sdes# XXX - the lookup locking protocol defies simple description and depends
72276707Sdes#	on the flags and operation fields in the (cnp) structure.  Note
73276707Sdes#	especially that *vpp may equal dvp and both may be locked.
74276707Sdes#
75276707Sdesvop_lookup {
76276707Sdes	IN struct vnode *dvp;
77276707Sdes	INOUT struct vnode **vpp;
78276707Sdes	IN struct componentname *cnp;
79276707Sdes};
80276707Sdes
81276707Sdes#
82276707Sdes#% cachedlookup	dvp	L ? ?
83276707Sdes#% cachedlookup	vpp	- L -
84276707Sdes#
85276707Sdes# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
86276707Sdes#
87276707Sdesvop_cachedlookup {
88276707Sdes	IN struct vnode *dvp;
89276707Sdes	INOUT struct vnode **vpp;
90276707Sdes	IN struct componentname *cnp;
91276707Sdes};
92276707Sdes
93276707Sdes#
94276707Sdes#% create	dvp	L L L
95276707Sdes#% create	vpp	- L -
96276707Sdes#
97276707Sdesvop_create {
98276707Sdes	IN struct vnode *dvp;
99276707Sdes	OUT struct vnode **vpp;
100276707Sdes	IN struct componentname *cnp;
101276707Sdes	IN struct vattr *vap;
102294332Sdes};
103294332Sdes
104276707Sdes#
105294332Sdes#% whiteout	dvp	L L L
106294332Sdes#
107276707Sdesvop_whiteout {
108276707Sdes	IN struct vnode *dvp;
109276707Sdes	IN struct componentname *cnp;
110294332Sdes	IN int flags;
111276707Sdes};
112276707Sdes
113294332Sdes#
114276707Sdes#% mknod	dvp	L L L
115294332Sdes#% mknod	vpp	- L -
116276707Sdes#
117276707Sdesvop_mknod {
118276707Sdes	IN struct vnode *dvp;
119276707Sdes	OUT struct vnode **vpp;
120294332Sdes	IN struct componentname *cnp;
121276707Sdes	IN struct vattr *vap;
122294332Sdes};
123276707Sdes
124276707Sdes#
125294332Sdes#% open		vp	L L L
126276707Sdes#
127294332Sdesvop_open {
128276707Sdes	IN struct vnode *vp;
129276707Sdes	IN int mode;
130276707Sdes	IN struct ucred *cred;
131276707Sdes	IN struct thread *td;
132294332Sdes};
133276707Sdes
134294332Sdes#
135276707Sdes#% close	vp	U U U
136276707Sdes#
137294332Sdesvop_close {
138276707Sdes	IN struct vnode *vp;
139294332Sdes	IN int fflag;
140276707Sdes	IN struct ucred *cred;
141276707Sdes	IN struct thread *td;
142294332Sdes};
143276707Sdes
144276707Sdes#
145294332Sdes#% access	vp	L L L
146276707Sdes#
147276707Sdesvop_access {
148276707Sdes	IN struct vnode *vp;
149276707Sdes	IN int mode;
150294332Sdes	IN struct ucred *cred;
151276707Sdes	IN struct thread *td;
152294332Sdes};
153276707Sdes
154276707Sdes#
155294332Sdes#% getattr	vp	L L L
156276707Sdes#
157294332Sdesvop_getattr {
158294332Sdes	IN struct vnode *vp;
159294332Sdes	OUT struct vattr *vap;
160294332Sdes	IN struct ucred *cred;
161294332Sdes	IN struct thread *td;
162276707Sdes};
163276707Sdes
164276707Sdes#
165276707Sdes#% setattr	vp	L L L
166276707Sdes#
167276707Sdesvop_setattr {
168276707Sdes	IN struct vnode *vp;
169276707Sdes	IN struct vattr *vap;
170276707Sdes	IN struct ucred *cred;
171276707Sdes	IN struct thread *td;
172276707Sdes};
173276707Sdes
174276707Sdes#
175276707Sdes#% read		vp	L L L
176276707Sdes#
177276707Sdesvop_read {
178276707Sdes	IN struct vnode *vp;
179276707Sdes	INOUT struct uio *uio;
180276707Sdes	IN int ioflag;
181276707Sdes	IN struct ucred *cred;
182276707Sdes};
183294332Sdes
184294332Sdes#
185294332Sdes#% write	vp	L L L
186294332Sdes#
187294332Sdesvop_write {
188294332Sdes	IN struct vnode *vp;
189294332Sdes	INOUT struct uio *uio;
190294332Sdes	IN int ioflag;
191294332Sdes	IN struct ucred *cred;
192294332Sdes};
193294332Sdes
194294332Sdes#
195294332Sdes#% lease	vp	= = =
196294332Sdes#
197294332Sdesvop_lease {
198294332Sdes	IN struct vnode *vp;
199294332Sdes	IN struct thread *td;
200294332Sdes	IN struct ucred *cred;
201294332Sdes	IN int flag;
202294332Sdes};
203294332Sdes
204294332Sdes#
205294332Sdes#% ioctl	vp	U U U
206294332Sdes#
207294332Sdesvop_ioctl {
208294332Sdes	IN struct vnode *vp;
209294332Sdes	IN u_long command;
210294332Sdes	IN caddr_t data;
211294332Sdes	IN int fflag;
212294332Sdes	IN struct ucred *cred;
213294332Sdes	IN struct thread *td;
214294332Sdes};
215294332Sdes
216276707Sdes#
217276707Sdes#% poll	vp	U U U
218276707Sdes#
219276707Sdesvop_poll {
220276707Sdes	IN struct vnode *vp;
221276707Sdes	IN int events;
222276707Sdes	IN struct ucred *cred;
223276707Sdes	IN struct thread *td;
224276707Sdes};
225276707Sdes
226276707Sdes#
227276707Sdes#% kqfilter	vp	U U U
228276707Sdes#
229276707Sdesvop_kqfilter {
230276707Sdes	IN struct vnode *vp;
231276707Sdes	IN struct knote *kn;
232276707Sdes};
233276707Sdes
234276707Sdes#
235294332Sdes#% revoke	vp	U U U
236294332Sdes#
237294332Sdesvop_revoke {
238294332Sdes	IN struct vnode *vp;
239294332Sdes	IN int flags;
240294332Sdes};
241276707Sdes
242276707Sdes#
243276707Sdes#% fsync	vp	L L L
244276707Sdes#
245276707Sdesvop_fsync {
246276707Sdes	IN struct vnode *vp;
247276707Sdes	IN struct ucred *cred;
248294332Sdes	IN int waitfor;
249294332Sdes	IN struct thread *td;
250294332Sdes};
251294332Sdes
252276707Sdes#
253276707Sdes#% remove	dvp	L L L
254276707Sdes#% remove	vp	L L L
255276707Sdes#
256276707Sdesvop_remove {
257276707Sdes	IN struct vnode *dvp;
258276707Sdes	IN struct vnode *vp;
259276707Sdes	IN struct componentname *cnp;
260276707Sdes};
261276707Sdes
262276707Sdes#
263276707Sdes#% link		tdvp	L L L
264276707Sdes#% link		vp	L L L
265276707Sdes#
266276707Sdesvop_link {
267276707Sdes	IN struct vnode *tdvp;
268276707Sdes	IN struct vnode *vp;
269276707Sdes	IN struct componentname *cnp;
270276707Sdes};
271276707Sdes
272276707Sdes#
273276707Sdes# rename	fdvp	U U U
274276707Sdes# rename	fvp	U U U
275276707Sdes# rename	tdvp	L U U
276276707Sdes# rename	tvp	X U U
277276707Sdes#! rename	pre	vop_rename_pre
278276707Sdes#
279276707Sdesvop_rename {
280276707Sdes	IN WILLRELE struct vnode *fdvp;
281276707Sdes	IN WILLRELE struct vnode *fvp;
282276707Sdes	IN struct componentname *fcnp;
283276707Sdes	IN WILLRELE struct vnode *tdvp;
284276707Sdes	IN WILLRELE struct vnode *tvp;
285276707Sdes	IN struct componentname *tcnp;
286276707Sdes};
287276707Sdes
288276707Sdes#
289276707Sdes#% mkdir	dvp	L L L
290276707Sdes#% mkdir	vpp	- L -
291276707Sdes#
292276707Sdesvop_mkdir {
293276707Sdes	IN struct vnode *dvp;
294276707Sdes	OUT struct vnode **vpp;
295276707Sdes	IN struct componentname *cnp;
296276707Sdes	IN struct vattr *vap;
297276707Sdes};
298276707Sdes
299276707Sdes#
300276707Sdes#% rmdir	dvp	L L L
301276707Sdes#% rmdir	vp	L L L
302276707Sdes#
303276707Sdesvop_rmdir {
304276707Sdes	IN struct vnode *dvp;
305276707Sdes	IN struct vnode *vp;
306276707Sdes	IN struct componentname *cnp;
307276707Sdes};
308276707Sdes
309276707Sdes#
310276707Sdes#% symlink	dvp	L L L
311276707Sdes#% symlink	vpp	- L -
312276707Sdes#
313276707Sdesvop_symlink {
314276707Sdes	IN struct vnode *dvp;
315276707Sdes	OUT struct vnode **vpp;
316276707Sdes	IN struct componentname *cnp;
317276707Sdes	IN struct vattr *vap;
318276707Sdes	IN char *target;
319276707Sdes};
320276707Sdes
321276707Sdes#
322276707Sdes#% readdir	vp	L L L
323276707Sdes#
324276707Sdesvop_readdir {
325276707Sdes	IN struct vnode *vp;
326276707Sdes	INOUT struct uio *uio;
327276707Sdes	IN struct ucred *cred;
328276707Sdes	INOUT int *eofflag;
329276707Sdes	OUT int *ncookies;
330276707Sdes	INOUT u_long **cookies;
331276707Sdes};
332276707Sdes
333276707Sdes#
334276707Sdes#% readlink	vp	L L L
335276707Sdes#
336276707Sdesvop_readlink {
337276707Sdes	IN struct vnode *vp;
338276707Sdes	INOUT struct uio *uio;
339276707Sdes	IN struct ucred *cred;
340276707Sdes};
341276707Sdes
342276707Sdes#
343276707Sdes#% inactive	vp	L U U
344276707Sdes#
345276707Sdesvop_inactive {
346276707Sdes	IN struct vnode *vp;
347276707Sdes	IN struct thread *td;
348276707Sdes};
349276707Sdes
350276707Sdes#
351276707Sdes#% reclaim	vp	U U U
352276707Sdes#
353276707Sdesvop_reclaim {
354276707Sdes	IN struct vnode *vp;
355276707Sdes	IN struct thread *td;
356276707Sdes};
357276707Sdes
358276707Sdes#
359276707Sdes#lock		vp	? ? ?
360276707Sdes#! lock		pre	vop_lock_pre
361276707Sdes#! lock		post	vop_lock_post
362276707Sdes#
363276707Sdesvop_lock {
364276707Sdes	IN struct vnode *vp;
365276707Sdes	IN int flags;
366276707Sdes	IN struct thread *td;
367276707Sdes};
368276707Sdes
369276707Sdes#
370276707Sdes#unlock		vp	L ? L
371276707Sdes#! unlock	pre	vop_unlock_pre
372276707Sdes#! unlock	post	vop_unlock_post
373276707Sdes#
374276707Sdesvop_unlock {
375276707Sdes	IN struct vnode *vp;
376276707Sdes	IN int flags;
377276707Sdes	IN struct thread *td;
378276707Sdes};
379276707Sdes
380276707Sdes#
381294332Sdes#% bmap		vp	L L L
382294332Sdes#% bmap		vpp	- U -
383294332Sdes#
384294332Sdesvop_bmap {
385294332Sdes	IN struct vnode *vp;
386294332Sdes	IN daddr_t bn;
387294332Sdes	OUT struct vnode **vpp;
388294332Sdes	IN daddr_t *bnp;
389276707Sdes	OUT int *runp;
390276707Sdes	OUT int *runb;
391276707Sdes};
392276707Sdes
393276707Sdes#
394276707Sdes# strategy	vp	L L L
395276707Sdes#! strategy	pre	vop_strategy_pre
396276707Sdes#
397276707Sdesvop_strategy {
398276707Sdes	IN struct vnode *vp;
399276707Sdes	IN struct buf *bp;
400276707Sdes};
401276707Sdes
402276707Sdes#
403276707Sdes#% getwritemount vp	= = =
404276707Sdes#
405276707Sdesvop_getwritemount {
406276707Sdes	IN struct vnode *vp;
407276707Sdes	OUT struct mount **mpp;
408276707Sdes};
409276707Sdes
410276707Sdes#
411276707Sdes#% print	vp	= = =
412276707Sdes#
413276707Sdesvop_print {
414276707Sdes	IN struct vnode *vp;
415276707Sdes};
416276707Sdes
417276707Sdes#
418276707Sdes#% pathconf	vp	L L L
419276707Sdes#
420276707Sdesvop_pathconf {
421276707Sdes	IN struct vnode *vp;
422276707Sdes	IN int name;
423276707Sdes	OUT register_t *retval;
424276707Sdes};
425276707Sdes
426276707Sdes#
427276707Sdes#% advlock	vp	U U U
428276707Sdes#
429276707Sdesvop_advlock {
430276707Sdes	IN struct vnode *vp;
431276707Sdes	IN caddr_t id;
432276707Sdes	IN int op;
433276707Sdes	IN struct flock *fl;
434276707Sdes	IN int flags;
435276707Sdes};
436276707Sdes
437276707Sdes#
438276707Sdes#% reallocblks	vp	L L L
439#
440vop_reallocblks {
441	IN struct vnode *vp;
442	IN struct cluster_save *buflist;
443};
444
445#
446#% getpages	vp	L L L
447#
448vop_getpages {
449	IN struct vnode *vp;
450	IN vm_page_t *m;
451	IN int count;
452	IN int reqpage;
453	IN vm_ooffset_t offset;
454};
455
456#
457#% putpages	vp	L L L
458#
459vop_putpages {
460	IN struct vnode *vp;
461	IN vm_page_t *m;
462	IN int count;
463	IN int sync;
464	IN int *rtvals;
465	IN vm_ooffset_t offset;
466};
467
468#
469#% freeblks	vp	- - -
470#
471# This call is used by the filesystem to release blocks back to 
472# device-driver.  This is useful if the driver has a lengthy 
473# erase handling or similar.
474#
475
476vop_freeblks {
477	IN struct vnode *vp;
478	IN daddr_t addr;
479	IN daddr_t length;
480};
481
482#
483#% getacl	vp	L L L
484#
485vop_getacl {
486	IN struct vnode *vp;
487	IN acl_type_t type;
488	OUT struct acl *aclp;
489	IN struct ucred *cred;
490	IN struct thread *td;
491};
492
493#
494#% setacl	vp	L L L
495#
496vop_setacl {
497	IN struct vnode *vp;
498	IN acl_type_t type;
499	IN struct acl *aclp;
500	IN struct ucred *cred;
501	IN struct thread *td;
502};
503
504#
505#% aclcheck	vp	= = =
506#
507vop_aclcheck {
508	IN struct vnode *vp;
509	IN acl_type_t type;
510	IN struct acl *aclp;
511	IN struct ucred *cred;
512	IN struct thread *td;
513};
514
515#
516#% closeextattr	vp	L L L
517#
518vop_closeextattr {
519	IN struct vnode *vp;
520	IN int commit;
521	IN struct ucred *cred;
522	IN struct thread *td;
523};
524
525#
526#% getextattr	vp	L L L
527#
528vop_getextattr {
529	IN struct vnode *vp;
530	IN int attrnamespace;
531	IN const char *name;
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#
541vop_openextattr {
542	IN struct vnode *vp;
543	IN struct ucred *cred;
544	IN struct thread *td;
545};
546
547#
548#% setextattr	vp	L L L
549#
550vop_setextattr {
551	IN struct vnode *vp;
552	IN int attrnamespace;
553	IN const char *name;
554	INOUT struct uio *uio;
555	IN struct ucred *cred;
556	IN struct thread *td;
557};
558
559#
560#% createvobject	vp	L L L
561#
562vop_createvobject {
563	IN struct vnode *vp;
564	IN struct ucred *cred;
565	IN struct thread *td;
566};
567
568#
569#% destroyvobject	vp	L L L
570#
571vop_destroyvobject {
572	IN struct vnode *vp;
573};
574
575#
576#% getvobject	vp	L L L
577#
578vop_getvobject {
579	IN struct vnode *vp;
580	OUT struct vm_object **objpp;
581};
582
583#
584#% refreshlabel	vp	L L L
585#
586vop_refreshlabel {
587	IN struct vnode *vp;
588	IN struct ucred *cred;
589	IN struct thread *td;
590};
591
592#
593#% setlabel	vp	L L L
594#
595vop_setlabel {
596	IN struct vnode *vp;
597	IN struct label *label;
598	IN struct ucred *cred;
599	IN struct thread *td;
600};
601