vnode_if.src revision 38862
181084Sjake#
281084Sjake# Copyright (c) 1992, 1993
381084Sjake#	The Regents of the University of California.  All rights reserved.
481084Sjake#
581084Sjake# Redistribution and use in source and binary forms, with or without
681084Sjake# modification, are permitted provided that the following conditions
781084Sjake# are met:
881084Sjake# 1. Redistributions of source code must retain the above copyright
981084Sjake#    notice, this list of conditions and the following disclaimer.
10147272Smarius# 2. Redistributions in binary form must reproduce the above copyright
11147272Smarius#    notice, this list of conditions and the following disclaimer in the
12147272Smarius#    documentation and/or other materials provided with the distribution.
13147272Smarius# 3. All advertising materials mentioning features or use of this software
14147272Smarius#    must display the following acknowledgement:
15163890Smarius#	This product includes software developed by the University of
16163890Smarius#	California, Berkeley and its contributors.
17163890Smarius# 4. Neither the name of the University nor the names of its contributors
18163890Smarius#    may be used to endorse or promote products derived from this software
19163890Smarius#    without specific prior written permission.
20146419Smarius#
21146419Smarius# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22146419Smarius# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23146419Smarius# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24146419Smarius# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25233578Speter# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26207154Smarius# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27252356Sdavide# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28147272Smarius# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29147272Smarius# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30147272Smarius# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31147272Smarius# SUCH DAMAGE.
32147272Smarius#
33147272Smarius#	@(#)vnode_if.src	8.12 (Berkeley) 5/14/95
34147272Smarius# $Id: vnode_if.src,v 1.18 1998/07/04 20:45:32 julian Exp $
35152862Sru#
36130294Sscottl
37119382Sjake#
38269601Snwhitehorn# Above each of the vop descriptors is a specification of the locking
39119382Sjake# protocol used by each vop call.  The first column is the name of
40170840Smarius# the variable, the remaining three columns are in, out and error
41146483Smarius# respectively.  The "in" column defines the lock state on input,
42147191Sjkoshy# the "out" column defines the state on succesful return, and the
43166144Smarius# "error" column defines the locking state on error exit.
44155151Smarius#
45166144Smarius# The locking value can take the following values:
46133589Smarius# L: locked.
47152683Smarius# U: unlocked/
48207154Smarius# -: not applicable.  vnode does not yet (or no longer) exists.
49207154Smarius# =: the same on input and output, may be either L or U.
50186347Snwhitehorn# X: locked if not nil.
5186148Stmm#
52105399Stmm
53116584Sjake#
54152686Smarius#% lookup	dvp	L ? ?
55151805Sjoerg#% lookup	vpp	- L -
56152862Sru#
57152862Sru# XXX - the lookup locking protocol defies simple description and depends
58119382Sjake#	on the flags and operation fields in the (cnp) structure.  Note
59186681Sed#	especially that *vpp may equal dvp and both may be locked.
60119382Sjake#
61119816Smarcelvop_lookup {
62259016Sray	IN struct vnode *dvp;
63269415Snwhitehorn	INOUT struct vnode **vpp;
64210601Smav	IN struct componentname *cnp;
65237433Skib};
6693122Stmm
67269577Sglebius#
68124516Sdes#% cachedlookup	dvp	L ? ?
69124481Sdes#% cachedlookup	vpp	- L -
70289765Scem#
71124481Sdes# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
72124481Sdes#
73261891Savgvop_cachedlookup {
74189170Sed	IN struct vnode *dvp;
75111072Sjake	INOUT struct vnode **vpp;
76100399Speter	IN struct componentname *cnp;
77202006Smarius};
78182057Smarius
79111072Sjake#
8086235Stmm#% create	dvp	L L L
81136944Syongari#% create	vpp	- L -
82152862Sru#
83128758Smariusvop_create {
84202010Smarius	IN struct vnode *dvp;
85287726Smarius	OUT struct vnode **vpp;
86129051Smarius	IN struct componentname *cnp;
87129051Smarius	IN struct vattr *vap;
88129051Smarius};
89220038Smarius
9086235Stmm#
91207154Smarius#% whiteout	dvp	L L L
92183423Smarius#% whiteout	cnp	- - -
93146392Smarius#% whiteout	flag	- - -
9490623Stmm#
95146392Smariusvop_whiteout {
96249083Smav	IN struct vnode *dvp;
9781084Sjake	IN struct componentname *cnp;
9886235Stmm	IN int flags;
9986235Stmm};
100228022Smarius
101112399Sjake#
10281084Sjake#% mknod	dvp	L L L
10390623Stmm#% mknod	vpp	- X -
10490623Stmm#
10590623Stmmvop_mknod {
10690623Stmm	IN struct vnode *dvp;
10790623Stmm	OUT WILLRELE struct vnode **vpp;
108105531Stmm	IN struct componentname *cnp;
10981084Sjake	IN struct vattr *vap;
110183202Smarius};
111183202Smarius
112152862Sru#
113152862Sru#% open		vp	L L L
114131951Smarcel#
11584202Sjakevop_open {
116220885Sbz	IN struct vnode *vp;
117183202Smarius	IN int mode;
118183202Smarius	IN struct ucred *cred;
11981390Sjake	IN struct proc *p;
12086235Stmm};
121182918Smarius
122111684Sru#
12381084Sjake#% close	vp	U U U
124132956Smarkm#
125183202Smariusvop_close {
126183202Smarius	IN struct vnode *vp;
127101070Sjake	IN int fflag;
12889053Sjake	IN struct ucred *cred;
12986235Stmm	IN struct proc *p;
13086235Stmm};
13181084Sjake
132100844Sjake#
133152862Sru#% access	vp	L L L
13482914Sjake#
135119382Sjakevop_access {
136182918Smarius	IN struct vnode *vp;
137112399Sjake	IN int mode;
138203845Smarius	IN struct ucred *cred;
139174195Srwatson	IN struct proc *p;
140183202Smarius};
141183202Smarius
14281084Sjake#
143101070Sjake#% getattr	vp	= = =
14481390Sjake#
14596998Sjakevop_getattr {
14681084Sjake	IN struct vnode *vp;
14781084Sjake	IN struct vattr *vap;
148127297Salc	IN struct ucred *cred;
149166060Smarius	IN struct proc *p;
15081084Sjake};
151207537Smarius
152#
153#% setattr	vp	L L L
154#
155vop_setattr {
156	IN struct vnode *vp;
157	IN struct vattr *vap;
158	IN struct ucred *cred;
159	IN struct proc *p;
160};
161
162#
163#% read		vp	L L L
164#
165vop_read {
166	IN struct vnode *vp;
167	INOUT struct uio *uio;
168	IN int ioflag;
169	IN struct ucred *cred;
170};
171
172#
173#% write	vp	L L L
174#
175vop_write {
176	IN struct vnode *vp;
177	INOUT struct uio *uio;
178	IN int ioflag;
179	IN struct ucred *cred;
180};
181
182#
183#% lease	vp	= = =
184#
185vop_lease {
186	IN struct vnode *vp;
187	IN struct proc *p;
188	IN struct ucred *cred;
189	IN int flag;
190};
191
192#
193#% ioctl	vp	U U U
194#
195vop_ioctl {
196	IN struct vnode *vp;
197	IN u_long command;
198	IN caddr_t data;
199	IN int fflag;
200	IN struct ucred *cred;
201	IN struct proc *p;
202};
203
204#
205#% poll	vp	U U U
206#
207vop_poll {
208	IN struct vnode *vp;
209	IN int events;
210	IN struct ucred *cred;
211	IN struct proc *p;
212};
213
214#
215#% revoke	vp	U U U
216#
217vop_revoke {
218	IN struct vnode *vp;
219	IN int flags;
220};
221
222#
223# XXX - not used
224#
225vop_mmap {
226	IN struct vnode *vp;
227	IN int fflags;
228	IN struct ucred *cred;
229	IN struct proc *p;
230};
231
232#
233#% fsync	vp	L L L
234#
235vop_fsync {
236	IN struct vnode *vp;
237	IN struct ucred *cred;
238	IN int waitfor;
239	IN struct proc *p;
240};
241
242#
243#% remove	dvp	L L L
244#% remove	vp	L L L
245#
246vop_remove {
247	IN struct vnode *dvp;
248	IN struct vnode *vp;
249	IN struct componentname *cnp;
250};
251
252#
253#% link		tdvp	L L L
254#% link		vp	U U U
255#
256vop_link {
257	IN struct vnode *tdvp;
258	IN struct vnode *vp;
259	IN struct componentname *cnp;
260};
261
262#
263#% rename	fdvp	U U U
264#% rename	fvp	U U U
265#% rename	tdvp	L U U
266#% rename	tvp	X U U
267#
268vop_rename {
269	IN WILLRELE struct vnode *fdvp;
270	IN WILLRELE struct vnode *fvp;
271	IN struct componentname *fcnp;
272	IN WILLRELE struct vnode *tdvp;
273	IN WILLRELE struct vnode *tvp;
274	IN struct componentname *tcnp;
275};
276
277#
278#% mkdir	dvp	L L L
279#% mkdir	vpp	- L -
280#
281vop_mkdir {
282	IN struct vnode *dvp;
283	OUT struct vnode **vpp;
284	IN struct componentname *cnp;
285	IN struct vattr *vap;
286};
287
288#
289#% rmdir	dvp	L L L
290#% rmdir	vp	L L L
291#
292vop_rmdir {
293	IN struct vnode *dvp;
294	IN struct vnode *vp;
295	IN struct componentname *cnp;
296};
297
298#
299#% symlink	dvp	L L L
300#% symlink	vpp	- U -
301#
302# XXX - note that the return vnode has already been VRELE'ed
303#	by the filesystem layer.  To use it you must use vget,
304#	possibly with a further namei.
305#
306vop_symlink {
307	IN struct vnode *dvp;
308	OUT WILLRELE struct vnode **vpp;
309	IN struct componentname *cnp;
310	IN struct vattr *vap;
311	IN char *target;
312};
313
314#
315#% readdir	vp	L L L
316#
317vop_readdir {
318	IN struct vnode *vp;
319	INOUT struct uio *uio;
320	IN struct ucred *cred;
321	INOUT int *eofflag;
322	OUT int *ncookies;
323	INOUT u_long **cookies;
324};
325
326#
327#% readlink	vp	L L L
328#
329vop_readlink {
330	IN struct vnode *vp;
331	INOUT struct uio *uio;
332	IN struct ucred *cred;
333};
334
335#
336#% abortop	dvp	= = =
337#
338vop_abortop {
339	IN struct vnode *dvp;
340	IN struct componentname *cnp;
341};
342
343#
344#% inactive	vp	L U U
345#
346vop_inactive {
347	IN struct vnode *vp;
348	IN struct proc *p;
349};
350
351#
352#% reclaim	vp	U U U
353#
354vop_reclaim {
355	IN struct vnode *vp;
356	IN struct proc *p;
357};
358
359#
360#% lock		vp	U L U
361#
362vop_lock {
363	IN struct vnode *vp;
364	IN int flags;
365	IN struct proc *p;
366};
367
368#
369#% unlock	vp	L U L
370#
371vop_unlock {
372	IN struct vnode *vp;
373	IN int flags;
374	IN struct proc *p;
375};
376
377#
378#% bmap		vp	L L L
379#% bmap		vpp	- U -
380#
381vop_bmap {
382	IN struct vnode *vp;
383	IN daddr_t bn;
384	OUT struct vnode **vpp;
385	IN daddr_t *bnp;
386	OUT int *runp;
387	OUT int *runb;
388};
389
390#
391# Needs work: no vp?
392#
393vop_strategy {
394	IN struct vnode *vp;
395	IN struct buf *bp;
396};
397
398#
399#% print	vp	= = =
400#
401vop_print {
402	IN struct vnode *vp;
403};
404
405#
406#% islocked	vp	= = =
407#
408vop_islocked {
409	IN struct vnode *vp;
410};
411
412#
413#% pathconf	vp	L L L
414#
415vop_pathconf {
416	IN struct vnode *vp;
417	IN int name;
418	OUT register_t *retval;
419};
420
421#
422#% advlock	vp	U U U
423#
424vop_advlock {
425	IN struct vnode *vp;
426	IN caddr_t id;
427	IN int op;
428	IN struct flock *fl;
429	IN int flags;
430};
431
432#
433#% balloc	vp	L L L
434#
435vop_balloc {
436	IN struct vnode *vp;
437	IN off_t startoffset;
438	IN int size;
439	IN struct ucred *cred;
440	IN int flags;
441	OUT struct buf **bpp;
442};
443
444#
445#% reallocblks	vp	L L L
446#
447vop_reallocblks {
448	IN struct vnode *vp;
449	IN struct cluster_save *buflist;
450};
451
452vop_getpages {
453	IN struct vnode *vp;
454	IN vm_page_t *m;
455	IN int count;
456	IN int reqpage;
457	IN vm_ooffset_t offset;
458};
459
460vop_putpages {
461	IN struct vnode *vp;
462	IN vm_page_t *m;
463	IN int count;
464	IN int sync;
465	IN int *rtvals;
466	IN vm_ooffset_t offset;
467};
468
469#
470#% freeblks	vp	- - -
471#
472# This call is used by the filesystem to release blocks back to 
473# device-driver.  This is useful if the driver has a lengthy 
474# erase handling or similar.
475#
476
477vop_freeblks {
478	IN struct vnode *vp;
479	IN daddr_t addr;
480	IN daddr_t length;
481};
482
483#
484# Needs work: no vp?
485#
486#vop_bwrite {
487#	IN struct buf *bp;
488#};
489