xref: /original-bsd/sys/kern/vnode_if.src (revision 00695d63)
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.11 (Berkeley) 04/12/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	IN int flags;
338	IN struct proc *p;
339};
340
341#
342#% unlock	vp	L U L
343#
344vop_unlock {
345	IN struct vnode *vp;
346	IN int flags;
347	IN struct proc *p;
348};
349
350#
351#% bmap		vp	L L L
352#% bmap		vpp	- U -
353#
354vop_bmap {
355	IN struct vnode *vp;
356	IN daddr_t bn;
357	OUT struct vnode **vpp;
358	IN daddr_t *bnp;
359	OUT int *runp;
360};
361
362#
363# Needs work: no vp?
364#
365#vop_strategy {
366#	IN struct buf *bp;
367#};
368
369#
370#% print	vp	= = =
371#
372vop_print {
373	IN struct vnode *vp;
374};
375
376#
377#% islocked	vp	= = =
378#
379vop_islocked {
380	IN struct vnode *vp;
381};
382
383#
384#% pathconf	vp	L L L
385#
386vop_pathconf {
387	IN struct vnode *vp;
388	IN int name;
389	OUT register_t *retval;
390};
391
392#
393#% advlock	vp	U U U
394#
395vop_advlock {
396	IN struct vnode *vp;
397	IN caddr_t id;
398	IN int op;
399	IN struct flock *fl;
400	IN int flags;
401};
402
403#
404#% blkatoff	vp	L L L
405#
406vop_blkatoff {
407	IN struct vnode *vp;
408	IN off_t offset;
409	OUT char **res;
410	OUT struct buf **bpp;
411};
412
413#
414#% valloc	pvp	L L L
415#
416vop_valloc {
417	IN struct vnode *pvp;
418	IN int mode;
419	IN struct ucred *cred;
420	OUT struct vnode **vpp;
421};
422
423#
424#% reallocblks	vp	L L L
425#
426vop_reallocblks {
427	IN struct vnode *vp;
428	IN struct cluster_save *buflist;
429};
430
431#
432#% vfree	pvp	L L L
433#
434vop_vfree {
435	IN struct vnode *pvp;
436	IN ino_t ino;
437	IN int mode;
438};
439
440#
441#% truncate	vp	L L L
442#
443vop_truncate {
444	IN struct vnode *vp;
445	IN off_t length;
446	IN int flags;
447	IN struct ucred *cred;
448	IN struct proc *p;
449};
450
451#
452#% update	vp	L L L
453#
454vop_update {
455	IN struct vnode *vp;
456	IN struct timeval *access;
457	IN struct timeval *modify;
458	IN int waitfor;
459};
460
461#
462# Needs work: no vp?
463#
464#vop_bwrite {
465#	IN struct buf *bp;
466#};
467