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