Register keyword removal
[dragonfly.git] / sys / kern / vnode_if.src
1 #
2 # Copyright (c) 1992, 1993
3 #       The Regents of the University of California.  All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 # 1. Redistributions of source code must retain the above copyright
9 #    notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 #    notice, this list of conditions and the following disclaimer in the
12 #    documentation and/or other materials provided with the distribution.
13 # 3. All advertising materials mentioning features or use of this software
14 #    must display the following acknowledgement:
15 #       This product includes software developed by the University of
16 #       California, Berkeley and its contributors.
17 # 4. Neither the name of the University nor the names of its contributors
18 #    may be used to endorse or promote products derived from this software
19 #    without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 # SUCH DAMAGE.
32 #
33 #       @(#)vnode_if.src        8.12 (Berkeley) 5/14/95
34 # $FreeBSD: src/sys/kern/vnode_if.src,v 1.29.2.3 2001/05/18 09:58:45 bp Exp $
35 # $DragonFly: src/sys/kern/Attic/vnode_if.src,v 1.4 2003/06/26 05:55:14 dillon Exp $
36 #
37
38 #
39 # Above each of the vop descriptors is a specification of the locking
40 # protocol used by each vop call.  The first column is the name of
41 # the variable, the remaining three columns are in, out and error
42 # respectively.  The "in" column defines the lock state on input,
43 # the "out" column defines the state on succesful return, and the
44 # "error" column defines the locking state on error exit.
45 #
46 # The locking value can take the following values:
47 # L: locked; not converted to type of lock.
48 # A: any lock type.
49 # S: locked with shared lock.
50 # E: locked with exclusive lock for this process.
51 # O: locked with exclusive lock for other process.
52 # U: unlocked.
53 # -: not applicable.  vnode does not yet (or no longer) exists.
54 # =: the same on input and output, may be either L or U.
55 # X: locked if not nil.
56 #
57
58 #
59 #% islocked     vp      = = =
60 #
61 vop_islocked {
62         IN struct vnode *vp;
63         IN struct thread *td;
64 };
65
66 #
67 #% lookup       dvp     L ? ?
68 #% lookup       vpp     - L -
69 #
70 # XXX - the lookup locking protocol defies simple description and depends
71 #       on the flags and operation fields in the (cnp) structure.  Note
72 #       especially that *vpp may equal dvp and both may be locked.
73 #
74 vop_lookup {
75         IN struct vnode *dvp;
76         INOUT struct vnode **vpp;
77         IN struct componentname *cnp;
78 };
79
80 #
81 #% cachedlookup dvp     L ? ?
82 #% cachedlookup vpp     - L -
83 #
84 # This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
85 #
86 vop_cachedlookup {
87         IN struct vnode *dvp;
88         INOUT struct vnode **vpp;
89         IN struct componentname *cnp;
90 };
91
92 #
93 #% create       dvp     L L L
94 #% create       vpp     - L -
95 #
96 vop_create {
97         IN struct vnode *dvp;
98         OUT struct vnode **vpp;
99         IN struct componentname *cnp;
100         IN struct vattr *vap;
101 };
102
103 #
104 #% whiteout     dvp     L L L
105 #
106 vop_whiteout {
107         IN struct vnode *dvp;
108         IN struct componentname *cnp;
109         IN int flags;
110 };
111
112 #
113 #% mknod        dvp     L L L
114 #% mknod        vpp     - X -
115 #
116 vop_mknod {
117         IN struct vnode *dvp;
118         OUT struct vnode **vpp;
119         IN struct componentname *cnp;
120         IN struct vattr *vap;
121 };
122
123 #
124 #% open         vp      L L L
125 #
126 vop_open {
127         IN struct vnode *vp;
128         IN int mode;
129         IN struct ucred *cred;
130         IN struct thread *td;
131 };
132
133 #
134 #% close        vp      U U U
135 #
136 vop_close {
137         IN struct vnode *vp;
138         IN int fflag;
139         IN struct thread *td;
140 };
141
142 #
143 #% access       vp      L L L
144 #
145 vop_access {
146         IN struct vnode *vp;
147         IN int mode;
148         IN struct ucred *cred;
149         IN struct thread *td;
150 };
151
152 #
153 #% getattr      vp      = = =
154 #
155 vop_getattr {
156         IN struct vnode *vp;
157         OUT struct vattr *vap;
158         IN struct thread *td;
159 };
160
161 #
162 #% setattr      vp      L L L
163 #
164 vop_setattr {
165         IN struct vnode *vp;
166         IN struct vattr *vap;
167         IN struct ucred *cred;
168         IN struct thread *td;
169 };
170
171 #
172 #% read         vp      L L L
173 #
174 vop_read {
175         IN struct vnode *vp;
176         INOUT struct uio *uio;
177         IN int ioflag;
178         IN struct ucred *cred;
179 };
180
181 #
182 #% write        vp      L L L
183 #
184 vop_write {
185         IN struct vnode *vp;
186         INOUT struct uio *uio;
187         IN int ioflag;
188         IN struct ucred *cred;
189 };
190
191 #
192 #% lease        vp      = = =
193 #
194 vop_lease {
195         IN struct vnode *vp;
196         IN struct thread *td;
197         IN struct ucred *cred;
198         IN int flag;
199 };
200
201 #
202 #% ioctl        vp      U U U
203 #
204 vop_ioctl {
205         IN struct vnode *vp;
206         IN u_long command;
207         IN caddr_t data;
208         IN int fflag;
209         IN struct ucred *cred;
210         IN struct thread *td;
211 };
212
213 #
214 #% poll vp      U U U
215 #
216 vop_poll {
217         IN struct vnode *vp;
218         IN int events;
219         IN struct ucred *cred;
220         IN struct thread *td;
221 };
222
223 #
224 #% kqfilter     vp      U U U
225 #
226 vop_kqfilter {
227         IN struct vnode *vp;
228         IN struct knote *kn;
229 };
230
231 #
232 #% revoke       vp      U U U
233 #
234 vop_revoke {
235         IN struct vnode *vp;
236         IN int flags;
237 };
238
239 #
240 # XXX - not used
241 #
242 vop_mmap {
243         IN struct vnode *vp;
244         IN int fflags;
245         IN struct ucred *cred;
246         IN struct thread *td;
247 };
248
249 #
250 #% fsync        vp      L L L
251 #
252 vop_fsync {
253         IN struct vnode *vp;
254         IN int waitfor;
255         IN struct thread *td;
256 };
257
258 #
259 #% remove       dvp     L L L
260 #% remove       vp      L L L
261 #
262 vop_remove {
263         IN struct vnode *dvp;
264         IN struct vnode *vp;
265         IN struct componentname *cnp;
266 };
267
268 #
269 #% link         tdvp    L L L
270 #% link         vp      U U U
271 #
272 vop_link {
273         IN struct vnode *tdvp;
274         IN struct vnode *vp;
275         IN struct componentname *cnp;
276 };
277
278 #
279 #% rename       fdvp    U U U
280 #% rename       fvp     U U U
281 #% rename       tdvp    L U U
282 #% rename       tvp     X U U
283 #
284 vop_rename {
285         IN WILLRELE struct vnode *fdvp;
286         IN WILLRELE struct vnode *fvp;
287         IN struct componentname *fcnp;
288         IN WILLRELE struct vnode *tdvp;
289         IN WILLRELE struct vnode *tvp;
290         IN struct componentname *tcnp;
291 };
292
293 #
294 #% mkdir        dvp     L L L
295 #% mkdir        vpp     - L -
296 #
297 vop_mkdir {
298         IN struct vnode *dvp;
299         OUT struct vnode **vpp;
300         IN struct componentname *cnp;
301         IN struct vattr *vap;
302 };
303
304 #
305 #% rmdir        dvp     L L L
306 #% rmdir        vp      L L L
307 #
308 vop_rmdir {
309         IN struct vnode *dvp;
310         IN struct vnode *vp;
311         IN struct componentname *cnp;
312 };
313
314 #
315 #% symlink      dvp     L L L
316 #% symlink      vpp     - U -
317 #
318 vop_symlink {
319         IN struct vnode *dvp;
320         OUT struct vnode **vpp;
321         IN struct componentname *cnp;
322         IN struct vattr *vap;
323         IN char *target;
324 };
325
326 #
327 #% readdir      vp      L L L
328 #
329 vop_readdir {
330         IN struct vnode *vp;
331         INOUT struct uio *uio;
332         IN struct ucred *cred;
333         INOUT int *eofflag;
334         OUT int *ncookies;
335         INOUT u_long **cookies;
336 };
337
338 #
339 #% readlink     vp      L L L
340 #
341 vop_readlink {
342         IN struct vnode *vp;
343         INOUT struct uio *uio;
344         IN struct ucred *cred;
345 };
346
347 #
348 #% inactive     vp      L U U
349 #
350 vop_inactive {
351         IN struct vnode *vp;
352         IN struct thread *td;
353 };
354
355 #
356 #% reclaim      vp      U U U
357 #
358 vop_reclaim {
359         IN struct vnode *vp;
360         IN struct thread *td;
361 };
362
363 #
364 #% lock         vp      ? ? ?
365 #
366 vop_lock {
367         IN struct vnode *vp;
368         IN int flags;
369         IN struct thread *td;
370 };
371
372 #
373 #% unlock       vp      L U L
374 #
375 vop_unlock {
376         IN struct vnode *vp;
377         IN int flags;
378         IN struct thread *td;
379 };
380
381 #
382 #% bmap         vp      L L L
383 #% bmap         vpp     - U -
384 #
385 vop_bmap {
386         IN struct vnode *vp;
387         IN daddr_t bn;
388         OUT struct vnode **vpp;
389         IN daddr_t *bnp;
390         OUT int *runp;
391         OUT int *runb;
392 };
393
394 #
395 #% strategy     vp      L L L
396 #
397 vop_strategy {
398         IN struct vnode *vp;
399         IN struct buf *bp;
400 };
401
402 #
403 #% print        vp      = = =
404 #
405 vop_print {
406         IN struct vnode *vp;
407 };
408
409 #
410 #% pathconf     vp      L L L
411 #
412 vop_pathconf {
413         IN struct vnode *vp;
414         IN int name;
415         OUT register_t *retval;
416 };
417
418 #
419 #% advlock      vp      U U U
420 #
421 vop_advlock {
422         IN struct vnode *vp;
423         IN caddr_t id;
424         IN int op;
425         IN struct flock *fl;
426         IN int flags;
427 };
428
429 #
430 #% balloc       vp      L L L
431 #
432 vop_balloc {
433         IN struct vnode *vp;
434         IN off_t startoffset;
435         IN int size;
436         IN struct ucred *cred;
437         IN int flags;
438         OUT struct buf **bpp;
439 };
440
441 #
442 #% reallocblks  vp      L L L
443 #
444 vop_reallocblks {
445         IN struct vnode *vp;
446         IN struct cluster_save *buflist;
447 };
448
449 #
450 #% getpages     vp      L L L
451 #
452 vop_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
460 #
461 #% putpages     vp      L L L
462 #
463 vop_putpages {
464         IN struct vnode *vp;
465         IN vm_page_t *m;
466         IN int count;
467         IN int sync;
468         IN int *rtvals;
469         IN vm_ooffset_t offset;
470 };
471
472 #
473 #% freeblks     vp      - - -
474 #
475 # This call is used by the filesystem to release blocks back to 
476 # device-driver.  This is useful if the driver has a lengthy 
477 # erase handling or similar.
478 #
479
480 vop_freeblks {
481         IN struct vnode *vp;
482         IN daddr_t addr;
483         IN daddr_t length;
484 };
485
486 #
487 #% bwrite       vp      L L L
488 #
489 vop_bwrite {
490         IN struct vnode *vp;
491         IN struct buf *bp;
492 };
493
494 #
495 #% getacl       vp      = = =
496 #
497 vop_getacl {
498         IN struct vnode *vp;
499         IN acl_type_t type;
500         OUT struct acl *aclp;
501         IN struct ucred *cred;
502         IN struct thread *td;
503 };
504
505 #
506 #% setacl       vp      L L L
507 #
508 vop_setacl {
509         IN struct vnode *vp;
510         IN acl_type_t type;
511         IN struct acl *aclp;
512         IN struct ucred *cred;
513         IN struct thread *td;
514 };
515
516 #
517 #% aclcheck     vp      = = =
518 #
519 vop_aclcheck {
520         IN struct vnode *vp;
521         IN acl_type_t type;
522         IN struct acl *aclp;
523         IN struct ucred *cred;
524         IN struct thread *td;
525 };
526
527 #
528 #% getextattr   vp      L L L
529 #
530 vop_getextattr {
531         IN struct vnode *vp;
532         IN char *name;
533         INOUT struct uio *uio;
534         IN struct ucred *cred;
535         IN struct thread *td;
536 };
537
538 #
539 #% setextattr   vp      L L L
540 #
541 vop_setextattr {
542         IN struct vnode *vp;
543         IN char *name;
544         INOUT struct uio *uio;
545         IN struct ucred *cred;
546         IN struct thread *td;
547 };
548
549 #
550 #% createvobject        vp      L L L
551 #
552 vop_createvobject {
553         IN struct vnode *vp;
554         IN struct thread *td;
555 };
556
557 #
558 #% destroyvobject       vp      L L L
559 #
560 vop_destroyvobject {
561         IN struct vnode *vp;
562 };
563
564 #
565 #% getvobject   vp      L L L
566 #
567 vop_getvobject {
568         IN struct vnode *vp;
569         OUT struct vm_object **objpp;
570 };