vnode_if.src revision 53131
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 53131 1999-11-13 20:58:17Z eivind $
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.
47# U: unlocked.
48# -: not applicable.  vnode does not yet (or no longer) exists.
49# =: the same on input and output, may be either L or U.
50# X: locked if not nil.
51#
52
53#
54#% islocked	vp	= = =
55#
56vop_islocked {
57	IN struct vnode *vp;
58};
59
60#
61#% lookup	dvp	L ? ?
62#% lookup	vpp	- L -
63#
64# XXX - the lookup locking protocol defies simple description and depends
65#	on the flags and operation fields in the (cnp) structure.  Note
66#	especially that *vpp may equal dvp and both may be locked.
67#
68vop_lookup {
69	IN struct vnode *dvp;
70	INOUT struct vnode **vpp;
71	IN struct componentname *cnp;
72};
73
74#
75#% cachedlookup	dvp	L ? ?
76#% cachedlookup	vpp	- L -
77#
78# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
79#
80vop_cachedlookup {
81	IN struct vnode *dvp;
82	INOUT struct vnode **vpp;
83	IN struct componentname *cnp;
84};
85
86#
87#% create	dvp	L L L
88#% create	vpp	- L -
89#
90vop_create {
91	IN struct vnode *dvp;
92	OUT struct vnode **vpp;
93	IN struct componentname *cnp;
94	IN struct vattr *vap;
95};
96
97#
98#% whiteout	dvp	L L L
99#
100vop_whiteout {
101	IN struct vnode *dvp;
102	IN struct componentname *cnp;
103	IN int flags;
104};
105
106#
107#% mknod	dvp	L L L
108#% mknod	vpp	- X -
109#
110vop_mknod {
111	IN struct vnode *dvp;
112	OUT struct vnode **vpp;
113	IN struct componentname *cnp;
114	IN struct vattr *vap;
115};
116
117#
118#% open		vp	L L L
119#
120vop_open {
121	IN struct vnode *vp;
122	IN int mode;
123	IN struct ucred *cred;
124	IN struct proc *p;
125};
126
127#
128#% close	vp	U U U
129#
130vop_close {
131	IN struct vnode *vp;
132	IN int fflag;
133	IN struct ucred *cred;
134	IN struct proc *p;
135};
136
137#
138#% access	vp	L L L
139#
140vop_access {
141	IN struct vnode *vp;
142	IN int mode;
143	IN struct ucred *cred;
144	IN struct proc *p;
145};
146
147#
148#% getattr	vp	= = =
149#
150vop_getattr {
151	IN struct vnode *vp;
152	IN struct vattr *vap;
153	IN struct ucred *cred;
154	IN struct proc *p;
155};
156
157#
158#% setattr	vp	L L L
159#
160vop_setattr {
161	IN struct vnode *vp;
162	IN struct vattr *vap;
163	IN struct ucred *cred;
164	IN struct proc *p;
165};
166
167#
168#% read		vp	L L L
169#
170vop_read {
171	IN struct vnode *vp;
172	INOUT struct uio *uio;
173	IN int ioflag;
174	IN struct ucred *cred;
175};
176
177#
178#% write	vp	L L L
179#
180vop_write {
181	IN struct vnode *vp;
182	INOUT struct uio *uio;
183	IN int ioflag;
184	IN struct ucred *cred;
185};
186
187#
188#% lease	vp	= = =
189#
190vop_lease {
191	IN struct vnode *vp;
192	IN struct proc *p;
193	IN struct ucred *cred;
194	IN int flag;
195};
196
197#
198#% ioctl	vp	U U U
199#
200vop_ioctl {
201	IN struct vnode *vp;
202	IN u_long command;
203	IN caddr_t data;
204	IN int fflag;
205	IN struct ucred *cred;
206	IN struct proc *p;
207};
208
209#
210#% poll	vp	U U U
211#
212vop_poll {
213	IN struct vnode *vp;
214	IN int events;
215	IN struct ucred *cred;
216	IN struct proc *p;
217};
218
219#
220#% revoke	vp	U U U
221#
222vop_revoke {
223	IN struct vnode *vp;
224	IN int flags;
225};
226
227#
228# XXX - not used
229#
230vop_mmap {
231	IN struct vnode *vp;
232	IN int fflags;
233	IN struct ucred *cred;
234	IN struct proc *p;
235};
236
237#
238#% fsync	vp	L L L
239#
240vop_fsync {
241	IN struct vnode *vp;
242	IN struct ucred *cred;
243	IN int waitfor;
244	IN struct proc *p;
245};
246
247#
248#% remove	dvp	L L L
249#% remove	vp	L L L
250#
251vop_remove {
252	IN struct vnode *dvp;
253	IN struct vnode *vp;
254	IN struct componentname *cnp;
255};
256
257#
258#% link		tdvp	L L L
259#% link		vp	U U U
260#
261vop_link {
262	IN struct vnode *tdvp;
263	IN struct vnode *vp;
264	IN struct componentname *cnp;
265};
266
267#
268#% rename	fdvp	U U U
269#% rename	fvp	U U U
270#% rename	tdvp	L U U
271#% rename	tvp	X U U
272#
273vop_rename {
274	IN WILLRELE struct vnode *fdvp;
275	IN WILLRELE struct vnode *fvp;
276	IN struct componentname *fcnp;
277	IN WILLRELE struct vnode *tdvp;
278	IN WILLRELE struct vnode *tvp;
279	IN struct componentname *tcnp;
280};
281
282#
283#% mkdir	dvp	L L L
284#% mkdir	vpp	- L -
285#
286vop_mkdir {
287	IN struct vnode *dvp;
288	OUT struct vnode **vpp;
289	IN struct componentname *cnp;
290	IN struct vattr *vap;
291};
292
293#
294#% rmdir	dvp	L L L
295#% rmdir	vp	L L L
296#
297vop_rmdir {
298	IN struct vnode *dvp;
299	IN struct vnode *vp;
300	IN struct componentname *cnp;
301};
302
303#
304#% symlink	dvp	L L L
305#% symlink	vpp	- U -
306#
307vop_symlink {
308	IN struct vnode *dvp;
309	OUT struct vnode **vpp;
310	IN struct componentname *cnp;
311	IN struct vattr *vap;
312	IN char *target;
313};
314
315#
316#% readdir	vp	L L L
317#
318vop_readdir {
319	IN struct vnode *vp;
320	INOUT struct uio *uio;
321	IN struct ucred *cred;
322	INOUT int *eofflag;
323	OUT int *ncookies;
324	INOUT u_long **cookies;
325};
326
327#
328#% readlink	vp	L L L
329#
330vop_readlink {
331	IN struct vnode *vp;
332	INOUT struct uio *uio;
333	IN struct ucred *cred;
334};
335
336#
337#% abortop	dvp	= = =
338#
339vop_abortop {
340	IN struct vnode *dvp;
341	IN struct componentname *cnp;
342};
343
344#
345#% inactive	vp	L U U
346#
347vop_inactive {
348	IN struct vnode *vp;
349	IN struct proc *p;
350};
351
352#
353#% reclaim	vp	U U U
354#
355vop_reclaim {
356	IN struct vnode *vp;
357	IN struct proc *p;
358};
359
360#
361#% lock		vp	U L U
362#
363vop_lock {
364	IN struct vnode *vp;
365	IN int flags;
366	IN struct proc *p;
367};
368
369#
370#% unlock	vp	L U L
371#
372vop_unlock {
373	IN struct vnode *vp;
374	IN int flags;
375	IN struct proc *p;
376};
377
378#
379#% bmap		vp	L L L
380#% bmap		vpp	- U -
381#
382vop_bmap {
383	IN struct vnode *vp;
384	IN daddr_t bn;
385	OUT struct vnode **vpp;
386	IN daddr_t *bnp;
387	OUT int *runp;
388	OUT int *runb;
389};
390
391#
392#% strategy	vp	L L L
393#
394vop_strategy {
395	IN struct vnode *vp;
396	IN struct buf *bp;
397};
398
399#
400#% print	vp	= = =
401#
402vop_print {
403	IN struct vnode *vp;
404};
405
406#
407#% pathconf	vp	L L L
408#
409vop_pathconf {
410	IN struct vnode *vp;
411	IN int name;
412	OUT register_t *retval;
413};
414
415#
416#% advlock	vp	U U U
417#
418vop_advlock {
419	IN struct vnode *vp;
420	IN caddr_t id;
421	IN int op;
422	IN struct flock *fl;
423	IN int flags;
424};
425
426#
427#% balloc	vp	L L L
428#
429vop_balloc {
430	IN struct vnode *vp;
431	IN off_t startoffset;
432	IN int size;
433	IN struct ucred *cred;
434	IN int flags;
435	OUT struct buf **bpp;
436};
437
438#
439#% reallocblks	vp	L L L
440#
441vop_reallocblks {
442	IN struct vnode *vp;
443	IN struct cluster_save *buflist;
444};
445
446#
447#% getpages	vp	L L L
448#
449vop_getpages {
450	IN struct vnode *vp;
451	IN vm_page_t *m;
452	IN int count;
453	IN int reqpage;
454	IN vm_ooffset_t offset;
455};
456
457#
458#% putpages	vp	L L L
459#
460vop_putpages {
461	IN struct vnode *vp;
462	IN vm_page_t *m;
463	IN int count;
464	IN int sync;
465	IN int *rtvals;
466	IN vm_ooffset_t offset;
467};
468
469#
470#% freeblks	vp	- - -
471#
472# This call is used by the filesystem to release blocks back to 
473# device-driver.  This is useful if the driver has a lengthy 
474# erase handling or similar.
475#
476
477vop_freeblks {
478	IN struct vnode *vp;
479	IN daddr_t addr;
480	IN daddr_t length;
481};
482
483#
484#% bwrite	vp	L L L
485#
486vop_bwrite {
487	IN struct vnode *vp;
488	IN struct buf *bp;
489};
490