proc->thread stage 4: rework the VFS and DEVICE subsystems to take thread
[dragonfly.git] / sys / kern / vnode_if.src
CommitLineData
984263bc
MD
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 $
dadab5e9 35# $DragonFly: src/sys/kern/Attic/vnode_if.src,v 1.3 2003/06/25 03:55:57 dillon Exp $
984263bc
MD
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#
61vop_islocked {
62 IN struct vnode *vp;
dadab5e9 63 IN struct thread *td;
984263bc
MD
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#
74vop_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#
86vop_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#
96vop_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#
106vop_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#
116vop_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#
126vop_open {
127 IN struct vnode *vp;
128 IN int mode;
129 IN struct ucred *cred;
dadab5e9 130 IN struct thread *td;
984263bc
MD
131};
132
133#
134#% close vp U U U
135#
136vop_close {
137 IN struct vnode *vp;
138 IN int fflag;
139 IN struct ucred *cred;
dadab5e9 140 IN struct thread *td;
984263bc
MD
141};
142
143#
144#% access vp L L L
145#
146vop_access {
147 IN struct vnode *vp;
148 IN int mode;
149 IN struct ucred *cred;
dadab5e9 150 IN struct thread *td;
984263bc
MD
151};
152
153#
154#% getattr vp = = =
155#
156vop_getattr {
157 IN struct vnode *vp;
158 OUT struct vattr *vap;
159 IN struct ucred *cred;
dadab5e9 160 IN struct thread *td;
984263bc
MD
161};
162
163#
164#% setattr vp L L L
165#
166vop_setattr {
167 IN struct vnode *vp;
168 IN struct vattr *vap;
169 IN struct ucred *cred;
dadab5e9 170 IN struct thread *td;
984263bc
MD
171};
172
173#
174#% read vp L L L
175#
176vop_read {
177 IN struct vnode *vp;
178 INOUT struct uio *uio;
179 IN int ioflag;
180 IN struct ucred *cred;
181};
182
183#
184#% write vp L L L
185#
186vop_write {
187 IN struct vnode *vp;
188 INOUT struct uio *uio;
189 IN int ioflag;
190 IN struct ucred *cred;
191};
192
193#
194#% lease vp = = =
195#
196vop_lease {
197 IN struct vnode *vp;
dadab5e9 198 IN struct thread *td;
984263bc
MD
199 IN struct ucred *cred;
200 IN int flag;
201};
202
203#
204#% ioctl vp U U U
205#
206vop_ioctl {
207 IN struct vnode *vp;
208 IN u_long command;
209 IN caddr_t data;
210 IN int fflag;
211 IN struct ucred *cred;
dadab5e9 212 IN struct thread *td;
984263bc
MD
213};
214
215#
216#% poll vp U U U
217#
218vop_poll {
219 IN struct vnode *vp;
220 IN int events;
221 IN struct ucred *cred;
dadab5e9 222 IN struct thread *td;
984263bc
MD
223};
224
225#
226#% kqfilter vp U U U
227#
228vop_kqfilter {
229 IN struct vnode *vp;
230 IN struct knote *kn;
231};
232
233#
234#% revoke vp U U U
235#
236vop_revoke {
237 IN struct vnode *vp;
238 IN int flags;
239};
240
241#
242# XXX - not used
243#
244vop_mmap {
245 IN struct vnode *vp;
246 IN int fflags;
247 IN struct ucred *cred;
dadab5e9 248 IN struct thread *td;
984263bc
MD
249};
250
251#
252#% fsync vp L L L
253#
254vop_fsync {
255 IN struct vnode *vp;
256 IN struct ucred *cred;
257 IN int waitfor;
dadab5e9 258 IN struct thread *td;
984263bc
MD
259};
260
261#
262#% remove dvp L L L
263#% remove vp L L L
264#
265vop_remove {
266 IN struct vnode *dvp;
267 IN struct vnode *vp;
268 IN struct componentname *cnp;
269};
270
271#
272#% link tdvp L L L
273#% link vp U U U
274#
275vop_link {
276 IN struct vnode *tdvp;
277 IN struct vnode *vp;
278 IN struct componentname *cnp;
279};
280
281#
282#% rename fdvp U U U
283#% rename fvp U U U
284#% rename tdvp L U U
285#% rename tvp X U U
286#
287vop_rename {
288 IN WILLRELE struct vnode *fdvp;
289 IN WILLRELE struct vnode *fvp;
290 IN struct componentname *fcnp;
291 IN WILLRELE struct vnode *tdvp;
292 IN WILLRELE struct vnode *tvp;
293 IN struct componentname *tcnp;
294};
295
296#
297#% mkdir dvp L L L
298#% mkdir vpp - L -
299#
300vop_mkdir {
301 IN struct vnode *dvp;
302 OUT struct vnode **vpp;
303 IN struct componentname *cnp;
304 IN struct vattr *vap;
305};
306
307#
308#% rmdir dvp L L L
309#% rmdir vp L L L
310#
311vop_rmdir {
312 IN struct vnode *dvp;
313 IN struct vnode *vp;
314 IN struct componentname *cnp;
315};
316
317#
318#% symlink dvp L L L
319#% symlink vpp - U -
320#
321vop_symlink {
322 IN struct vnode *dvp;
323 OUT struct vnode **vpp;
324 IN struct componentname *cnp;
325 IN struct vattr *vap;
326 IN char *target;
327};
328
329#
330#% readdir vp L L L
331#
332vop_readdir {
333 IN struct vnode *vp;
334 INOUT struct uio *uio;
335 IN struct ucred *cred;
336 INOUT int *eofflag;
337 OUT int *ncookies;
338 INOUT u_long **cookies;
339};
340
341#
342#% readlink vp L L L
343#
344vop_readlink {
345 IN struct vnode *vp;
346 INOUT struct uio *uio;
347 IN struct ucred *cred;
348};
349
350#
351#% inactive vp L U U
352#
353vop_inactive {
354 IN struct vnode *vp;
dadab5e9 355 IN struct thread *td;
984263bc
MD
356};
357
358#
359#% reclaim vp U U U
360#
361vop_reclaim {
362 IN struct vnode *vp;
dadab5e9 363 IN struct thread *td;
984263bc
MD
364};
365
366#
367#% lock vp ? ? ?
368#
369vop_lock {
370 IN struct vnode *vp;
371 IN int flags;
dadab5e9 372 IN struct thread *td;
984263bc
MD
373};
374
375#
376#% unlock vp L U L
377#
378vop_unlock {
379 IN struct vnode *vp;
380 IN int flags;
dadab5e9 381 IN struct thread *td;
984263bc
MD
382};
383
384#
385#% bmap vp L L L
386#% bmap vpp - U -
387#
388vop_bmap {
389 IN struct vnode *vp;
390 IN daddr_t bn;
391 OUT struct vnode **vpp;
392 IN daddr_t *bnp;
393 OUT int *runp;
394 OUT int *runb;
395};
396
397#
398#% strategy vp L L L
399#
400vop_strategy {
401 IN struct vnode *vp;
402 IN struct buf *bp;
403};
404
405#
406#% print vp = = =
407#
408vop_print {
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
452#
453#% getpages vp L L L
454#
455vop_getpages {
456 IN struct vnode *vp;
457 IN vm_page_t *m;
458 IN int count;
459 IN int reqpage;
460 IN vm_ooffset_t offset;
461};
462
463#
464#% putpages vp L L L
465#
466vop_putpages {
467 IN struct vnode *vp;
468 IN vm_page_t *m;
469 IN int count;
470 IN int sync;
471 IN int *rtvals;
472 IN vm_ooffset_t offset;
473};
474
475#
476#% freeblks vp - - -
477#
478# This call is used by the filesystem to release blocks back to
479# device-driver. This is useful if the driver has a lengthy
480# erase handling or similar.
481#
482
483vop_freeblks {
484 IN struct vnode *vp;
485 IN daddr_t addr;
486 IN daddr_t length;
487};
488
489#
490#% bwrite vp L L L
491#
492vop_bwrite {
493 IN struct vnode *vp;
494 IN struct buf *bp;
495};
496
497#
498#% getacl vp = = =
499#
500vop_getacl {
501 IN struct vnode *vp;
502 IN acl_type_t type;
503 OUT struct acl *aclp;
504 IN struct ucred *cred;
dadab5e9 505 IN struct thread *td;
984263bc
MD
506};
507
508#
509#% setacl vp L L L
510#
511vop_setacl {
512 IN struct vnode *vp;
513 IN acl_type_t type;
514 IN struct acl *aclp;
515 IN struct ucred *cred;
dadab5e9 516 IN struct thread *td;
984263bc
MD
517};
518
519#
520#% aclcheck vp = = =
521#
522vop_aclcheck {
523 IN struct vnode *vp;
524 IN acl_type_t type;
525 IN struct acl *aclp;
526 IN struct ucred *cred;
dadab5e9 527 IN struct thread *td;
984263bc
MD
528};
529
530#
531#% getextattr vp L L L
532#
533vop_getextattr {
534 IN struct vnode *vp;
535 IN char *name;
536 INOUT struct uio *uio;
537 IN struct ucred *cred;
dadab5e9 538 IN struct thread *td;
984263bc
MD
539};
540
541#
542#% setextattr vp L L L
543#
544vop_setextattr {
545 IN struct vnode *vp;
546 IN char *name;
547 INOUT struct uio *uio;
548 IN struct ucred *cred;
dadab5e9 549 IN struct thread *td;
984263bc
MD
550};
551
552#
553#% createvobject vp L L L
554#
555vop_createvobject {
556 IN struct vnode *vp;
557 IN struct ucred *cred;
dadab5e9 558 IN struct thread *td;
984263bc
MD
559};
560
561#
562#% destroyvobject vp L L L
563#
564vop_destroyvobject {
565 IN struct vnode *vp;
566};
567
568#
569#% getvobject vp L L L
570#
571vop_getvobject {
572 IN struct vnode *vp;
573 OUT struct vm_object **objpp;
574};