vnode_if.src revision 90488
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 90488 2002-02-10 21:46:16Z rwatson $
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 L L L
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#
278vop_rename {
279	IN WILLRELE struct vnode *fdvp;
280	IN WILLRELE struct vnode *fvp;
281	IN struct componentname *fcnp;
282	IN WILLRELE struct vnode *tdvp;
283	IN WILLRELE struct vnode *tvp;
284	IN struct componentname *tcnp;
285};
286
287#
288#% mkdir	dvp	L L L
289#% mkdir	vpp	- L -
290#
291vop_mkdir {
292	IN struct vnode *dvp;
293	OUT struct vnode **vpp;
294	IN struct componentname *cnp;
295	IN struct vattr *vap;
296};
297
298#
299#% rmdir	dvp	L L L
300#% rmdir	vp	L L L
301#
302vop_rmdir {
303	IN struct vnode *dvp;
304	IN struct vnode *vp;
305	IN struct componentname *cnp;
306};
307
308#
309#% symlink	dvp	L L L
310#% symlink	vpp	- L -
311#
312vop_symlink {
313	IN struct vnode *dvp;
314	OUT struct vnode **vpp;
315	IN struct componentname *cnp;
316	IN struct vattr *vap;
317	IN char *target;
318};
319
320#
321#% readdir	vp	L L L
322#
323vop_readdir {
324	IN struct vnode *vp;
325	INOUT struct uio *uio;
326	IN struct ucred *cred;
327	INOUT int *eofflag;
328	OUT int *ncookies;
329	INOUT u_long **cookies;
330};
331
332#
333#% readlink	vp	L L L
334#
335vop_readlink {
336	IN struct vnode *vp;
337	INOUT struct uio *uio;
338	IN struct ucred *cred;
339};
340
341#
342#% inactive	vp	L U U
343#
344vop_inactive {
345	IN struct vnode *vp;
346	IN struct thread *td;
347};
348
349#
350#% reclaim	vp	U U U
351#
352vop_reclaim {
353	IN struct vnode *vp;
354	IN struct thread *td;
355};
356
357#
358#% lock		vp	? ? ?
359#
360vop_lock {
361	IN struct vnode *vp;
362	IN int flags;
363	IN struct thread *td;
364};
365
366#
367#% unlock	vp	L U L
368#
369vop_unlock {
370	IN struct vnode *vp;
371	IN int flags;
372	IN struct thread *td;
373};
374
375#
376#% bmap		vp	L L L
377#% bmap		vpp	- U -
378#
379vop_bmap {
380	IN struct vnode *vp;
381	IN daddr_t bn;
382	OUT struct vnode **vpp;
383	IN daddr_t *bnp;
384	OUT int *runp;
385	OUT int *runb;
386};
387
388#
389#% strategy	vp	L L L
390#
391vop_strategy {
392	IN struct vnode *vp;
393	IN struct buf *bp;
394};
395
396#
397#% getwritemount vp	= = =
398#
399vop_getwritemount {
400	IN struct vnode *vp;
401	OUT struct mount **mpp;
402};
403
404#
405#% print	vp	= = =
406#
407vop_print {
408	IN struct vnode *vp;
409};
410
411#
412#% pathconf	vp	L L L
413#
414vop_pathconf {
415	IN struct vnode *vp;
416	IN int name;
417	OUT register_t *retval;
418};
419
420#
421#% advlock	vp	U U U
422#
423vop_advlock {
424	IN struct vnode *vp;
425	IN caddr_t id;
426	IN int op;
427	IN struct flock *fl;
428	IN int flags;
429};
430
431#
432#% reallocblks	vp	L L L
433#
434vop_reallocblks {
435	IN struct vnode *vp;
436	IN struct cluster_save *buflist;
437};
438
439#
440#% getpages	vp	L L L
441#
442vop_getpages {
443	IN struct vnode *vp;
444	IN vm_page_t *m;
445	IN int count;
446	IN int reqpage;
447	IN vm_ooffset_t offset;
448};
449
450#
451#% putpages	vp	L L L
452#
453vop_putpages {
454	IN struct vnode *vp;
455	IN vm_page_t *m;
456	IN int count;
457	IN int sync;
458	IN int *rtvals;
459	IN vm_ooffset_t offset;
460};
461
462#
463#% freeblks	vp	- - -
464#
465# This call is used by the filesystem to release blocks back to 
466# device-driver.  This is useful if the driver has a lengthy 
467# erase handling or similar.
468#
469
470vop_freeblks {
471	IN struct vnode *vp;
472	IN daddr_t addr;
473	IN daddr_t length;
474};
475
476#
477#% getacl	vp	L L L
478#
479vop_getacl {
480	IN struct vnode *vp;
481	IN acl_type_t type;
482	OUT struct acl *aclp;
483	IN struct ucred *cred;
484	IN struct thread *td;
485};
486
487#
488#% setacl	vp	L L L
489#
490vop_setacl {
491	IN struct vnode *vp;
492	IN acl_type_t type;
493	IN struct acl *aclp;
494	IN struct ucred *cred;
495	IN struct thread *td;
496};
497
498#
499#% aclcheck	vp	= = =
500#
501vop_aclcheck {
502	IN struct vnode *vp;
503	IN acl_type_t type;
504	IN struct acl *aclp;
505	IN struct ucred *cred;
506	IN struct thread *td;
507};
508
509#
510#% getextattr	vp	L L L
511#
512vop_getextattr {
513	IN struct vnode *vp;
514	IN int attrnamespace;
515	IN const char *name;
516	INOUT struct uio *uio;
517	OUT size_t *size;
518	IN struct ucred *cred;
519	IN struct thread *td;
520};
521
522#
523#% setextattr	vp	L L L
524#
525vop_setextattr {
526	IN struct vnode *vp;
527	IN int attrnamespace;
528	IN const char *name;
529	INOUT struct uio *uio;
530	IN struct ucred *cred;
531	IN struct thread *td;
532};
533
534#
535#% createvobject	vp	L L L
536#
537vop_createvobject {
538	IN struct vnode *vp;
539	IN struct ucred *cred;
540	IN struct thread *td;
541};
542
543#
544#% destroyvobject	vp	L L L
545#
546vop_destroyvobject {
547	IN struct vnode *vp;
548};
549
550#
551#% getvobject	vp	L L L
552#
553vop_getvobject {
554	IN struct vnode *vp;
555	OUT struct vm_object **objpp;
556};
557