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