]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/vnode_if.h
xnu-517.9.4.tar.gz
[apple/xnu.git] / bsd / sys / vnode_if.h
1
2 /*
3 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 *
5 * @APPLE_LICENSE_HEADER_START@
6 *
7 * The contents of this file constitute Original Code as defined in and
8 * are subject to the Apple Public Source License Version 1.1 (the
9 * "License"). You may not use this file except in compliance with the
10 * License. Please obtain a copy of the License at
11 * http://www.apple.com/publicsource and read it before using this file.
12 *
13 * This Original Code and all software distributed under the License are
14 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
18 * License for the specific language governing rights and limitations
19 * under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
25 * Copyright (c) 1992, 1993, 1994, 1995
26 * The Regents of the University of California. All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. All advertising materials mentioning features or use of this software
37 * must display the following acknowledgement:
38 * This product includes software developed by the University of
39 * California, Berkeley and its contributors.
40 * 4. Neither the name of the University nor the names of its contributors
41 * may be used to endorse or promote products derived from this software
42 * without specific prior written permission.
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS AND
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 */
56
57
58 /*
59 * Warning: This file is generated automatically.
60 * (Modifications made here may easily be lost!)
61 *
62 * Created by the script:
63 * @(#)vnode_if.sh 8.7 (Berkeley) 5/11/95
64 */
65
66
67 #ifndef _SYS_VNODE_IF_H_
68 #define _SYS_VNODE_IF_H_
69
70 #include <sys/appleapiopts.h>
71
72 #ifdef __APPLE_API_UNSTABLE
73 extern struct vnodeop_desc vop_default_desc;
74
75
76 struct vop_lookup_args {
77 struct vnodeop_desc *a_desc;
78 struct vnode *a_dvp;
79 struct vnode **a_vpp;
80 struct componentname *a_cnp;
81 };
82 extern struct vnodeop_desc vop_lookup_desc;
83 #define VOP_LOOKUP(dvp, vpp, cnp) _VOP_LOOKUP(dvp, vpp, cnp)
84 static __inline int _VOP_LOOKUP(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
85 {
86 struct vop_lookup_args a;
87 a.a_desc = VDESC(vop_lookup);
88 a.a_dvp = dvp;
89 a.a_vpp = vpp;
90 a.a_cnp = cnp;
91 return (VCALL(dvp, VOFFSET(vop_lookup), &a));
92 }
93
94 struct vop_cachedlookup_args {
95 struct vnodeop_desc *a_desc;
96 struct vnode *a_dvp;
97 struct vnode **a_vpp;
98 struct componentname *a_cnp;
99 };
100 extern struct vnodeop_desc vop_cachedlookup_desc;
101 #define VOP_CACHEDLOOKUP(dvp, vpp, cnp) _VOP_CACHEDLOOKUP(dvp, vpp, cnp)
102 static __inline int _VOP_CACHEDLOOKUP(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
103 {
104 struct vop_cachedlookup_args a;
105 a.a_desc = VDESC(vop_cachedlookup);
106 a.a_dvp = dvp;
107 a.a_vpp = vpp;
108 a.a_cnp = cnp;
109 return (VCALL(dvp, VOFFSET(vop_cachedlookup), &a));
110 }
111
112 struct vop_create_args {
113 struct vnodeop_desc *a_desc;
114 struct vnode *a_dvp;
115 struct vnode **a_vpp;
116 struct componentname *a_cnp;
117 struct vattr *a_vap;
118 };
119 extern struct vnodeop_desc vop_create_desc;
120 #define VOP_CREATE(dvp, vpp, cnp, vap) _VOP_CREATE(dvp, vpp, cnp, vap)
121 static __inline int _VOP_CREATE(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
122 {
123 struct vop_create_args a;
124 a.a_desc = VDESC(vop_create);
125 a.a_dvp = dvp;
126 a.a_vpp = vpp;
127 a.a_cnp = cnp;
128 a.a_vap = vap;
129 return (VCALL(dvp, VOFFSET(vop_create), &a));
130 }
131
132 struct vop_whiteout_args {
133 struct vnodeop_desc *a_desc;
134 struct vnode *a_dvp;
135 struct componentname *a_cnp;
136 int a_flags;
137 };
138 extern struct vnodeop_desc vop_whiteout_desc;
139 #define VOP_WHITEOUT(dvp, cnp, flags) _VOP_WHITEOUT(dvp, cnp, flags)
140 static __inline int _VOP_WHITEOUT(struct vnode *dvp, struct componentname *cnp, int flags)
141 {
142 struct vop_whiteout_args a;
143 a.a_desc = VDESC(vop_whiteout);
144 a.a_dvp = dvp;
145 a.a_cnp = cnp;
146 a.a_flags = flags;
147 return (VCALL(dvp, VOFFSET(vop_whiteout), &a));
148 }
149
150 struct vop_mknod_args {
151 struct vnodeop_desc *a_desc;
152 struct vnode *a_dvp;
153 struct vnode **a_vpp;
154 struct componentname *a_cnp;
155 struct vattr *a_vap;
156 };
157 extern struct vnodeop_desc vop_mknod_desc;
158 #define VOP_MKNOD(dvp, vpp, cnp, vap) _VOP_MKNOD(dvp, vpp, cnp, vap)
159 static __inline int _VOP_MKNOD(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
160 {
161 struct vop_mknod_args a;
162 a.a_desc = VDESC(vop_mknod);
163 a.a_dvp = dvp;
164 a.a_vpp = vpp;
165 a.a_cnp = cnp;
166 a.a_vap = vap;
167 return (VCALL(dvp, VOFFSET(vop_mknod), &a));
168 }
169
170 struct vop_mkcomplex_args {
171 struct vnodeop_desc *a_desc;
172 struct vnode *a_dvp;
173 struct vnode **a_vpp;
174 struct componentname *a_cnp;
175 struct vattr *a_vap;
176 u_long a_type;
177 };
178 extern struct vnodeop_desc vop_mkcomplex_desc;
179 #define VOP_MKCOMPLEX(dvp, vpp, cnp, vap, type) _VOP_MKCOMPLEX(dvp, vpp, cnp, vap, type)
180 static __inline int _VOP_MKCOMPLEX(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap, u_long type)
181 {
182 struct vop_mkcomplex_args a;
183 a.a_desc = VDESC(vop_mkcomplex);
184 a.a_dvp = dvp;
185 a.a_vpp = vpp;
186 a.a_cnp = cnp;
187 a.a_vap = vap;
188 a.a_type = type;
189 return (VCALL(dvp, VOFFSET(vop_mkcomplex), &a));
190 }
191
192 struct vop_open_args {
193 struct vnodeop_desc *a_desc;
194 struct vnode *a_vp;
195 int a_mode;
196 struct ucred *a_cred;
197 struct proc *a_p;
198 };
199 extern struct vnodeop_desc vop_open_desc;
200 #define VOP_OPEN(vp, mode, cred, p) _VOP_OPEN(vp, mode, cred, p)
201 static __inline int _VOP_OPEN(struct vnode *vp, int mode, struct ucred *cred, struct proc *p)
202 {
203 struct vop_open_args a;
204 a.a_desc = VDESC(vop_open);
205 a.a_vp = vp;
206 a.a_mode = mode;
207 a.a_cred = cred;
208 a.a_p = p;
209 return (VCALL(vp, VOFFSET(vop_open), &a));
210 }
211
212 struct vop_close_args {
213 struct vnodeop_desc *a_desc;
214 struct vnode *a_vp;
215 int a_fflag;
216 struct ucred *a_cred;
217 struct proc *a_p;
218 };
219 extern struct vnodeop_desc vop_close_desc;
220 #define VOP_CLOSE(vp, fflag, cred, p) _VOP_CLOSE(vp, fflag, cred, p)
221 static __inline int _VOP_CLOSE(struct vnode *vp, int fflag, struct ucred *cred, struct proc *p)
222 {
223 struct vop_close_args a;
224 a.a_desc = VDESC(vop_close);
225 a.a_vp = vp;
226 a.a_fflag = fflag;
227 a.a_cred = cred;
228 a.a_p = p;
229 return (VCALL(vp, VOFFSET(vop_close), &a));
230 }
231
232 struct vop_access_args {
233 struct vnodeop_desc *a_desc;
234 struct vnode *a_vp;
235 int a_mode;
236 struct ucred *a_cred;
237 struct proc *a_p;
238 };
239 extern struct vnodeop_desc vop_access_desc;
240 #define VOP_ACCESS(vp, mode, cred, p) _VOP_ACCESS(vp, mode, cred, p)
241 static __inline int _VOP_ACCESS(struct vnode *vp, int mode, struct ucred *cred, struct proc *p)
242 {
243 struct vop_access_args a;
244 a.a_desc = VDESC(vop_access);
245 a.a_vp = vp;
246 a.a_mode = mode;
247 a.a_cred = cred;
248 a.a_p = p;
249 return (VCALL(vp, VOFFSET(vop_access), &a));
250 }
251
252 struct vop_getattr_args {
253 struct vnodeop_desc *a_desc;
254 struct vnode *a_vp;
255 struct vattr *a_vap;
256 struct ucred *a_cred;
257 struct proc *a_p;
258 };
259 extern struct vnodeop_desc vop_getattr_desc;
260 #define VOP_GETATTR(vp, vap, cred, p) _VOP_GETATTR(vp, vap, cred, p)
261 static __inline int _VOP_GETATTR(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct proc *p)
262 {
263 struct vop_getattr_args a;
264 a.a_desc = VDESC(vop_getattr);
265 a.a_vp = vp;
266 a.a_vap = vap;
267 a.a_cred = cred;
268 a.a_p = p;
269 return (VCALL(vp, VOFFSET(vop_getattr), &a));
270 }
271
272 struct vop_setattr_args {
273 struct vnodeop_desc *a_desc;
274 struct vnode *a_vp;
275 struct vattr *a_vap;
276 struct ucred *a_cred;
277 struct proc *a_p;
278 };
279 extern struct vnodeop_desc vop_setattr_desc;
280 #define VOP_SETATTR(vp, vap, cred, p) _VOP_SETATTR(vp, vap, cred, p)
281 static __inline int _VOP_SETATTR(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct proc *p)
282 {
283 struct vop_setattr_args a;
284 a.a_desc = VDESC(vop_setattr);
285 a.a_vp = vp;
286 a.a_vap = vap;
287 a.a_cred = cred;
288 a.a_p = p;
289 return (VCALL(vp, VOFFSET(vop_setattr), &a));
290 }
291
292 struct vop_getattrlist_args {
293 struct vnodeop_desc *a_desc;
294 struct vnode *a_vp;
295 struct attrlist *a_alist;
296 struct uio *a_uio;
297 struct ucred *a_cred;
298 struct proc *a_p;
299 };
300 extern struct vnodeop_desc vop_getattrlist_desc;
301 #define VOP_GETATTRLIST(vp, alist, uio, cred, p) _VOP_GETATTRLIST(vp, alist, uio, cred, p)
302 static __inline int _VOP_GETATTRLIST(struct vnode *vp, struct attrlist *alist, struct uio *uio, struct ucred *cred, struct proc *p)
303 {
304 struct vop_getattrlist_args a;
305 a.a_desc = VDESC(vop_getattrlist);
306 a.a_vp = vp;
307 a.a_alist = alist;
308 a.a_uio = uio;
309 a.a_cred = cred;
310 a.a_p = p;
311 return (VCALL(vp, VOFFSET(vop_getattrlist), &a));
312 }
313
314 struct vop_setattrlist_args {
315 struct vnodeop_desc *a_desc;
316 struct vnode *a_vp;
317 struct attrlist *a_alist;
318 struct uio *a_uio;
319 struct ucred *a_cred;
320 struct proc *a_p;
321 };
322 extern struct vnodeop_desc vop_setattrlist_desc;
323 #define VOP_SETATTRLIST(vp, alist, uio, cred, p) _VOP_SETATTRLIST(vp, alist, uio, cred, p)
324 static __inline int _VOP_SETATTRLIST(struct vnode *vp, struct attrlist *alist, struct uio *uio, struct ucred *cred, struct proc *p)
325 {
326 struct vop_setattrlist_args a;
327 a.a_desc = VDESC(vop_setattrlist);
328 a.a_vp = vp;
329 a.a_alist = alist;
330 a.a_uio = uio;
331 a.a_cred = cred;
332 a.a_p = p;
333 return (VCALL(vp, VOFFSET(vop_setattrlist), &a));
334 }
335
336 struct vop_read_args {
337 struct vnodeop_desc *a_desc;
338 struct vnode *a_vp;
339 struct uio *a_uio;
340 int a_ioflag;
341 struct ucred *a_cred;
342 };
343 extern struct vnodeop_desc vop_read_desc;
344 #define VOP_READ(vp, uio, ioflag, cred) _VOP_READ(vp, uio, ioflag, cred)
345 static __inline int _VOP_READ(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
346 {
347 struct vop_read_args a;
348 a.a_desc = VDESC(vop_read);
349 a.a_vp = vp;
350 a.a_uio = uio;
351 a.a_ioflag = ioflag;
352 a.a_cred = cred;
353 {
354 int _err;
355 extern int ubc_hold(struct vnode *vp);
356 extern void ubc_rele(struct vnode *vp);
357 int _didhold = ubc_hold(vp);
358 _err = VCALL(vp, VOFFSET(vop_read), &a);
359 if (_didhold)
360 ubc_rele(vp);
361 return (_err);
362 }
363 }
364
365 struct vop_write_args {
366 struct vnodeop_desc *a_desc;
367 struct vnode *a_vp;
368 struct uio *a_uio;
369 int a_ioflag;
370 struct ucred *a_cred;
371 };
372 extern struct vnodeop_desc vop_write_desc;
373 #define VOP_WRITE(vp, uio, ioflag, cred) _VOP_WRITE(vp, uio, ioflag, cred)
374 static __inline int _VOP_WRITE(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
375 {
376 struct vop_write_args a;
377 a.a_desc = VDESC(vop_write);
378 a.a_vp = vp;
379 a.a_uio = uio;
380 a.a_ioflag = ioflag;
381 a.a_cred = cred;
382 {
383 int _err;
384 extern int ubc_hold(struct vnode *vp);
385 extern void ubc_rele(struct vnode *vp);
386 int _didhold = ubc_hold(vp);
387 _err = VCALL(vp, VOFFSET(vop_write), &a);
388 if (_didhold)
389 ubc_rele(vp);
390 return (_err);
391 }
392 }
393
394 struct vop_lease_args {
395 struct vnodeop_desc *a_desc;
396 struct vnode *a_vp;
397 struct proc *a_p;
398 struct ucred *a_cred;
399 int a_flag;
400 };
401 extern struct vnodeop_desc vop_lease_desc;
402 #define VOP_LEASE(vp, p, cred, flag) _VOP_LEASE(vp, p, cred, flag)
403 static __inline int _VOP_LEASE(struct vnode *vp, struct proc *p, struct ucred *cred, int flag)
404 {
405 struct vop_lease_args a;
406 a.a_desc = VDESC(vop_lease);
407 a.a_vp = vp;
408 a.a_p = p;
409 a.a_cred = cred;
410 a.a_flag = flag;
411 return (VCALL(vp, VOFFSET(vop_lease), &a));
412 }
413
414 struct vop_ioctl_args {
415 struct vnodeop_desc *a_desc;
416 struct vnode *a_vp;
417 u_long a_command;
418 caddr_t a_data;
419 int a_fflag;
420 struct ucred *a_cred;
421 struct proc *a_p;
422 };
423 extern struct vnodeop_desc vop_ioctl_desc;
424 #define VOP_IOCTL(vp, command, data, fflag, cred, p) _VOP_IOCTL(vp, command, data, fflag, cred, p)
425 static __inline int _VOP_IOCTL(struct vnode *vp, u_long command, caddr_t data, int fflag, struct ucred *cred, struct proc *p)
426 {
427 struct vop_ioctl_args a;
428 a.a_desc = VDESC(vop_ioctl);
429 a.a_vp = vp;
430 a.a_command = command;
431 a.a_data = data;
432 a.a_fflag = fflag;
433 a.a_cred = cred;
434 a.a_p = p;
435 return (VCALL(vp, VOFFSET(vop_ioctl), &a));
436 }
437
438 struct vop_select_args {
439 struct vnodeop_desc *a_desc;
440 struct vnode *a_vp;
441 int a_which;
442 int a_fflags;
443 struct ucred *a_cred;
444 void *a_wql;
445 struct proc *a_p;
446 };
447 extern struct vnodeop_desc vop_select_desc;
448 #define VOP_SELECT(vp, which, fflags, cred, wql, p) _VOP_SELECT(vp, which, fflags, cred, wql, p)
449 static __inline int _VOP_SELECT(struct vnode *vp, int which, int fflags, struct ucred *cred, void *wql, struct proc *p)
450 {
451 struct vop_select_args a;
452 a.a_desc = VDESC(vop_select);
453 a.a_vp = vp;
454 a.a_which = which;
455 a.a_fflags = fflags;
456 a.a_cred = cred;
457 a.a_wql = wql;
458 a.a_p = p;
459 return (VCALL(vp, VOFFSET(vop_select), &a));
460 }
461
462 struct vop_exchange_args {
463 struct vnodeop_desc *a_desc;
464 struct vnode *a_fvp;
465 struct vnode *a_tvp;
466 struct ucred *a_cred;
467 struct proc *a_p;
468 };
469 extern struct vnodeop_desc vop_exchange_desc;
470 #define VOP_EXCHANGE(fvp, tvp, cred, p) _VOP_EXCHANGE(fvp, tvp, cred, p)
471 static __inline int _VOP_EXCHANGE(struct vnode *fvp, struct vnode *tvp, struct ucred *cred, struct proc *p)
472 {
473 struct vop_exchange_args a;
474 a.a_desc = VDESC(vop_exchange);
475 a.a_fvp = fvp;
476 a.a_tvp = tvp;
477 a.a_cred = cred;
478 a.a_p = p;
479 return (VCALL(fvp, VOFFSET(vop_exchange), &a));
480 }
481
482 struct vop_kqfilt_add_args {
483 struct vnodeop_desc *a_desc;
484 struct vnode *a_vp;
485 struct knote *a_kn;
486 struct proc *a_p;
487 };
488 extern struct vnodeop_desc vop_kqfilt_add_desc;
489 #define VOP_KQFILT_ADD(vp, kn, p) _VOP_KQFILT_ADD(vp, kn, p)
490 static __inline int _VOP_KQFILT_ADD(struct vnode *vp, struct knote *kn, struct proc *p)
491 {
492 struct vop_kqfilt_add_args a;
493 a.a_desc = VDESC(vop_kqfilt_add);
494 a.a_vp = vp;
495 a.a_kn = kn;
496 a.a_p = p;
497 return (VCALL(vp, VOFFSET(vop_kqfilt_add), &a));
498 }
499
500 struct vop_kqfilt_remove_args {
501 struct vnodeop_desc *a_desc;
502 struct vnode *a_vp;
503 uintptr_t a_ident;
504 struct proc *a_p;
505 };
506 extern struct vnodeop_desc vop_kqfilt_remove_desc;
507 #define VOP_KQFILT_REMOVE(vp, ident, p) _VOP_KQFILT_REMOVE(vp, ident, p)
508 static __inline int _VOP_KQFILT_REMOVE(struct vnode *vp, uintptr_t ident, struct proc *p)
509 {
510 struct vop_kqfilt_remove_args a;
511 a.a_desc = VDESC(vop_kqfilt_remove);
512 a.a_vp = vp;
513 a.a_ident = ident;
514 a.a_p = p;
515 return (VCALL(vp, VOFFSET(vop_kqfilt_remove), &a));
516 }
517
518 struct vop_revoke_args {
519 struct vnodeop_desc *a_desc;
520 struct vnode *a_vp;
521 int a_flags;
522 };
523 extern struct vnodeop_desc vop_revoke_desc;
524 #define VOP_REVOKE(vp, flags) _VOP_REVOKE(vp, flags)
525 static __inline int _VOP_REVOKE(struct vnode *vp, int flags)
526 {
527 struct vop_revoke_args a;
528 a.a_desc = VDESC(vop_revoke);
529 a.a_vp = vp;
530 a.a_flags = flags;
531 return (VCALL(vp, VOFFSET(vop_revoke), &a));
532 }
533
534 struct vop_mmap_args {
535 struct vnodeop_desc *a_desc;
536 struct vnode *a_vp;
537 int a_fflags;
538 struct ucred *a_cred;
539 struct proc *a_p;
540 };
541 extern struct vnodeop_desc vop_mmap_desc;
542 #define VOP_MMAP(vp, fflags, cred, p) _VOP_MMAP(vp, fflags, cred, p)
543 static __inline int _VOP_MMAP(struct vnode *vp, int fflags, struct ucred *cred, struct proc *p)
544 {
545 struct vop_mmap_args a;
546 a.a_desc = VDESC(vop_mmap);
547 a.a_vp = vp;
548 a.a_fflags = fflags;
549 a.a_cred = cred;
550 a.a_p = p;
551 return (VCALL(vp, VOFFSET(vop_mmap), &a));
552 }
553
554 struct vop_fsync_args {
555 struct vnodeop_desc *a_desc;
556 struct vnode *a_vp;
557 struct ucred *a_cred;
558 int a_waitfor;
559 struct proc *a_p;
560 };
561 extern struct vnodeop_desc vop_fsync_desc;
562 #define VOP_FSYNC(vp, cred, waitfor, p) _VOP_FSYNC(vp, cred, waitfor, p)
563 static __inline int _VOP_FSYNC(struct vnode *vp, struct ucred *cred, int waitfor, struct proc *p)
564 {
565 struct vop_fsync_args a;
566 a.a_desc = VDESC(vop_fsync);
567 a.a_vp = vp;
568 a.a_cred = cred;
569 a.a_waitfor = waitfor;
570 a.a_p = p;
571 {
572 int _err;
573 extern int ubc_hold(struct vnode *vp);
574 extern void ubc_rele(struct vnode *vp);
575 int _didhold = ubc_hold(vp);
576 _err = VCALL(vp, VOFFSET(vop_fsync), &a);
577 if (_didhold)
578 ubc_rele(vp);
579 return (_err);
580 }
581 }
582
583 struct vop_seek_args {
584 struct vnodeop_desc *a_desc;
585 struct vnode *a_vp;
586 off_t a_oldoff;
587 off_t a_newoff;
588 struct ucred *a_cred;
589 };
590 extern struct vnodeop_desc vop_seek_desc;
591 #define VOP_SEEK(vp, oldoff, newoff, cred) _VOP_SEEK(vp, oldoff, newoff, cred)
592 static __inline int _VOP_SEEK(struct vnode *vp, off_t oldoff, off_t newoff, struct ucred *cred)
593 {
594 struct vop_seek_args a;
595 a.a_desc = VDESC(vop_seek);
596 a.a_vp = vp;
597 a.a_oldoff = oldoff;
598 a.a_newoff = newoff;
599 a.a_cred = cred;
600 return (VCALL(vp, VOFFSET(vop_seek), &a));
601 }
602
603 struct vop_remove_args {
604 struct vnodeop_desc *a_desc;
605 struct vnode *a_dvp;
606 struct vnode *a_vp;
607 struct componentname *a_cnp;
608 };
609 extern struct vnodeop_desc vop_remove_desc;
610 #define VOP_REMOVE(dvp, vp, cnp) _VOP_REMOVE(dvp, vp, cnp)
611 static __inline int _VOP_REMOVE(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
612 {
613 struct vop_remove_args a;
614 a.a_desc = VDESC(vop_remove);
615 a.a_dvp = dvp;
616 a.a_vp = vp;
617 a.a_cnp = cnp;
618 return (VCALL(dvp, VOFFSET(vop_remove), &a));
619 }
620
621 struct vop_link_args {
622 struct vnodeop_desc *a_desc;
623 struct vnode *a_vp;
624 struct vnode *a_tdvp;
625 struct componentname *a_cnp;
626 };
627 extern struct vnodeop_desc vop_link_desc;
628 #define VOP_LINK(vp, tdvp, cnp) _VOP_LINK(vp, tdvp, cnp)
629 static __inline int _VOP_LINK(struct vnode *vp, struct vnode *tdvp, struct componentname *cnp)
630 {
631 struct vop_link_args a;
632 a.a_desc = VDESC(vop_link);
633 a.a_vp = vp;
634 a.a_tdvp = tdvp;
635 a.a_cnp = cnp;
636 return (VCALL(vp, VOFFSET(vop_link), &a));
637 }
638
639 struct vop_rename_args {
640 struct vnodeop_desc *a_desc;
641 struct vnode *a_fdvp;
642 struct vnode *a_fvp;
643 struct componentname *a_fcnp;
644 struct vnode *a_tdvp;
645 struct vnode *a_tvp;
646 struct componentname *a_tcnp;
647 };
648 extern struct vnodeop_desc vop_rename_desc;
649 #define VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp) _VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp)
650 static __inline int _VOP_RENAME(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp)
651 {
652 struct vop_rename_args a;
653 a.a_desc = VDESC(vop_rename);
654 a.a_fdvp = fdvp;
655 a.a_fvp = fvp;
656 a.a_fcnp = fcnp;
657 a.a_tdvp = tdvp;
658 a.a_tvp = tvp;
659 a.a_tcnp = tcnp;
660 return (VCALL(fdvp, VOFFSET(vop_rename), &a));
661 }
662
663 struct vop_mkdir_args {
664 struct vnodeop_desc *a_desc;
665 struct vnode *a_dvp;
666 struct vnode **a_vpp;
667 struct componentname *a_cnp;
668 struct vattr *a_vap;
669 };
670 extern struct vnodeop_desc vop_mkdir_desc;
671 #define VOP_MKDIR(dvp, vpp, cnp, vap) _VOP_MKDIR(dvp, vpp, cnp, vap)
672 static __inline int _VOP_MKDIR(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
673 {
674 struct vop_mkdir_args a;
675 a.a_desc = VDESC(vop_mkdir);
676 a.a_dvp = dvp;
677 a.a_vpp = vpp;
678 a.a_cnp = cnp;
679 a.a_vap = vap;
680 return (VCALL(dvp, VOFFSET(vop_mkdir), &a));
681 }
682
683 struct vop_rmdir_args {
684 struct vnodeop_desc *a_desc;
685 struct vnode *a_dvp;
686 struct vnode *a_vp;
687 struct componentname *a_cnp;
688 };
689 extern struct vnodeop_desc vop_rmdir_desc;
690 #define VOP_RMDIR(dvp, vp, cnp) _VOP_RMDIR(dvp, vp, cnp)
691 static __inline int _VOP_RMDIR(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
692 {
693 struct vop_rmdir_args a;
694 a.a_desc = VDESC(vop_rmdir);
695 a.a_dvp = dvp;
696 a.a_vp = vp;
697 a.a_cnp = cnp;
698 return (VCALL(dvp, VOFFSET(vop_rmdir), &a));
699 }
700
701 struct vop_symlink_args {
702 struct vnodeop_desc *a_desc;
703 struct vnode *a_dvp;
704 struct vnode **a_vpp;
705 struct componentname *a_cnp;
706 struct vattr *a_vap;
707 char *a_target;
708 };
709 extern struct vnodeop_desc vop_symlink_desc;
710 #define VOP_SYMLINK(dvp, vpp, cnp, vap, target) _VOP_SYMLINK(dvp, vpp, cnp, vap, target)
711 static __inline int _VOP_SYMLINK(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap, char *target)
712 {
713 struct vop_symlink_args a;
714 a.a_desc = VDESC(vop_symlink);
715 a.a_dvp = dvp;
716 a.a_vpp = vpp;
717 a.a_cnp = cnp;
718 a.a_vap = vap;
719 a.a_target = target;
720 return (VCALL(dvp, VOFFSET(vop_symlink), &a));
721 }
722
723 struct vop_readdir_args {
724 struct vnodeop_desc *a_desc;
725 struct vnode *a_vp;
726 struct uio *a_uio;
727 struct ucred *a_cred;
728 int *a_eofflag;
729 int *a_ncookies;
730 u_long **a_cookies;
731 };
732 extern struct vnodeop_desc vop_readdir_desc;
733 #define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) _VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies)
734 static __inline int _VOP_READDIR(struct vnode *vp, struct uio *uio, struct ucred *cred, int *eofflag, int *ncookies, u_long **cookies)
735 {
736 struct vop_readdir_args a;
737 a.a_desc = VDESC(vop_readdir);
738 a.a_vp = vp;
739 a.a_uio = uio;
740 a.a_cred = cred;
741 a.a_eofflag = eofflag;
742 a.a_ncookies = ncookies;
743 a.a_cookies = cookies;
744 return (VCALL(vp, VOFFSET(vop_readdir), &a));
745 }
746
747 struct vop_readdirattr_args {
748 struct vnodeop_desc *a_desc;
749 struct vnode *a_vp;
750 struct attrlist *a_alist;
751 struct uio *a_uio;
752 u_long a_maxcount;
753 u_long a_options;
754 u_long *a_newstate;
755 int *a_eofflag;
756 u_long *a_actualcount;
757 u_long **a_cookies;
758 struct ucred *a_cred;
759 };
760 extern struct vnodeop_desc vop_readdirattr_desc;
761 #define VOP_READDIRATTR(vp, alist, uio, maxcount, options, newstate, eofflag, actualcount, cookies, cred) _VOP_READDIRATTR(vp, alist, uio, maxcount, options, newstate, eofflag, actualcount, cookies, cred)
762 static __inline int _VOP_READDIRATTR(struct vnode *vp, struct attrlist *alist, struct uio *uio, u_long maxcount, u_long options, u_long *newstate, int *eofflag, u_long *actualcount, u_long **cookies, struct ucred *cred)
763 {
764 struct vop_readdirattr_args a;
765 a.a_desc = VDESC(vop_readdirattr);
766 a.a_vp = vp;
767 a.a_alist = alist;
768 a.a_uio = uio;
769 a.a_maxcount = maxcount;
770 a.a_options = options;
771 a.a_newstate = newstate;
772 a.a_eofflag = eofflag;
773 a.a_actualcount = actualcount;
774 a.a_cookies = cookies;
775 a.a_cred = cred;
776 return (VCALL(vp, VOFFSET(vop_readdirattr), &a));
777 }
778
779 struct vop_readlink_args {
780 struct vnodeop_desc *a_desc;
781 struct vnode *a_vp;
782 struct uio *a_uio;
783 struct ucred *a_cred;
784 };
785 extern struct vnodeop_desc vop_readlink_desc;
786 #define VOP_READLINK(vp, uio, cred) _VOP_READLINK(vp, uio, cred)
787 static __inline int _VOP_READLINK(struct vnode *vp, struct uio *uio, struct ucred *cred)
788 {
789 struct vop_readlink_args a;
790 a.a_desc = VDESC(vop_readlink);
791 a.a_vp = vp;
792 a.a_uio = uio;
793 a.a_cred = cred;
794 return (VCALL(vp, VOFFSET(vop_readlink), &a));
795 }
796
797 struct vop_abortop_args {
798 struct vnodeop_desc *a_desc;
799 struct vnode *a_dvp;
800 struct componentname *a_cnp;
801 };
802 extern struct vnodeop_desc vop_abortop_desc;
803 #define VOP_ABORTOP(dvp, cnp) _VOP_ABORTOP(dvp, cnp)
804 static __inline int _VOP_ABORTOP(struct vnode *dvp, struct componentname *cnp)
805 {
806 struct vop_abortop_args a;
807 a.a_desc = VDESC(vop_abortop);
808 a.a_dvp = dvp;
809 a.a_cnp = cnp;
810 return (VCALL(dvp, VOFFSET(vop_abortop), &a));
811 }
812
813 struct vop_inactive_args {
814 struct vnodeop_desc *a_desc;
815 struct vnode *a_vp;
816 struct proc *a_p;
817 };
818 extern struct vnodeop_desc vop_inactive_desc;
819 #define VOP_INACTIVE(vp, p) _VOP_INACTIVE(vp, p)
820 static __inline int _VOP_INACTIVE(struct vnode *vp, struct proc *p)
821 {
822 struct vop_inactive_args a;
823 a.a_desc = VDESC(vop_inactive);
824 a.a_vp = vp;
825 a.a_p = p;
826 return (VCALL(vp, VOFFSET(vop_inactive), &a));
827 }
828
829 struct vop_reclaim_args {
830 struct vnodeop_desc *a_desc;
831 struct vnode *a_vp;
832 struct proc *a_p;
833 };
834 extern struct vnodeop_desc vop_reclaim_desc;
835 #define VOP_RECLAIM(vp, p) _VOP_RECLAIM(vp, p)
836 static __inline int _VOP_RECLAIM(struct vnode *vp, struct proc *p)
837 {
838 struct vop_reclaim_args a;
839 a.a_desc = VDESC(vop_reclaim);
840 a.a_vp = vp;
841 a.a_p = p;
842 return (VCALL(vp, VOFFSET(vop_reclaim), &a));
843 }
844
845 struct vop_lock_args {
846 struct vnodeop_desc *a_desc;
847 struct vnode *a_vp;
848 int a_flags;
849 struct proc *a_p;
850 };
851 extern struct vnodeop_desc vop_lock_desc;
852 #define VOP_LOCK(vp, flags, p) _VOP_LOCK(vp, flags, p)
853 static __inline int _VOP_LOCK(struct vnode *vp, int flags, struct proc *p)
854 {
855 struct vop_lock_args a;
856 a.a_desc = VDESC(vop_lock);
857 a.a_vp = vp;
858 a.a_flags = flags;
859 a.a_p = p;
860 return (VCALL(vp, VOFFSET(vop_lock), &a));
861 }
862
863 struct vop_unlock_args {
864 struct vnodeop_desc *a_desc;
865 struct vnode *a_vp;
866 int a_flags;
867 struct proc *a_p;
868 };
869 extern struct vnodeop_desc vop_unlock_desc;
870 #define VOP_UNLOCK(vp, flags, p) _VOP_UNLOCK(vp, flags, p)
871 static __inline int _VOP_UNLOCK(struct vnode *vp, int flags, struct proc *p)
872 {
873 struct vop_unlock_args a;
874 a.a_desc = VDESC(vop_unlock);
875 a.a_vp = vp;
876 a.a_flags = flags;
877 a.a_p = p;
878 return (VCALL(vp, VOFFSET(vop_unlock), &a));
879 }
880
881 struct vop_bmap_args {
882 struct vnodeop_desc *a_desc;
883 struct vnode *a_vp;
884 daddr_t a_bn;
885 struct vnode **a_vpp;
886 daddr_t *a_bnp;
887 int *a_runp;
888 };
889 extern struct vnodeop_desc vop_bmap_desc;
890 #define VOP_BMAP(vp, bn, vpp, bnp, runp) _VOP_BMAP(vp, bn, vpp, bnp, runp)
891 static __inline int _VOP_BMAP(struct vnode *vp, daddr_t bn, struct vnode **vpp, daddr_t *bnp, int *runp)
892 {
893 struct vop_bmap_args a;
894 a.a_desc = VDESC(vop_bmap);
895 a.a_vp = vp;
896 a.a_bn = bn;
897 a.a_vpp = vpp;
898 a.a_bnp = bnp;
899 a.a_runp = runp;
900 return (VCALL(vp, VOFFSET(vop_bmap), &a));
901 }
902
903 struct vop_print_args {
904 struct vnodeop_desc *a_desc;
905 struct vnode *a_vp;
906 };
907 extern struct vnodeop_desc vop_print_desc;
908 #define VOP_PRINT(vp) _VOP_PRINT(vp)
909 static __inline int _VOP_PRINT(struct vnode *vp)
910 {
911 struct vop_print_args a;
912 a.a_desc = VDESC(vop_print);
913 a.a_vp = vp;
914 return (VCALL(vp, VOFFSET(vop_print), &a));
915 }
916
917 struct vop_islocked_args {
918 struct vnodeop_desc *a_desc;
919 struct vnode *a_vp;
920 };
921 extern struct vnodeop_desc vop_islocked_desc;
922 #define VOP_ISLOCKED(vp) _VOP_ISLOCKED(vp)
923 static __inline int _VOP_ISLOCKED(struct vnode *vp)
924 {
925 struct vop_islocked_args a;
926 a.a_desc = VDESC(vop_islocked);
927 a.a_vp = vp;
928 return (VCALL(vp, VOFFSET(vop_islocked), &a));
929 }
930
931 struct vop_pathconf_args {
932 struct vnodeop_desc *a_desc;
933 struct vnode *a_vp;
934 int a_name;
935 register_t *a_retval;
936 };
937 extern struct vnodeop_desc vop_pathconf_desc;
938 #define VOP_PATHCONF(vp, name, retval) _VOP_PATHCONF(vp, name, retval)
939 static __inline int _VOP_PATHCONF(struct vnode *vp, int name, register_t *retval)
940 {
941 struct vop_pathconf_args a;
942 a.a_desc = VDESC(vop_pathconf);
943 a.a_vp = vp;
944 a.a_name = name;
945 a.a_retval = retval;
946 return (VCALL(vp, VOFFSET(vop_pathconf), &a));
947 }
948
949 struct vop_advlock_args {
950 struct vnodeop_desc *a_desc;
951 struct vnode *a_vp;
952 caddr_t a_id;
953 int a_op;
954 struct flock *a_fl;
955 int a_flags;
956 };
957 extern struct vnodeop_desc vop_advlock_desc;
958 #define VOP_ADVLOCK(vp, id, op, fl, flags) _VOP_ADVLOCK(vp, id, op, fl, flags)
959 static __inline int _VOP_ADVLOCK(struct vnode *vp, caddr_t id, int op, struct flock *fl, int flags)
960 {
961 struct vop_advlock_args a;
962 a.a_desc = VDESC(vop_advlock);
963 a.a_vp = vp;
964 a.a_id = id;
965 a.a_op = op;
966 a.a_fl = fl;
967 a.a_flags = flags;
968 return (VCALL(vp, VOFFSET(vop_advlock), &a));
969 }
970
971 struct vop_blkatoff_args {
972 struct vnodeop_desc *a_desc;
973 struct vnode *a_vp;
974 off_t a_offset;
975 char **a_res;
976 struct buf **a_bpp;
977 };
978 extern struct vnodeop_desc vop_blkatoff_desc;
979 #define VOP_BLKATOFF(vp, offset, res, bpp) _VOP_BLKATOFF(vp, offset, res, bpp)
980 static __inline int _VOP_BLKATOFF(struct vnode *vp, off_t offset, char **res, struct buf **bpp)
981 {
982 struct vop_blkatoff_args a;
983 a.a_desc = VDESC(vop_blkatoff);
984 a.a_vp = vp;
985 a.a_offset = offset;
986 a.a_res = res;
987 a.a_bpp = bpp;
988 return (VCALL(vp, VOFFSET(vop_blkatoff), &a));
989 }
990
991 struct vop_valloc_args {
992 struct vnodeop_desc *a_desc;
993 struct vnode *a_pvp;
994 int a_mode;
995 struct ucred *a_cred;
996 struct vnode **a_vpp;
997 };
998 extern struct vnodeop_desc vop_valloc_desc;
999 #define VOP_VALLOC(pvp, mode, cred, vpp) _VOP_VALLOC(pvp, mode, cred, vpp)
1000 static __inline int _VOP_VALLOC(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp)
1001 {
1002 struct vop_valloc_args a;
1003 a.a_desc = VDESC(vop_valloc);
1004 a.a_pvp = pvp;
1005 a.a_mode = mode;
1006 a.a_cred = cred;
1007 a.a_vpp = vpp;
1008 return (VCALL(pvp, VOFFSET(vop_valloc), &a));
1009 }
1010
1011 struct vop_reallocblks_args {
1012 struct vnodeop_desc *a_desc;
1013 struct vnode *a_vp;
1014 struct cluster_save *a_buflist;
1015 };
1016 extern struct vnodeop_desc vop_reallocblks_desc;
1017 #define VOP_REALLOCBLKS(vp, buflist) _VOP_REALLOCBLKS(vp, buflist)
1018 static __inline int _VOP_REALLOCBLKS(struct vnode *vp, struct cluster_save *buflist)
1019 {
1020 struct vop_reallocblks_args a;
1021 a.a_desc = VDESC(vop_reallocblks);
1022 a.a_vp = vp;
1023 a.a_buflist = buflist;
1024 return (VCALL(vp, VOFFSET(vop_reallocblks), &a));
1025 }
1026
1027 struct vop_vfree_args {
1028 struct vnodeop_desc *a_desc;
1029 struct vnode *a_pvp;
1030 ino_t a_ino;
1031 int a_mode;
1032 };
1033 extern struct vnodeop_desc vop_vfree_desc;
1034 #define VOP_VFREE(pvp, ino, mode) _VOP_VFREE(pvp, ino, mode)
1035 static __inline int _VOP_VFREE(struct vnode *pvp, ino_t ino, int mode)
1036 {
1037 struct vop_vfree_args a;
1038 a.a_desc = VDESC(vop_vfree);
1039 a.a_pvp = pvp;
1040 a.a_ino = ino;
1041 a.a_mode = mode;
1042 return (VCALL(pvp, VOFFSET(vop_vfree), &a));
1043 }
1044
1045 struct vop_truncate_args {
1046 struct vnodeop_desc *a_desc;
1047 struct vnode *a_vp;
1048 off_t a_length;
1049 int a_flags;
1050 struct ucred *a_cred;
1051 struct proc *a_p;
1052 };
1053 extern struct vnodeop_desc vop_truncate_desc;
1054 #define VOP_TRUNCATE(vp, length, flags, cred, p) _VOP_TRUNCATE(vp, length, flags, cred, p)
1055 static __inline int _VOP_TRUNCATE(struct vnode *vp, off_t length, int flags, struct ucred *cred, struct proc *p)
1056 {
1057 struct vop_truncate_args a;
1058 a.a_desc = VDESC(vop_truncate);
1059 a.a_vp = vp;
1060 a.a_length = length;
1061 a.a_flags = flags;
1062 a.a_cred = cred;
1063 a.a_p = p;
1064 {
1065 int _err;
1066 extern int ubc_hold(struct vnode *vp);
1067 extern void ubc_rele(struct vnode *vp);
1068 int _didhold = ubc_hold(vp);
1069 _err = VCALL(vp, VOFFSET(vop_truncate), &a);
1070 if (_didhold)
1071 ubc_rele(vp);
1072 return (_err);
1073 }
1074 }
1075
1076 struct vop_allocate_args {
1077 struct vnodeop_desc *a_desc;
1078 struct vnode *a_vp;
1079 off_t a_length;
1080 u_int32_t a_flags;
1081 off_t *a_bytesallocated;
1082 off_t a_offset;
1083 struct ucred *a_cred;
1084 struct proc *a_p;
1085 };
1086 extern struct vnodeop_desc vop_allocate_desc;
1087 #define VOP_ALLOCATE(vp, length, flags, bytesallocated, offset, cred, p) _VOP_ALLOCATE(vp, length, flags, bytesallocated, offset, cred, p)
1088 static __inline int _VOP_ALLOCATE(struct vnode *vp, off_t length, u_int32_t flags, off_t *bytesallocated, off_t offset, struct ucred *cred, struct proc *p)
1089 {
1090 struct vop_allocate_args a;
1091 a.a_desc = VDESC(vop_allocate);
1092 a.a_vp = vp;
1093 a.a_length = length;
1094 a.a_flags = flags;
1095 a.a_bytesallocated = bytesallocated;
1096 a.a_offset = offset;
1097 a.a_cred = cred;
1098 a.a_p = p;
1099 return (VCALL(vp, VOFFSET(vop_allocate), &a));
1100 }
1101
1102 struct vop_update_args {
1103 struct vnodeop_desc *a_desc;
1104 struct vnode *a_vp;
1105 struct timeval *a_access;
1106 struct timeval *a_modify;
1107 int a_waitfor;
1108 };
1109 extern struct vnodeop_desc vop_update_desc;
1110 #define VOP_UPDATE(vp, access, modify, waitfor) _VOP_UPDATE(vp, access, modify, waitfor)
1111 static __inline int _VOP_UPDATE(struct vnode *vp, struct timeval *access, struct timeval *modify, int waitfor)
1112 {
1113 struct vop_update_args a;
1114 a.a_desc = VDESC(vop_update);
1115 a.a_vp = vp;
1116 a.a_access = access;
1117 a.a_modify = modify;
1118 a.a_waitfor = waitfor;
1119 return (VCALL(vp, VOFFSET(vop_update), &a));
1120 }
1121
1122 struct vop_pgrd_args {
1123 struct vnodeop_desc *a_desc;
1124 struct vnode *a_vp;
1125 struct uio *a_uio;
1126 struct ucred *a_cred;
1127 };
1128 extern struct vnodeop_desc vop_pgrd_desc;
1129 #define VOP_PGRD(vp, uio, cred) _VOP_PGRD(vp, uio, cred)
1130 static __inline int _VOP_PGRD(struct vnode *vp, struct uio *uio, struct ucred *cred)
1131 {
1132 struct vop_pgrd_args a;
1133 a.a_desc = VDESC(vop_pgrd);
1134 a.a_vp = vp;
1135 a.a_uio = uio;
1136 a.a_cred = cred;
1137 return (VCALL(vp, VOFFSET(vop_pgrd), &a));
1138 }
1139
1140 struct vop_pgwr_args {
1141 struct vnodeop_desc *a_desc;
1142 struct vnode *a_vp;
1143 struct uio *a_uio;
1144 struct ucred *a_cred;
1145 vm_offset_t a_offset;
1146 };
1147 extern struct vnodeop_desc vop_pgwr_desc;
1148 #define VOP_PGWR(vp, uio, cred, offset) _VOP_PGWR(vp, uio, cred, offset)
1149 static __inline int _VOP_PGWR(struct vnode *vp, struct uio *uio, struct ucred *cred, vm_offset_t offset)
1150 {
1151 struct vop_pgwr_args a;
1152 a.a_desc = VDESC(vop_pgwr);
1153 a.a_vp = vp;
1154 a.a_uio = uio;
1155 a.a_cred = cred;
1156 a.a_offset = offset;
1157 return (VCALL(vp, VOFFSET(vop_pgwr), &a));
1158 }
1159
1160 struct vop_pagein_args {
1161 struct vnodeop_desc *a_desc;
1162 struct vnode *a_vp;
1163 upl_t a_pl;
1164 vm_offset_t a_pl_offset;
1165 off_t a_f_offset;
1166 size_t a_size;
1167 struct ucred *a_cred;
1168 int a_flags;
1169 };
1170 extern struct vnodeop_desc vop_pagein_desc;
1171 #define VOP_PAGEIN(vp, pl, pl_offset, f_offset, size, cred, flags) _VOP_PAGEIN(vp, pl, pl_offset, f_offset, size, cred, flags)
1172 static __inline int _VOP_PAGEIN(struct vnode *vp, upl_t pl, vm_offset_t pl_offset, off_t f_offset, size_t size, struct ucred *cred, int flags)
1173 {
1174 struct vop_pagein_args a;
1175 a.a_desc = VDESC(vop_pagein);
1176 a.a_vp = vp;
1177 a.a_pl = pl;
1178 a.a_pl_offset = pl_offset;
1179 a.a_f_offset = f_offset;
1180 a.a_size = size;
1181 a.a_cred = cred;
1182 a.a_flags = flags;
1183 return (VCALL(vp, VOFFSET(vop_pagein), &a));
1184 }
1185
1186 struct vop_pageout_args {
1187 struct vnodeop_desc *a_desc;
1188 struct vnode *a_vp;
1189 upl_t a_pl;
1190 vm_offset_t a_pl_offset;
1191 off_t a_f_offset;
1192 size_t a_size;
1193 struct ucred *a_cred;
1194 int a_flags;
1195 };
1196 extern struct vnodeop_desc vop_pageout_desc;
1197 #define VOP_PAGEOUT(vp, pl, pl_offset, f_offset, size, cred, flags) _VOP_PAGEOUT(vp, pl, pl_offset, f_offset, size, cred, flags)
1198 static __inline int _VOP_PAGEOUT(struct vnode *vp, upl_t pl, vm_offset_t pl_offset, off_t f_offset, size_t size, struct ucred *cred, int flags)
1199 {
1200 struct vop_pageout_args a;
1201 a.a_desc = VDESC(vop_pageout);
1202 a.a_vp = vp;
1203 a.a_pl = pl;
1204 a.a_pl_offset = pl_offset;
1205 a.a_f_offset = f_offset;
1206 a.a_size = size;
1207 a.a_cred = cred;
1208 a.a_flags = flags;
1209 return (VCALL(vp, VOFFSET(vop_pageout), &a));
1210 }
1211
1212 struct vop_devblocksize_args {
1213 struct vnodeop_desc *a_desc;
1214 struct vnode *a_vp;
1215 register_t *a_retval;
1216 };
1217 extern struct vnodeop_desc vop_devblocksize_desc;
1218 #define VOP_DEVBLOCKSIZE(vp, retval) _VOP_DEVBLOCKSIZE(vp, retval)
1219 static __inline int _VOP_DEVBLOCKSIZE(struct vnode *vp, register_t *retval)
1220 {
1221 struct vop_devblocksize_args a;
1222 a.a_desc = VDESC(vop_devblocksize);
1223 a.a_vp = vp;
1224 a.a_retval = retval;
1225 return (VCALL(vp, VOFFSET(vop_devblocksize), &a));
1226 }
1227
1228 struct vop_searchfs_args {
1229 struct vnodeop_desc *a_desc;
1230 struct vnode *a_vp;
1231 void *a_searchparams1;
1232 void *a_searchparams2;
1233 struct attrlist *a_searchattrs;
1234 u_long a_maxmatches;
1235 struct timeval *a_timelimit;
1236 struct attrlist *a_returnattrs;
1237 u_long *a_nummatches;
1238 u_long a_scriptcode;
1239 u_long a_options;
1240 struct uio *a_uio;
1241 struct searchstate *a_searchstate;
1242 };
1243 extern struct vnodeop_desc vop_searchfs_desc;
1244 #define VOP_SEARCHFS(vp, searchparams1, searchparams2, searchattrs, maxmatches, timelimit, returnattrs, nummatches, scriptcode, options, uio, searchstate) _VOP_SEARCHFS(vp, searchparams1, searchparams2, searchattrs, maxmatches, timelimit, returnattrs, nummatches, scriptcode, options, uio, searchstate)
1245 static __inline int _VOP_SEARCHFS(struct vnode *vp, void *searchparams1, void *searchparams2, struct attrlist *searchattrs, u_long maxmatches, struct timeval *timelimit, struct attrlist *returnattrs, u_long *nummatches, u_long scriptcode, u_long options, struct uio *uio, struct searchstate *searchstate)
1246 {
1247 struct vop_searchfs_args a;
1248 a.a_desc = VDESC(vop_searchfs);
1249 a.a_vp = vp;
1250 a.a_searchparams1 = searchparams1;
1251 a.a_searchparams2 = searchparams2;
1252 a.a_searchattrs = searchattrs;
1253 a.a_maxmatches = maxmatches;
1254 a.a_timelimit = timelimit;
1255 a.a_returnattrs = returnattrs;
1256 a.a_nummatches = nummatches;
1257 a.a_scriptcode = scriptcode;
1258 a.a_options = options;
1259 a.a_uio = uio;
1260 a.a_searchstate = searchstate;
1261 return (VCALL(vp, VOFFSET(vop_searchfs), &a));
1262 }
1263
1264 struct vop_copyfile_args {
1265 struct vnodeop_desc *a_desc;
1266 struct vnode *a_fvp;
1267 struct vnode *a_tdvp;
1268 struct vnode *a_tvp;
1269 struct componentname *a_tcnp;
1270 int a_mode;
1271 int a_flags;
1272 };
1273 extern struct vnodeop_desc vop_copyfile_desc;
1274 #define VOP_COPYFILE(fvp, tdvp, tvp, tcnp, mode, flags) _VOP_COPYFILE(fvp, tdvp, tvp, tcnp, mode, flags)
1275 static __inline int _VOP_COPYFILE(struct vnode *fvp, struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp, int mode, int flags)
1276 {
1277 struct vop_copyfile_args a;
1278 a.a_desc = VDESC(vop_copyfile);
1279 a.a_fvp = fvp;
1280 a.a_tdvp = tdvp;
1281 a.a_tvp = tvp;
1282 a.a_tcnp = tcnp;
1283 a.a_mode = mode;
1284 a.a_flags = flags;
1285 return (VCALL(fvp, VOFFSET(vop_copyfile), &a));
1286 }
1287
1288 struct vop_blktooff_args {
1289 struct vnodeop_desc *a_desc;
1290 struct vnode *a_vp;
1291 daddr_t a_lblkno;
1292 off_t *a_offset;
1293 };
1294 extern struct vnodeop_desc vop_blktooff_desc;
1295 #define VOP_BLKTOOFF(vp, lblkno, offset) _VOP_BLKTOOFF(vp, lblkno, offset)
1296 static __inline int _VOP_BLKTOOFF(struct vnode *vp, daddr_t lblkno, off_t *offset)
1297 {
1298 struct vop_blktooff_args a;
1299 a.a_desc = VDESC(vop_blktooff);
1300 a.a_vp = vp;
1301 a.a_lblkno = lblkno;
1302 a.a_offset = offset;
1303 return (VCALL(vp, VOFFSET(vop_blktooff), &a));
1304 }
1305
1306 struct vop_offtoblk_args {
1307 struct vnodeop_desc *a_desc;
1308 struct vnode *a_vp;
1309 off_t a_offset;
1310 daddr_t *a_lblkno;
1311 };
1312 extern struct vnodeop_desc vop_offtoblk_desc;
1313 #define VOP_OFFTOBLK(vp, offset, lblkno) _VOP_OFFTOBLK(vp, offset, lblkno)
1314 static __inline int _VOP_OFFTOBLK(struct vnode *vp, off_t offset, daddr_t *lblkno)
1315 {
1316 struct vop_offtoblk_args a;
1317 a.a_desc = VDESC(vop_offtoblk);
1318 a.a_vp = vp;
1319 a.a_offset = offset;
1320 a.a_lblkno = lblkno;
1321 return (VCALL(vp, VOFFSET(vop_offtoblk), &a));
1322 }
1323
1324 struct vop_cmap_args {
1325 struct vnodeop_desc *a_desc;
1326 struct vnode *a_vp;
1327 off_t a_foffset;
1328 size_t a_size;
1329 daddr_t *a_bpn;
1330 size_t *a_run;
1331 void *a_poff;
1332 };
1333 extern struct vnodeop_desc vop_cmap_desc;
1334 #define VOP_CMAP(vp, foffset, size, bpn, run, poff) _VOP_CMAP(vp, foffset, size, bpn, run, poff)
1335 static __inline int _VOP_CMAP(struct vnode *vp, off_t foffset, size_t size, daddr_t *bpn, size_t *run, void *poff)
1336 {
1337 struct vop_cmap_args a;
1338 a.a_desc = VDESC(vop_cmap);
1339 a.a_vp = vp;
1340 a.a_foffset = foffset;
1341 a.a_size = size;
1342 a.a_bpn = bpn;
1343 a.a_run = run;
1344 a.a_poff = poff;
1345 return (VCALL(vp, VOFFSET(vop_cmap), &a));
1346 }
1347
1348 /* Special cases: */
1349 #include <sys/buf.h>
1350 #include <sys/vm.h>
1351
1352 struct vop_strategy_args {
1353 struct vnodeop_desc *a_desc;
1354 struct buf *a_bp;
1355 };
1356 extern struct vnodeop_desc vop_strategy_desc;
1357 #define VOP_STRATEGY(bp) _VOP_STRATEGY(bp)
1358 static __inline int _VOP_STRATEGY(struct buf *bp)
1359 {
1360 struct vop_strategy_args a;
1361 a.a_desc = VDESC(vop_strategy);
1362 a.a_bp = bp;
1363 return (VCALL(bp->b_vp, VOFFSET(vop_strategy), &a));
1364 }
1365
1366 struct vop_bwrite_args {
1367 struct vnodeop_desc *a_desc;
1368 struct buf *a_bp;
1369 };
1370 extern struct vnodeop_desc vop_bwrite_desc;
1371 #define VOP_BWRITE(bp) _VOP_BWRITE(bp)
1372 static __inline int _VOP_BWRITE(struct buf *bp)
1373 {
1374 struct vop_bwrite_args a;
1375 a.a_desc = VDESC(vop_bwrite);
1376 a.a_bp = bp;
1377 return (VCALL(bp->b_vp, VOFFSET(vop_bwrite), &a));
1378 }
1379
1380 /* End of special cases. */
1381
1382 #endif /* __APPLE_API_UNSTABLE */
1383 #endif /* !_SYS_VNODE_IF_H_ */