vnode_if.src revision 99484
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 99484 2002-07-06 04:41:27Z 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#
392vop_strategy {
393	IN struct vnode *vp;
394	IN struct buf *bp;
395};
396
397#
398#% getwritemount vp	= = =
399#
400vop_getwritemount {
401	IN struct vnode *vp;
402	OUT struct mount **mpp;
403};
404
405#
406#% print	vp	= = =
407#
408vop_print {
409	IN struct vnode *vp;
410};
411
412#
413#% pathconf	vp	L L L
414#
415vop_pathconf {
416	IN struct vnode *vp;
417	IN int name;
418	OUT register_t *retval;
419};
420
421#
422#% advlock	vp	U U U
423#
424vop_advlock {
425	IN struct vnode *vp;
426	IN caddr_t id;
427	IN int op;
428	IN struct flock *fl;
429	IN int flags;
430};
431
432#
433#% reallocblks	vp	L L L
434#
435vop_reallocblks {
436	IN struct vnode *vp;
437	IN struct cluster_save *buflist;
438};
439
440#
441#% getpages	vp	L L L
442#
443vop_getpages {
444	IN struct vnode *vp;
445	IN vm_page_t *m;
446	IN int count;
447	IN int reqpage;
448	IN vm_ooffset_t offset;
449};
450
451#
452#% putpages	vp	L L L
453#
454vop_putpages {
455	IN struct vnode *vp;
456	IN vm_page_t *m;
457	IN int count;
458	IN int sync;
459	IN int *rtvals;
460	IN vm_ooffset_t offset;
461};
462
463#
464#% freeblks	vp	- - -
465#
466# This call is used by the filesystem to release blocks back to 
467# device-driver.  This is useful if the driver has a lengthy 
468# erase handling or similar.
469#
470
471vop_freeblks {
472	IN struct vnode *vp;
473	IN daddr_t addr;
474	IN daddr_t length;
475};
476
477#
478#% getacl	vp	L L L
479#
480vop_getacl {
481	IN struct vnode *vp;
482	IN acl_type_t type;
483	OUT struct acl *aclp;
484	IN struct ucred *cred;
485	IN struct thread *td;
486};
487
488#
489#% setacl	vp	L L L
490#
491vop_setacl {
492	IN struct vnode *vp;
493	IN acl_type_t type;
494	IN struct acl *aclp;
495	IN struct ucred *cred;
496	IN struct thread *td;
497};
498
499#
500#% aclcheck	vp	= = =
501#
502vop_aclcheck {
503	IN struct vnode *vp;
504	IN acl_type_t type;
505	IN struct acl *aclp;
506	IN struct ucred *cred;
507	IN struct thread *td;
508};
509
510#
511#% getextattr	vp	L L L
512#
513vop_getextattr {
514	IN struct vnode *vp;
515	IN int attrnamespace;
516	IN const char *name;
517	INOUT struct uio *uio;
518	OUT size_t *size;
519	IN struct ucred *cred;
520	IN struct thread *td;
521};
522
523#
524#% setextattr	vp	L L L
525#
526vop_setextattr {
527	IN struct vnode *vp;
528	IN int attrnamespace;
529	IN const char *name;
530	INOUT struct uio *uio;
531	IN struct ucred *cred;
532	IN struct thread *td;
533};
534
535#
536#% createvobject	vp	L L L
537#
538vop_createvobject {
539	IN struct vnode *vp;
540	IN struct ucred *cred;
541	IN struct thread *td;
542};
543
544#
545#% destroyvobject	vp	L L L
546#
547vop_destroyvobject {
548	IN struct vnode *vp;
549};
550
551#
552#% getvobject	vp	L L L
553#
554vop_getvobject {
555	IN struct vnode *vp;
556	OUT struct vm_object **objpp;
557};
558