xref: /freebsd/sys/kern/vnode_if.src (revision 3e0f6b97b257a96f7275e4442204263e44b16686)
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# $Id: vnode_if.src,v 1.9.2000.1 1996/09/17 14:32:01 peter Exp $
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#% lookup	dvp	L ? ?
55#% lookup	vpp	- L -
56#
57# XXX - the lookup locking protocol defies simple description and depends
58#	on the flags and operation fields in the (cnp) structure.  Note
59#	especially that *vpp may equal dvp and both may be locked.
60#
61vop_lookup {
62	IN struct vnode *dvp;
63	INOUT struct vnode **vpp;
64	IN struct componentname *cnp;
65};
66
67#
68#% create	dvp	L U U
69#% create	vpp	- L -
70#
71vop_create {
72	IN WILLRELE struct vnode *dvp;
73	OUT struct vnode **vpp;
74	IN struct componentname *cnp;
75	IN struct vattr *vap;
76};
77
78#
79#% whiteout	dvp	L L L
80#% whiteout	cnp	- - -
81#% whiteout	flag	- - -
82#
83vop_whiteout {
84	IN WILLRELE struct vnode *dvp;
85	IN struct componentname *cnp;
86	IN int flags;
87};
88
89#
90#% mknod	dvp	L U U
91#% mknod	vpp	- X -
92#
93vop_mknod {
94	IN WILLRELE struct vnode *dvp;
95	OUT WILLRELE struct vnode **vpp;
96	IN struct componentname *cnp;
97	IN struct vattr *vap;
98};
99
100#
101#% open		vp	L L L
102#
103vop_open {
104	IN struct vnode *vp;
105	IN int mode;
106	IN struct ucred *cred;
107	IN struct proc *p;
108};
109
110#
111#% close	vp	U U U
112#
113vop_close {
114	IN struct vnode *vp;
115	IN int fflag;
116	IN struct ucred *cred;
117	IN struct proc *p;
118};
119
120#
121#% access	vp	L L L
122#
123vop_access {
124	IN struct vnode *vp;
125	IN int mode;
126	IN struct ucred *cred;
127	IN struct proc *p;
128};
129
130#
131#% getattr	vp	= = =
132#
133vop_getattr {
134	IN struct vnode *vp;
135	IN struct vattr *vap;
136	IN struct ucred *cred;
137	IN struct proc *p;
138};
139
140#
141#% setattr	vp	L L L
142#
143vop_setattr {
144	IN struct vnode *vp;
145	IN struct vattr *vap;
146	IN struct ucred *cred;
147	IN struct proc *p;
148};
149
150#
151#% read		vp	L L L
152#
153vop_read {
154	IN struct vnode *vp;
155	INOUT struct uio *uio;
156	IN int ioflag;
157	IN struct ucred *cred;
158};
159
160#
161#% write	vp	L L L
162#
163vop_write {
164	IN struct vnode *vp;
165	INOUT struct uio *uio;
166	IN int ioflag;
167	IN struct ucred *cred;
168};
169
170#
171#% lease	vp	= = =
172#
173vop_lease {
174	IN struct vnode *vp;
175	IN struct proc *p;
176	IN struct ucred *cred;
177	IN int flag;
178};
179
180#
181#% ioctl	vp	U U U
182#
183vop_ioctl {
184	IN struct vnode *vp;
185	IN u_long command;
186	IN caddr_t data;
187	IN int fflag;
188	IN struct ucred *cred;
189	IN struct proc *p;
190};
191
192#
193#% select	vp	U U U
194#
195# Needs work?  (fflags)
196#
197vop_select {
198	IN struct vnode *vp;
199	IN int which;
200	IN int fflags;
201	IN struct ucred *cred;
202	IN struct proc *p;
203};
204
205#
206#% revoke	vp	U U U
207#
208vop_revoke {
209	IN struct vnode *vp;
210	IN int flags;
211};
212
213#
214# XXX - not used
215#
216vop_mmap {
217	IN struct vnode *vp;
218	IN int fflags;
219	IN struct ucred *cred;
220	IN struct proc *p;
221};
222
223#
224#% fsync	vp	L L L
225#
226vop_fsync {
227	IN struct vnode *vp;
228	IN struct ucred *cred;
229	IN int waitfor;
230	IN struct proc *p;
231};
232
233#
234# XXX - not used
235# Needs work: Is newoff right?  What's it mean?
236#
237vop_seek {
238	IN struct vnode *vp;
239	IN off_t oldoff;
240	IN off_t newoff;
241	IN struct ucred *cred;
242};
243
244#
245#% remove	dvp	L U U
246#% remove	vp	L U U
247#
248vop_remove {
249	IN WILLRELE struct vnode *dvp;
250	IN WILLRELE struct vnode *vp;
251	IN struct componentname *cnp;
252};
253
254#
255#% link		vp	U U U
256#% link		tdvp	L U U
257#
258vop_link {
259	IN WILLRELE struct vnode *tdvp;
260	IN struct vnode *vp;
261	IN struct componentname *cnp;
262};
263
264#
265#% rename	fdvp	U U U
266#% rename	fvp	U U U
267#% rename	tdvp	L U U
268#% rename	tvp	X U U
269#
270vop_rename {
271	IN WILLRELE struct vnode *fdvp;
272	IN WILLRELE struct vnode *fvp;
273	IN struct componentname *fcnp;
274	IN WILLRELE struct vnode *tdvp;
275	IN WILLRELE struct vnode *tvp;
276	IN struct componentname *tcnp;
277};
278
279#
280#% mkdir	dvp	L U U
281#% mkdir	vpp	- L -
282#
283vop_mkdir {
284	IN WILLRELE struct vnode *dvp;
285	OUT struct vnode **vpp;
286	IN struct componentname *cnp;
287	IN struct vattr *vap;
288};
289
290#
291#% rmdir	dvp	L U U
292#% rmdir	vp	L U U
293#
294vop_rmdir {
295	IN WILLRELE struct vnode *dvp;
296	IN WILLRELE struct vnode *vp;
297	IN struct componentname *cnp;
298};
299
300#
301#% symlink	dvp	L U U
302#% symlink	vpp	- U -
303#
304# XXX - note that the return vnode has already been VRELE'ed
305#	by the filesystem layer.  To use it you must use vget,
306#	possibly with a further namei.
307#
308vop_symlink {
309	IN WILLRELE struct vnode *dvp;
310	OUT WILLRELE struct vnode **vpp;
311	IN struct componentname *cnp;
312	IN struct vattr *vap;
313	IN char *target;
314};
315
316#
317#% readdir	vp	L L L
318#
319vop_readdir {
320	IN struct vnode *vp;
321	INOUT struct uio *uio;
322	IN struct ucred *cred;
323	INOUT int *eofflag;
324	OUT int *ncookies;
325	INOUT u_long **cookies;
326};
327
328#
329#% readlink	vp	L L L
330#
331vop_readlink {
332	IN struct vnode *vp;
333	INOUT struct uio *uio;
334	IN struct ucred *cred;
335};
336
337#
338#% abortop	dvp	= = =
339#
340vop_abortop {
341	IN struct vnode *dvp;
342	IN struct componentname *cnp;
343};
344
345#
346#% inactive	vp	L U U
347#
348vop_inactive {
349	IN struct vnode *vp;
350	IN struct proc *p;
351};
352
353#
354#% reclaim	vp	U U U
355#
356vop_reclaim {
357	IN struct vnode *vp;
358	IN struct proc *p;
359};
360
361#
362#% lock		vp	U L U
363#
364vop_lock {
365	IN struct vnode *vp;
366	IN int flags;
367	IN struct proc *p;
368};
369
370#
371#% unlock	vp	L U L
372#
373vop_unlock {
374	IN struct vnode *vp;
375	IN int flags;
376	IN struct proc *p;
377};
378
379#
380#% bmap		vp	L L L
381#% bmap		vpp	- U -
382#
383vop_bmap {
384	IN struct vnode *vp;
385	IN daddr_t bn;
386	OUT struct vnode **vpp;
387	IN daddr_t *bnp;
388	OUT int *runp;
389	OUT int *runb;
390};
391
392#
393# Needs work: no vp?
394#
395#vop_strategy {
396#	IN struct buf *bp;
397#};
398
399#
400#% print	vp	= = =
401#
402vop_print {
403	IN struct vnode *vp;
404};
405
406#
407#% islocked	vp	= = =
408#
409vop_islocked {
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#% blkatoff	vp	L L L
435#
436vop_blkatoff {
437	IN struct vnode *vp;
438	IN off_t offset;
439	OUT char **res;
440	OUT struct buf **bpp;
441};
442
443#
444#% valloc	pvp	L L L
445#
446vop_valloc {
447	IN struct vnode *pvp;
448	IN int mode;
449	IN struct ucred *cred;
450	OUT struct vnode **vpp;
451};
452
453#
454#% reallocblks	vp	L L L
455#
456vop_reallocblks {
457	IN struct vnode *vp;
458	IN struct cluster_save *buflist;
459};
460
461#
462#% vfree	pvp	L L L
463#
464vop_vfree {
465	IN struct vnode *pvp;
466	IN ino_t ino;
467	IN int mode;
468};
469
470#
471#% truncate	vp	L L L
472#
473vop_truncate {
474	IN struct vnode *vp;
475	IN off_t length;
476	IN int flags;
477	IN struct ucred *cred;
478	IN struct proc *p;
479};
480
481#
482#% update	vp	L L L
483#
484vop_update {
485	IN struct vnode *vp;
486	IN struct timeval *access;
487	IN struct timeval *modify;
488	IN int waitfor;
489};
490
491vop_getpages {
492	IN struct vnode *vp;
493	IN vm_page_t *m;
494	IN int count;
495	IN int reqpage;
496	IN vm_ooffset_t offset;
497};
498
499vop_putpages {
500	IN struct vnode *vp;
501	IN vm_page_t *m;
502	IN int count;
503	IN int sync;
504	IN int *rtvals;
505	IN vm_ooffset_t offset;
506};
507
508#
509# Needs work: no vp?
510#
511#vop_bwrite {
512#	IN struct buf *bp;
513#};
514