vnode_if.src revision 99486
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 99486 2002-07-06 05:23:17Z jeff $
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
57#
58#% islocked	vp	= = =
59#
60vop_islocked {
61	IN struct vnode *vp;
62	IN struct thread *td;
63};
64
65#
66#% lookup	dvp	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#
80#% cachedlookup	dvp	L ? ?
81#% cachedlookup	vpp	- L -
82#
83# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
84#
85vop_cachedlookup {
86	IN struct vnode *dvp;
87	INOUT struct vnode **vpp;
88	IN struct componentname *cnp;
89};
90
91#
92#% create	dvp	L L L
93#% create	vpp	- L -
94#
95vop_create {
96	IN struct vnode *dvp;
97	OUT struct vnode **vpp;
98	IN struct componentname *cnp;
99	IN struct vattr *vap;
100};
101
102#
103#% whiteout	dvp	L L L
104#
105vop_whiteout {
106	IN struct vnode *dvp;
107	IN struct componentname *cnp;
108	IN int flags;
109};
110
111#
112#% mknod	dvp	L L L
113#% mknod	vpp	- L -
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#
125vop_open {
126	IN struct vnode *vp;
127	IN int mode;
128	IN struct ucred *cred;
129	IN struct thread *td;
130};
131
132#
133#% close	vp	U U U
134#
135vop_close {
136	IN struct vnode *vp;
137	IN int fflag;
138	IN struct ucred *cred;
139	IN struct thread *td;
140};
141
142#
143#% access	vp	L L L
144#
145vop_access {
146	IN struct vnode *vp;
147	IN int mode;
148	IN struct ucred *cred;
149	IN struct thread *td;
150};
151
152#
153#% getattr	vp	= = =
154#
155# XXX: This should be A A A
156#
157vop_getattr {
158	IN struct vnode *vp;
159	OUT struct vattr *vap;
160	IN struct ucred *cred;
161	IN struct thread *td;
162};
163
164#
165#% setattr	vp	L L L
166#
167vop_setattr {
168	IN struct vnode *vp;
169	IN struct vattr *vap;
170	IN struct ucred *cred;
171	IN struct thread *td;
172};
173
174#
175#% read		vp	L L L
176#
177vop_read {
178	IN struct vnode *vp;
179	INOUT struct uio *uio;
180	IN int ioflag;
181	IN struct ucred *cred;
182};
183
184#
185#% write	vp	L L L
186#
187vop_write {
188	IN struct vnode *vp;
189	INOUT struct uio *uio;
190	IN int ioflag;
191	IN struct ucred *cred;
192};
193
194#
195#% lease	vp	= = =
196#
197vop_lease {
198	IN struct vnode *vp;
199	IN struct thread *td;
200	IN struct ucred *cred;
201	IN int flag;
202};
203
204#
205#% ioctl	vp	U U U
206#
207vop_ioctl {
208	IN struct vnode *vp;
209	IN u_long command;
210	IN caddr_t data;
211	IN int fflag;
212	IN struct ucred *cred;
213	IN struct thread *td;
214};
215
216#
217#% poll	vp	U U U
218#
219vop_poll {
220	IN struct vnode *vp;
221	IN int events;
222	IN struct ucred *cred;
223	IN struct thread *td;
224};
225
226#
227#% kqfilter	vp	U U U
228#
229vop_kqfilter {
230	IN struct vnode *vp;
231	IN struct knote *kn;
232};
233
234#
235#% revoke	vp	U U U
236#
237vop_revoke {
238	IN struct vnode *vp;
239	IN int flags;
240};
241
242#
243#% fsync	vp	L L L
244#
245vop_fsync {
246	IN struct vnode *vp;
247	IN struct ucred *cred;
248	IN int waitfor;
249	IN struct thread *td;
250};
251
252#
253#% remove	dvp	L L L
254#% remove	vp	L L L
255#
256vop_remove {
257	IN struct vnode *dvp;
258	IN struct vnode *vp;
259	IN struct componentname *cnp;
260};
261
262#
263#% link		tdvp	L L L
264#% link		vp	U U U
265#
266vop_link {
267	IN struct vnode *tdvp;
268	IN struct vnode *vp;
269	IN struct componentname *cnp;
270};
271
272#
273# rename	fdvp	U U U
274# rename	fvp	U U U
275# rename	tdvp	L U U
276# rename	tvp	X U U
277#! rename	pre	vop_rename_pre
278#
279vop_rename {
280	IN WILLRELE struct vnode *fdvp;
281	IN WILLRELE struct vnode *fvp;
282	IN struct componentname *fcnp;
283	IN WILLRELE struct vnode *tdvp;
284	IN WILLRELE struct vnode *tvp;
285	IN struct componentname *tcnp;
286};
287
288#
289#% mkdir	dvp	L L L
290#% mkdir	vpp	- L -
291#
292vop_mkdir {
293	IN struct vnode *dvp;
294	OUT struct vnode **vpp;
295	IN struct componentname *cnp;
296	IN struct vattr *vap;
297};
298
299#
300#% rmdir	dvp	L L L
301#% rmdir	vp	L L L
302#
303vop_rmdir {
304	IN struct vnode *dvp;
305	IN struct vnode *vp;
306	IN struct componentname *cnp;
307};
308
309#
310#% symlink	dvp	L L L
311#% symlink	vpp	- L -
312#
313vop_symlink {
314	IN struct vnode *dvp;
315	OUT struct vnode **vpp;
316	IN struct componentname *cnp;
317	IN struct vattr *vap;
318	IN char *target;
319};
320
321#
322#% readdir	vp	L L L
323#
324vop_readdir {
325	IN struct vnode *vp;
326	INOUT struct uio *uio;
327	IN struct ucred *cred;
328	INOUT int *eofflag;
329	OUT int *ncookies;
330	INOUT u_long **cookies;
331};
332
333#
334#% readlink	vp	L L L
335#
336vop_readlink {
337	IN struct vnode *vp;
338	INOUT struct uio *uio;
339	IN struct ucred *cred;
340};
341
342#
343#% inactive	vp	L U U
344#
345vop_inactive {
346	IN struct vnode *vp;
347	IN struct thread *td;
348};
349
350#
351#% reclaim	vp	U U U
352#
353vop_reclaim {
354	IN struct vnode *vp;
355	IN struct thread *td;
356};
357
358#
359#% lock		vp	? ? ?
360#
361vop_lock {
362	IN struct vnode *vp;
363	IN int flags;
364	IN struct thread *td;
365};
366
367#
368#% unlock	vp	L U L
369#
370vop_unlock {
371	IN struct vnode *vp;
372	IN int flags;
373	IN struct thread *td;
374};
375
376#
377#% bmap		vp	L L L
378#% bmap		vpp	- U -
379#
380vop_bmap {
381	IN struct vnode *vp;
382	IN daddr_t bn;
383	OUT struct vnode **vpp;
384	IN daddr_t *bnp;
385	OUT int *runp;
386	OUT int *runb;
387};
388
389#
390# strategy	vp	L L L
391#! strategy	pre	vop_strategy_pre
392#
393vop_strategy {
394	IN struct vnode *vp;
395	IN struct buf *bp;
396};
397
398#
399#% getwritemount vp	= = =
400#
401vop_getwritemount {
402	IN struct vnode *vp;
403	OUT struct mount **mpp;
404};
405
406#
407#% print	vp	= = =
408#
409vop_print {
410	IN struct vnode *vp;
411};
412
413#
414#% pathconf	vp	L L L
415#
416vop_pathconf {
417	IN struct vnode *vp;
418	IN int name;
419	OUT register_t *retval;
420};
421
422#
423#% advlock	vp	U U U
424#
425vop_advlock {
426	IN struct vnode *vp;
427	IN caddr_t id;
428	IN int op;
429	IN struct flock *fl;
430	IN int flags;
431};
432
433#
434#% reallocblks	vp	L L L
435#
436vop_reallocblks {
437	IN struct vnode *vp;
438	IN struct cluster_save *buflist;
439};
440
441#
442#% getpages	vp	L L L
443#
444vop_getpages {
445	IN struct vnode *vp;
446	IN vm_page_t *m;
447	IN int count;
448	IN int reqpage;
449	IN vm_ooffset_t offset;
450};
451
452#
453#% putpages	vp	L L L
454#
455vop_putpages {
456	IN struct vnode *vp;
457	IN vm_page_t *m;
458	IN int count;
459	IN int sync;
460	IN int *rtvals;
461	IN vm_ooffset_t offset;
462};
463
464#
465#% freeblks	vp	- - -
466#
467# This call is used by the filesystem to release blocks back to 
468# device-driver.  This is useful if the driver has a lengthy 
469# erase handling or similar.
470#
471
472vop_freeblks {
473	IN struct vnode *vp;
474	IN daddr_t addr;
475	IN daddr_t length;
476};
477
478#
479#% getacl	vp	L L L
480#
481vop_getacl {
482	IN struct vnode *vp;
483	IN acl_type_t type;
484	OUT struct acl *aclp;
485	IN struct ucred *cred;
486	IN struct thread *td;
487};
488
489#
490#% setacl	vp	L L L
491#
492vop_setacl {
493	IN struct vnode *vp;
494	IN acl_type_t type;
495	IN struct acl *aclp;
496	IN struct ucred *cred;
497	IN struct thread *td;
498};
499
500#
501#% aclcheck	vp	= = =
502#
503vop_aclcheck {
504	IN struct vnode *vp;
505	IN acl_type_t type;
506	IN struct acl *aclp;
507	IN struct ucred *cred;
508	IN struct thread *td;
509};
510
511#
512#% getextattr	vp	L L L
513#
514vop_getextattr {
515	IN struct vnode *vp;
516	IN int attrnamespace;
517	IN const char *name;
518	INOUT struct uio *uio;
519	OUT size_t *size;
520	IN struct ucred *cred;
521	IN struct thread *td;
522};
523
524#
525#% setextattr	vp	L L L
526#
527vop_setextattr {
528	IN struct vnode *vp;
529	IN int attrnamespace;
530	IN const char *name;
531	INOUT struct uio *uio;
532	IN struct ucred *cred;
533	IN struct thread *td;
534};
535
536#
537#% createvobject	vp	L L L
538#
539vop_createvobject {
540	IN struct vnode *vp;
541	IN struct ucred *cred;
542	IN struct thread *td;
543};
544
545#
546#% destroyvobject	vp	L L L
547#
548vop_destroyvobject {
549	IN struct vnode *vp;
550};
551
552#
553#% getvobject	vp	L L L
554#
555vop_getvobject {
556	IN struct vnode *vp;
557	OUT struct vm_object **objpp;
558};
559