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