xref: /netbsd-src/sys/kern/vnode_if.src (revision dc306354b0b29af51801a7632f1e95265a68cd81)
1#	$NetBSD: vnode_if.src,v 1.14 1998/06/05 19:38:56 kleink Exp $
2#
3# Copyright (c) 1992, 1993
4#	The Regents of the University of California.  All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14# 3. All advertising materials mentioning features or use of this software
15#    must display the following acknowledgement:
16#	This product includes software developed by the University of
17#	California, Berkeley and its contributors.
18# 4. Neither the name of the University nor the names of its contributors
19#    may be used to endorse or promote products derived from this software
20#    without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32# SUCH DAMAGE.
33#
34#	@(#)vnode_if.src	8.14 (Berkeley) 8/6/95
35#
36#
37
38#
39# Above each of the vop descriptors is a specification of the locking
40# protocol used by each vop call.  The first column is the name of
41# the variable, the remaining three columns are in, out and error
42# respectively.  The "in" column defines the lock state on input,
43# the "out" column defines the state on succesful return, and the
44# "error" column defines the locking state on error exit.
45#
46# The locking value can take the following values:
47# L: locked.
48# U: unlocked/
49# -: not applicable.  vnode does not yet (or no longer) exists.
50# =: the same on input and output, may be either L or U.
51# X: locked if not nil.
52#
53
54#
55#% lookup     dvp     L ? ?
56#% lookup     vpp     - L -
57#
58# XXX - the lookup locking protocol defies simple description and depends
59#     on the flags and operation fields in the (cnp) structure.  Note
60#     especially that *vpp may equal dvp and both may be locked.
61#
62vop_lookup {
63	IN struct vnode *dvp;
64	INOUT struct vnode **vpp;
65	IN struct componentname *cnp;
66};
67
68#
69#% create     dvp     L U U
70#% create     vpp     - L -
71#
72vop_create {
73	IN WILLRELE struct vnode *dvp;
74	OUT struct vnode **vpp;
75	IN struct componentname *cnp;
76	IN struct vattr *vap;
77};
78
79#
80#% mknod      dvp     L U U
81#% mknod      vpp     - X -
82#
83vop_mknod {
84	IN WILLRELE struct vnode *dvp;
85	OUT WILLRELE struct vnode **vpp;
86	IN struct componentname *cnp;
87	IN struct vattr *vap;
88};
89
90#
91#% open               vp      L L L
92#
93vop_open {
94	IN struct vnode *vp;
95	IN int mode;
96	IN struct ucred *cred;
97	IN struct proc *p;
98};
99
100#
101#% close      vp      U U U
102#
103vop_close {
104	IN struct vnode *vp;
105	IN int fflag;
106	IN struct ucred *cred;
107	IN struct proc *p;
108};
109
110#
111#% access     vp      L L L
112#
113vop_access {
114	IN struct vnode *vp;
115	IN int mode;
116	IN struct ucred *cred;
117	IN struct proc *p;
118};
119
120#
121#% getattr    vp      = = =
122#
123vop_getattr {
124	IN struct vnode *vp;
125	IN struct vattr *vap;
126	IN struct ucred *cred;
127	IN struct proc *p;
128};
129
130#
131#% setattr    vp      L L L
132#
133vop_setattr {
134	IN struct vnode *vp;
135	IN struct vattr *vap;
136	IN struct ucred *cred;
137	IN struct proc *p;
138};
139
140#
141#% read               vp      L L L
142#
143vop_read {
144	IN struct vnode *vp;
145	INOUT struct uio *uio;
146	IN int ioflag;
147	IN struct ucred *cred;
148};
149
150#
151#% write      vp      L L L
152#
153vop_write {
154	IN struct vnode *vp;
155	INOUT struct uio *uio;
156	IN int ioflag;
157	IN struct ucred *cred;
158};
159
160#
161#% ioctl      vp      U U U
162#
163vop_ioctl {
164	IN struct vnode *vp;
165	IN u_long command;
166	IN caddr_t data;
167	IN int fflag;
168	IN struct ucred *cred;
169	IN struct proc *p;
170};
171
172#
173#% poll     vp      U U U
174#
175vop_poll {
176	IN struct vnode *vp;
177	IN int events;
178	IN struct proc *p;
179};
180
181#
182#% revoke     vp      U U U
183#
184vop_revoke {
185	IN struct vnode *vp;
186	IN int flags;
187};
188
189#
190# XXX - not used
191#
192vop_mmap {
193	IN struct vnode *vp;
194	IN int fflags;
195	IN struct ucred *cred;
196	IN struct proc *p;
197};
198
199#
200#% fsync      vp      L L L
201#
202vop_fsync {
203	IN struct vnode *vp;
204	IN struct ucred *cred;
205	IN int flags;
206	IN struct proc *p;
207};
208
209#
210# Needs work: Is newoff right?  What's it mean?
211#
212vop_seek {
213	IN struct vnode *vp;
214	IN off_t oldoff;
215	IN off_t newoff;
216	IN struct ucred *cred;
217};
218
219#
220#% remove     dvp     L U U
221#% remove     vp      L U U
222#
223vop_remove {
224	IN WILLRELE struct vnode *dvp;
225	IN WILLRELE struct vnode *vp;
226	IN struct componentname *cnp;
227};
228
229#
230#% link               vp      U U U
231#% link               tdvp    L U U
232#
233vop_link {
234	IN WILLRELE struct vnode *dvp;
235	IN struct vnode *vp;
236	IN struct componentname *cnp;
237};
238
239#
240#% rename     fdvp    U U U
241#% rename     fvp     U U U
242#% rename     tdvp    L U U
243#% rename     tvp     X U U
244#
245vop_rename {
246	IN WILLRELE struct vnode *fdvp;
247	IN WILLRELE struct vnode *fvp;
248	IN struct componentname *fcnp;
249	IN WILLRELE struct vnode *tdvp;
250	IN WILLRELE struct vnode *tvp;
251	IN struct componentname *tcnp;
252};
253
254#
255#% mkdir      dvp     L U U
256#% mkdir      vpp     - L -
257#
258vop_mkdir {
259	IN WILLRELE struct vnode *dvp;
260	OUT struct vnode **vpp;
261	IN struct componentname *cnp;
262	IN struct vattr *vap;
263};
264
265#
266#% rmdir      dvp     L U U
267#% rmdir      vp      L U U
268#
269vop_rmdir {
270	IN WILLRELE struct vnode *dvp;
271	IN WILLRELE struct vnode *vp;
272	IN struct componentname *cnp;
273};
274
275#
276#% symlink    dvp     L U U
277#% symlink    vpp     - U -
278#
279# XXX - note that the return vnode has already been VRELE'ed
280#     by the filesystem layer.  To use it you must use vget,
281#     possibly with a further namei.
282#
283vop_symlink {
284	IN WILLRELE struct vnode *dvp;
285	OUT WILLRELE struct vnode **vpp;
286	IN struct componentname *cnp;
287	IN struct vattr *vap;
288	IN char *target;
289};
290
291#
292#% readdir    vp      L L L
293#
294vop_readdir {
295	IN struct vnode *vp;
296	INOUT struct uio *uio;
297	IN struct ucred *cred;
298	OUT int *eofflag;
299	OUT off_t **cookies;
300	IN int *ncookies;
301};
302
303#
304#% readlink   vp      L L L
305#
306vop_readlink {
307	IN struct vnode *vp;
308	INOUT struct uio *uio;
309	IN struct ucred *cred;
310};
311
312#
313#% abortop    dvp     = = =
314#
315vop_abortop {
316	IN struct vnode *dvp;
317	IN struct componentname *cnp;
318};
319
320#
321#% inactive   vp      L U U
322#
323vop_inactive {
324	IN struct vnode *vp;
325	IN struct proc *p;
326};
327
328#
329#% reclaim    vp      U U U
330#
331vop_reclaim {
332	IN struct vnode *vp;
333	IN struct proc *p;
334};
335
336#
337#% lock               vp      U L U
338#
339vop_lock {
340	IN struct vnode *vp;
341	IN int flags;
342};
343
344#
345#% unlock     vp      L U L
346#
347vop_unlock {
348	IN struct vnode *vp;
349	IN int flags;
350};
351
352#
353#% bmap               vp      L L L
354#% bmap               vpp     - U -
355#
356vop_bmap {
357	IN struct vnode *vp;
358	IN daddr_t bn;
359	OUT struct vnode **vpp;
360	IN daddr_t *bnp;
361	OUT int *runp;
362};
363
364#
365# Needs work: no vp?
366#
367#vop_strategy {
368#	IN struct buf *bp;
369#};
370
371#
372#% print      vp      = = =
373#
374vop_print {
375	IN struct vnode *vp;
376};
377
378#
379#% islocked   vp      = = =
380#
381vop_islocked {
382	IN struct vnode *vp;
383};
384
385#
386#% pathconf   vp      L L L
387#
388vop_pathconf {
389	IN struct vnode *vp;
390	IN int name;
391	OUT register_t *retval;
392};
393
394#
395#% advlock    vp      U U U
396#
397vop_advlock {
398	IN struct vnode *vp;
399	IN caddr_t id;
400	IN int op;
401	IN struct flock *fl;
402	IN int flags;
403};
404
405#
406#% blkatoff   vp      L L L
407#
408vop_blkatoff {
409	IN struct vnode *vp;
410	IN off_t offset;
411	OUT char **res;
412	OUT struct buf **bpp;
413};
414
415#
416#% valloc     pvp     L L L
417#
418vop_valloc {
419	IN struct vnode *pvp;
420	IN int mode;
421	IN struct ucred *cred;
422	OUT struct vnode **vpp;
423};
424
425#
426#% reallocblks        vp      L L L
427#
428vop_reallocblks {
429	IN struct vnode *vp;
430	IN struct cluster_save *buflist;
431};
432
433#
434#% vfree      pvp     L L L
435#
436vop_vfree {
437	IN struct vnode *pvp;
438	IN ino_t ino;
439	IN int mode;
440};
441
442#
443#% truncate   vp      L L L
444#
445vop_truncate {
446	IN struct vnode *vp;
447	IN off_t length;
448	IN int flags;
449	IN struct ucred *cred;
450	IN struct proc *p;
451};
452
453#
454#% update     vp      L L L
455#
456vop_update {
457	IN struct vnode *vp;
458	IN struct timespec *access;
459	IN struct timespec *modify;
460	IN int waitfor;
461};
462
463#
464#% lease      vp      = = =
465#
466vop_lease {
467	IN struct vnode *vp;
468	IN struct proc *p;
469	IN struct ucred *cred;
470	IN int flag;
471};
472
473#
474#% whiteout   dvp     L L L
475#% whiteout   cnp     - - -
476#% whiteout   flag    - - -
477#
478vop_whiteout {
479	IN struct vnode *dvp;
480	IN struct componentname *cnp;
481	IN int flags;
482};
483
484#
485# Needs work: no vp?
486#
487#vop_bwrite {
488#	IN struct buf *bp;
489#};
490