xref: /original-bsd/sys/kern/vnode_if.src (revision 4ba124f7)
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.6 (Berkeley) 07/12/94
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	- - -
55vop_whiteout {
56	IN WILLRELE struct vnode *dvp;
57	IN struct componentname *cnp;
58	IN int flags;
59};
60
61#
62#% mknod	dvp	L U U
63#% mknod	vpp	- X -
64#
65vop_mknod {
66	IN WILLRELE struct vnode *dvp;
67	OUT WILLRELE struct vnode **vpp;
68	IN struct componentname *cnp;
69	IN struct vattr *vap;
70};
71
72#
73#% open 	vp	L L L
74#
75vop_open {
76	IN struct vnode *vp;
77	IN int mode;
78	IN struct ucred *cred;
79	IN struct proc *p;
80};
81
82#
83#% close	vp	U U U
84#
85vop_close {
86	IN struct vnode *vp;
87	IN int fflag;
88	IN struct ucred *cred;
89	IN struct proc *p;
90};
91
92#
93#% access	vp	L L L
94#
95vop_access {
96	IN struct vnode *vp;
97	IN int mode;
98	IN struct ucred *cred;
99	IN struct proc *p;
100};
101
102#
103#% getattr	vp	= = =
104#
105vop_getattr {
106	IN struct vnode *vp;
107	IN struct vattr *vap;
108	IN struct ucred *cred;
109	IN struct proc *p;
110};
111
112#
113#% setattr	vp	L L L
114#
115vop_setattr {
116	IN struct vnode *vp;
117	IN struct vattr *vap;
118	IN struct ucred *cred;
119	IN struct proc *p;
120};
121
122#
123#% read 	vp	L L L
124#
125vop_read {
126	IN struct vnode *vp;
127	INOUT struct uio *uio;
128	IN int ioflag;
129	IN struct ucred *cred;
130};
131
132#
133#% write	vp	L L L
134#
135vop_write {
136	IN struct vnode *vp;
137	INOUT struct uio *uio;
138	IN int ioflag;
139	IN struct ucred *cred;
140};
141
142#
143#% ioctl	vp	U U U
144#
145vop_ioctl {
146	IN struct vnode *vp;
147	IN int command;
148	IN caddr_t data;
149	IN int fflag;
150	IN struct ucred *cred;
151	IN struct proc *p;
152};
153
154#
155#% select	vp	U U U
156#
157# Needs work?  (fflags)
158vop_select {
159	IN struct vnode *vp;
160	IN int which;
161	IN int fflags;
162	IN struct ucred *cred;
163	IN struct proc *p;
164};
165
166# XXX - not used
167vop_mmap {
168	IN struct vnode *vp;
169	IN int fflags;
170	IN struct ucred *cred;
171	IN struct proc *p;
172};
173
174#
175#% fsync	vp	L L L
176#
177vop_fsync {
178	IN struct vnode *vp;
179	IN struct ucred *cred;
180	IN int waitfor;
181	IN struct proc *p;
182};
183
184# XXX - not used
185# Needs word: Is newoff right?  What's it mean?
186vop_seek {
187	IN struct vnode *vp;
188	IN off_t oldoff;
189	IN off_t newoff;
190	IN struct ucred *cred;
191};
192
193#
194#% remove	dvp	L U U
195#% remove	vp	L U U
196#
197vop_remove {
198	IN WILLRELE struct vnode *dvp;
199	IN WILLRELE struct vnode *vp;
200	IN struct componentname *cnp;
201};
202
203#
204#% link 	vp	L U U
205#% link 	tdvp	U U U
206#
207vop_link {
208	IN WILLRELE struct vnode *vp;
209	IN struct vnode *tdvp;
210	IN struct componentname *cnp;
211};
212
213#
214#% rename	fdvp	U U U
215#% rename	fvp	U U U
216#% rename	tdvp	L U U
217#% rename	tvp	X U U
218#
219vop_rename {
220	IN WILLRELE struct vnode *fdvp;
221	IN WILLRELE struct vnode *fvp;
222	IN struct componentname *fcnp;
223	IN WILLRELE struct vnode *tdvp;
224	IN WILLRELE struct vnode *tvp;
225	IN struct componentname *tcnp;
226};
227
228#
229#% mkdir	dvp	L U U
230#% mkdir	vpp	- L -
231#
232vop_mkdir {
233	IN WILLRELE struct vnode *dvp;
234	OUT struct vnode **vpp;
235	IN struct componentname *cnp;
236	IN struct vattr *vap;
237};
238
239#
240#% rmdir	dvp	L U U
241#% rmdir	vp	L U U
242#
243vop_rmdir {
244	IN WILLRELE struct vnode *dvp;
245	IN WILLRELE struct vnode *vp;
246	IN struct componentname *cnp;
247};
248
249#
250#% symlink	dvp	L U U
251#% symlink	vpp	- U -
252# XXX - note that the return vnode has already been VRELE'ed
253#       by the filesystem layer.  To use it you must use vget,
254#       possibly with a further namei.
255#
256vop_symlink {
257	IN WILLRELE struct vnode *dvp;
258	OUT WILLRELE struct vnode **vpp;
259	IN struct componentname *cnp;
260	IN struct vattr *vap;
261	IN char *target;
262};
263
264#
265#% readdir	vp	L L L
266#
267vop_readdir {
268	IN struct vnode *vp;
269	INOUT struct uio *uio;
270	IN struct ucred *cred;
271	INOUT int *eofflag;
272	OUT u_long *cookies;
273	IN int ncookies;
274};
275
276#
277#% readlink	vp	L L L
278#
279vop_readlink {
280	IN struct vnode *vp;
281	INOUT struct uio *uio;
282	IN struct ucred *cred;
283};
284
285#
286#% abortop	dvp	= = =
287#
288vop_abortop {
289	IN struct vnode *dvp;
290	IN struct componentname *cnp;
291};
292
293#
294#% inactive	vp	U U U
295#
296vop_inactive {
297	IN struct vnode *vp;
298};
299
300#
301#% reclaim	vp	U U U
302#
303vop_reclaim {
304	IN struct vnode *vp;
305};
306
307#
308#% lock 	vp	U L U
309#
310vop_lock {
311	IN struct vnode *vp;
312};
313
314#
315#% unlock	vp	L U L
316#
317vop_unlock {
318	IN struct vnode *vp;
319};
320
321#
322#% bmap 	vp	L L L
323#% bmap 	vpp	- U -
324#
325vop_bmap {
326	IN struct vnode *vp;
327	IN daddr_t bn;
328	OUT struct vnode **vpp;
329	IN daddr_t *bnp;
330	OUT int *runp;
331};
332
333#vop_strategy {
334#	IN struct buf *bp;
335#};
336
337#
338#% print	vp	= = =
339#
340vop_print {
341	IN struct vnode *vp;
342};
343
344#
345#% islocked	vp	= = =
346#
347vop_islocked {
348	IN struct vnode *vp;
349};
350
351#
352#% pathconf	vp	L L L
353#
354vop_pathconf {
355	IN struct vnode *vp;
356	IN int name;
357	OUT int *retval;
358};
359
360#
361#% advlock	vp	U U U
362#
363vop_advlock {
364	IN struct vnode *vp;
365	IN caddr_t id;
366	IN int op;
367	IN struct flock *fl;
368	IN int flags;
369};
370
371#
372#% blkatoff	vp	L L L
373#
374vop_blkatoff {
375	IN struct vnode *vp;
376	IN off_t offset;
377	OUT char **res;
378	OUT struct buf **bpp;
379};
380
381#
382#% valloc	pvp	L L L
383#
384vop_valloc {
385	IN struct vnode *pvp;
386	IN int mode;
387	IN struct ucred *cred;
388	OUT struct vnode **vpp;
389};
390
391#
392#% reallocblks	vp	L L L
393#
394vop_reallocblks {
395	IN struct vnode *vp;
396	IN struct cluster_save *buflist;
397};
398
399#
400#% vfree	pvp	L L L
401#
402vop_vfree {
403	IN struct vnode *pvp;
404	IN ino_t ino;
405	IN int mode;
406};
407
408#
409#% truncate	vp	L L L
410#
411vop_truncate {
412	IN struct vnode *vp;
413	IN off_t length;
414	IN int flags;
415	IN struct ucred *cred;
416	IN struct proc *p;
417};
418
419#
420#% update	vp	L L L
421#
422vop_update {
423	IN struct vnode *vp;
424	IN struct timeval *access;
425	IN struct timeval *modify;
426	IN int waitfor;
427};
428
429# Needs work: no vp?
430#vop_bwrite {
431#	IN struct buf *bp;
432#};
433