]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
5d5c5d0d A |
2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. |
3 | * | |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
2d21ac55 A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
8f6c56a5 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
8f6c56a5 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * Copyright (c) 1998-1999 Apple Computer, Inc. All rights reserved. | |
30 | * | |
31 | * File: vfs/vfs_support.c | |
32 | * | |
33 | * The default VFS routines. A VFS plugin can use these | |
34 | * functions in case it does not want to implement all. These functions | |
35 | * take care of releasing locks and free up memory that they are | |
36 | * supposed to. | |
37 | * | |
38 | * nop_* routines always return 0 [success] | |
91447636 | 39 | * err_* routines always return ENOTSUP |
1c79356b A |
40 | * |
41 | * This file could be auto-generated from vnode_if.src. but that needs | |
42 | * support for freeing cnp. | |
43 | * | |
44 | * HISTORY | |
45 | * 15-Jul-1998 Earsh Nandkeshwar (earsh@apple.com) | |
46 | * Fixed up readdirattr for its existance now. | |
47 | * 18-Aug-1998 Umesh Vaishampayan (umeshv@apple.com) | |
48 | * Created. | |
49 | */ | |
50 | ||
51 | #include <vfs/vfs_support.h> | |
91447636 | 52 | #include <sys/kauth.h> |
2d21ac55 | 53 | #include <sys/ubc.h> /* ubc_upl_abort_range() */ |
1c79356b A |
54 | |
55 | ||
91447636 | 56 | struct vnop_create_args /* { |
1c79356b A |
57 | struct vnode *a_dvp; |
58 | struct vnode **a_vpp; | |
59 | struct componentname *a_cnp; | |
91447636 A |
60 | struct vnode_vattr *a_vap; |
61 | vfs_context_t a_context; | |
1c79356b A |
62 | } */; |
63 | ||
64 | int | |
2d21ac55 | 65 | nop_create(__unused struct vnop_create_args *ap) |
1c79356b A |
66 | { |
67 | #if DIAGNOSTIC | |
68 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
69 | panic("nop_create: no name"); | |
70 | #endif | |
1c79356b A |
71 | return (0); |
72 | } | |
73 | ||
74 | int | |
91447636 | 75 | err_create(struct vnop_create_args *ap) |
1c79356b A |
76 | { |
77 | (void)nop_create(ap); | |
91447636 | 78 | return (ENOTSUP); |
1c79356b A |
79 | } |
80 | ||
81 | ||
91447636 | 82 | struct vnop_whiteout_args /* { |
1c79356b A |
83 | struct vnode *a_dvp; |
84 | struct componentname *a_cnp; | |
85 | int a_flags; | |
91447636 | 86 | vfs_context_t a_context; |
1c79356b A |
87 | } */; |
88 | ||
89 | int | |
2d21ac55 | 90 | nop_whiteout(__unused struct vnop_whiteout_args *ap) |
1c79356b A |
91 | { |
92 | return (0); | |
93 | } | |
94 | ||
95 | int | |
2d21ac55 | 96 | err_whiteout(__unused struct vnop_whiteout_args *ap) |
1c79356b | 97 | { |
91447636 | 98 | return (ENOTSUP); |
1c79356b A |
99 | } |
100 | ||
101 | ||
91447636 | 102 | struct vnop_mknod_args /* { |
1c79356b A |
103 | struct vnode *a_dvp; |
104 | struct vnode **a_vpp; | |
105 | struct componentname *a_cnp; | |
91447636 A |
106 | struct vnode_vattr *a_vap; |
107 | vfs_context_t a_context; | |
1c79356b A |
108 | } */; |
109 | ||
110 | int | |
2d21ac55 | 111 | nop_mknod(__unused struct vnop_mknod_args *ap) |
1c79356b A |
112 | { |
113 | #if DIAGNOSTIC | |
114 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
115 | panic("nop_mknod: no name"); | |
116 | #endif | |
1c79356b A |
117 | return (0); |
118 | } | |
119 | ||
120 | int | |
91447636 | 121 | err_mknod(struct vnop_mknod_args *ap) |
1c79356b A |
122 | { |
123 | (void)nop_mknod(ap); | |
91447636 | 124 | return (ENOTSUP); |
1c79356b A |
125 | } |
126 | ||
91447636 | 127 | struct vnop_open_args /* { |
1c79356b A |
128 | struct vnode *a_vp; |
129 | int a_mode; | |
91447636 | 130 | vfs_context_t a_context; |
1c79356b A |
131 | } */; |
132 | ||
133 | int | |
2d21ac55 | 134 | nop_open(__unused struct vnop_open_args *ap) |
1c79356b A |
135 | { |
136 | return (0); | |
137 | } | |
138 | ||
139 | int | |
2d21ac55 | 140 | err_open(__unused struct vnop_open_args *ap) |
1c79356b | 141 | { |
91447636 | 142 | return (ENOTSUP); |
1c79356b A |
143 | } |
144 | ||
145 | ||
91447636 | 146 | struct vnop_close_args /* { |
1c79356b A |
147 | struct vnode *a_vp; |
148 | int a_fflag; | |
91447636 | 149 | vfs_context_t a_context; |
1c79356b A |
150 | } */; |
151 | ||
152 | int | |
2d21ac55 | 153 | nop_close(__unused struct vnop_close_args *ap) |
1c79356b A |
154 | { |
155 | return (0); | |
156 | } | |
157 | ||
158 | int | |
2d21ac55 | 159 | err_close(__unused struct vnop_close_args *ap) |
1c79356b | 160 | { |
91447636 | 161 | return (ENOTSUP); |
1c79356b A |
162 | } |
163 | ||
164 | ||
91447636 | 165 | struct vnop_access_args /* { |
1c79356b A |
166 | struct vnode *a_vp; |
167 | int a_mode; | |
91447636 | 168 | vfs_context_t a_context; |
1c79356b A |
169 | } */; |
170 | ||
171 | int | |
2d21ac55 | 172 | nop_access(__unused struct vnop_access_args *ap) |
1c79356b A |
173 | { |
174 | return (0); | |
175 | } | |
176 | ||
177 | int | |
2d21ac55 | 178 | err_access(__unused struct vnop_access_args *ap) |
1c79356b | 179 | { |
91447636 | 180 | return (ENOTSUP); |
1c79356b A |
181 | } |
182 | ||
183 | ||
91447636 | 184 | struct vnop_getattr_args /* { |
1c79356b | 185 | struct vnode *a_vp; |
91447636 A |
186 | struct vnode_vattr *a_vap; |
187 | vfs_context_t a_context; | |
1c79356b A |
188 | } */; |
189 | ||
190 | int | |
2d21ac55 | 191 | nop_getattr(__unused struct vnop_getattr_args *ap) |
1c79356b A |
192 | { |
193 | return (0); | |
194 | } | |
195 | ||
196 | int | |
2d21ac55 | 197 | err_getattr(__unused struct vnop_getattr_args *ap) |
1c79356b | 198 | { |
91447636 | 199 | return (ENOTSUP); |
1c79356b A |
200 | } |
201 | ||
202 | ||
91447636 | 203 | struct vnop_setattr_args /* { |
1c79356b | 204 | struct vnode *a_vp; |
91447636 A |
205 | struct vnode_vattr *a_vap; |
206 | vfs_context_t a_context; | |
1c79356b A |
207 | } */; |
208 | ||
209 | int | |
2d21ac55 | 210 | nop_setattr(__unused struct vnop_setattr_args *ap) |
1c79356b A |
211 | { |
212 | return (0); | |
213 | } | |
214 | ||
215 | int | |
2d21ac55 | 216 | err_setattr(__unused struct vnop_setattr_args *ap) |
1c79356b | 217 | { |
91447636 | 218 | return (ENOTSUP); |
1c79356b A |
219 | } |
220 | ||
91447636 | 221 | struct vnop_read_args /* { |
1c79356b A |
222 | struct vnode *a_vp; |
223 | struct uio *a_uio; | |
224 | int a_ioflag; | |
91447636 | 225 | vfs_context_t a_context; |
1c79356b A |
226 | } */; |
227 | ||
228 | int | |
2d21ac55 | 229 | nop_read(__unused struct vnop_read_args *ap) |
1c79356b A |
230 | { |
231 | return (0); | |
232 | } | |
233 | ||
234 | int | |
2d21ac55 | 235 | err_read(__unused struct vnop_read_args *ap) |
1c79356b | 236 | { |
91447636 | 237 | return (ENOTSUP); |
1c79356b A |
238 | } |
239 | ||
240 | ||
91447636 | 241 | struct vnop_write_args /* { |
1c79356b A |
242 | struct vnode *a_vp; |
243 | struct uio *a_uio; | |
244 | int a_ioflag; | |
91447636 | 245 | vfs_context_t a_context; |
1c79356b A |
246 | } */; |
247 | ||
248 | int | |
2d21ac55 | 249 | nop_write(__unused struct vnop_write_args *ap) |
1c79356b A |
250 | { |
251 | return (0); | |
252 | } | |
253 | ||
254 | int | |
2d21ac55 | 255 | err_write(__unused struct vnop_write_args *ap) |
1c79356b | 256 | { |
91447636 | 257 | return (ENOTSUP); |
1c79356b A |
258 | } |
259 | ||
260 | ||
91447636 | 261 | struct vnop_ioctl_args /* { |
1c79356b A |
262 | struct vnode *a_vp; |
263 | u_long a_command; | |
264 | caddr_t a_data; | |
265 | int a_fflag; | |
91447636 | 266 | kauth_cred_t a_cred; |
1c79356b A |
267 | struct proc *a_p; |
268 | } */; | |
269 | ||
270 | int | |
91447636 | 271 | nop_ioctl(__unused struct vnop_ioctl_args *ap) |
1c79356b A |
272 | { |
273 | return (0); | |
274 | } | |
275 | ||
276 | int | |
2d21ac55 | 277 | err_ioctl(__unused struct vnop_ioctl_args *ap) |
1c79356b | 278 | { |
91447636 | 279 | return (ENOTSUP); |
1c79356b A |
280 | } |
281 | ||
282 | ||
91447636 | 283 | struct vnop_select_args /* { |
1c79356b A |
284 | struct vnode *a_vp; |
285 | int a_which; | |
286 | int a_fflags; | |
91447636 | 287 | kauth_cred_t a_cred; |
0b4e3aa0 | 288 | void *a_wql; |
1c79356b A |
289 | struct proc *a_p; |
290 | } */; | |
291 | ||
292 | int | |
91447636 | 293 | nop_select(__unused struct vnop_select_args *ap) |
1c79356b A |
294 | { |
295 | return (0); | |
296 | } | |
297 | ||
298 | int | |
2d21ac55 | 299 | err_select(__unused struct vnop_select_args *ap) |
1c79356b | 300 | { |
91447636 | 301 | return (ENOTSUP); |
1c79356b A |
302 | } |
303 | ||
304 | ||
91447636 | 305 | struct vnop_exchange_args /* { |
1c79356b A |
306 | struct vnode *a_fvp; |
307 | struct vnode *a_tvp; | |
91447636 A |
308 | int a_options; |
309 | vfs_context_t a_context; | |
1c79356b A |
310 | } */; |
311 | ||
312 | int | |
2d21ac55 | 313 | nop_exchange(__unused struct vnop_exchange_args *ap) |
1c79356b A |
314 | { |
315 | return (0); | |
316 | } | |
317 | ||
318 | int | |
2d21ac55 | 319 | err_exchange(__unused struct vnop_exchange_args *ap) |
1c79356b | 320 | { |
91447636 | 321 | return (ENOTSUP); |
1c79356b A |
322 | } |
323 | ||
324 | ||
91447636 | 325 | struct vnop_revoke_args /* { |
1c79356b A |
326 | struct vnode *a_vp; |
327 | int a_flags; | |
91447636 | 328 | vfs_context_t a_context; |
1c79356b A |
329 | } */; |
330 | ||
331 | int | |
91447636 | 332 | nop_revoke(struct vnop_revoke_args *ap) |
1c79356b | 333 | { |
91447636 | 334 | return vn_revoke(ap->a_vp, ap->a_flags, ap->a_context); |
1c79356b A |
335 | } |
336 | ||
337 | int | |
91447636 | 338 | err_revoke(struct vnop_revoke_args *ap) |
1c79356b A |
339 | { |
340 | (void)nop_revoke(ap); | |
91447636 | 341 | return (ENOTSUP); |
1c79356b A |
342 | } |
343 | ||
344 | ||
91447636 | 345 | struct vnop_mmap_args /* { |
1c79356b A |
346 | struct vnode *a_vp; |
347 | int a_fflags; | |
91447636 | 348 | kauth_cred_t a_cred; |
1c79356b A |
349 | struct proc *a_p; |
350 | } */; | |
351 | ||
352 | int | |
91447636 | 353 | nop_mmap(__unused struct vnop_mmap_args *ap) |
1c79356b A |
354 | { |
355 | return (0); | |
356 | } | |
357 | ||
358 | int | |
2d21ac55 | 359 | err_mmap(__unused struct vnop_mmap_args *ap) |
1c79356b | 360 | { |
91447636 | 361 | return (ENOTSUP); |
1c79356b A |
362 | } |
363 | ||
364 | ||
91447636 | 365 | struct vnop_fsync_args /* { |
1c79356b | 366 | struct vnode *a_vp; |
1c79356b | 367 | int a_waitfor; |
91447636 | 368 | vfs_context_t a_context; |
1c79356b A |
369 | } */; |
370 | ||
371 | int | |
2d21ac55 | 372 | nop_fsync(__unused struct vnop_fsync_args *ap) |
1c79356b A |
373 | { |
374 | return (0); | |
375 | } | |
376 | ||
377 | int | |
2d21ac55 | 378 | err_fsync(__unused struct vnop_fsync_args *ap) |
1c79356b | 379 | { |
91447636 | 380 | return (ENOTSUP); |
1c79356b A |
381 | } |
382 | ||
383 | ||
91447636 | 384 | struct vnop_remove_args /* { |
1c79356b A |
385 | struct vnode *a_dvp; |
386 | struct vnode *a_vp; | |
387 | struct componentname *a_cnp; | |
91447636 A |
388 | int a_flags; |
389 | vfs_context_t a_context; | |
1c79356b A |
390 | } */; |
391 | ||
392 | int | |
2d21ac55 | 393 | nop_remove(__unused struct vnop_remove_args *ap) |
1c79356b | 394 | { |
1c79356b A |
395 | return (0); |
396 | } | |
397 | ||
398 | int | |
91447636 | 399 | err_remove(struct vnop_remove_args *ap) |
1c79356b A |
400 | { |
401 | (void)nop_remove(ap); | |
91447636 | 402 | return (ENOTSUP); |
1c79356b A |
403 | } |
404 | ||
405 | ||
91447636 | 406 | struct vnop_link_args /* { |
1c79356b A |
407 | struct vnode *a_vp; |
408 | struct vnode *a_tdvp; | |
409 | struct componentname *a_cnp; | |
91447636 | 410 | vfs_context_t a_context; |
1c79356b A |
411 | } */; |
412 | ||
413 | int | |
2d21ac55 | 414 | nop_link(__unused struct vnop_link_args *ap) |
1c79356b | 415 | { |
1c79356b A |
416 | return (0); |
417 | } | |
418 | ||
419 | int | |
91447636 | 420 | err_link(struct vnop_link_args *ap) |
1c79356b A |
421 | { |
422 | (void)nop_link(ap); | |
91447636 | 423 | return (ENOTSUP); |
1c79356b A |
424 | } |
425 | ||
426 | ||
91447636 | 427 | struct vnop_rename_args /* { |
1c79356b A |
428 | struct vnode *a_fdvp; |
429 | struct vnode *a_fvp; | |
430 | struct componentname *a_fcnp; | |
431 | struct vnode *a_tdvp; | |
432 | struct vnode *a_tvp; | |
433 | struct componentname *a_tcnp; | |
91447636 | 434 | vfs_context_t a_context; |
1c79356b A |
435 | } */; |
436 | ||
437 | int | |
2d21ac55 | 438 | nop_rename(__unused struct vnop_rename_args *ap) |
1c79356b | 439 | { |
1c79356b A |
440 | return (0); |
441 | } | |
442 | ||
443 | int | |
91447636 | 444 | err_rename(struct vnop_rename_args *ap) |
1c79356b A |
445 | { |
446 | (void)nop_rename(ap); | |
91447636 | 447 | return (ENOTSUP); |
1c79356b A |
448 | } |
449 | ||
450 | ||
91447636 | 451 | struct vnop_mkdir_args /* { |
1c79356b A |
452 | struct vnode *a_dvp; |
453 | struct vnode **a_vpp; | |
454 | struct componentname *a_cnp; | |
91447636 A |
455 | struct vnode_vattr *a_vap; |
456 | vfs_context_t a_context; | |
1c79356b A |
457 | } */; |
458 | ||
459 | int | |
2d21ac55 | 460 | nop_mkdir(__unused struct vnop_mkdir_args *ap) |
1c79356b | 461 | { |
1c79356b A |
462 | return (0); |
463 | } | |
464 | ||
465 | int | |
2d21ac55 | 466 | err_mkdir(__unused struct vnop_mkdir_args *ap) |
1c79356b | 467 | { |
91447636 | 468 | return (ENOTSUP); |
1c79356b A |
469 | } |
470 | ||
471 | ||
91447636 | 472 | struct vnop_rmdir_args /* { |
1c79356b A |
473 | struct vnode *a_dvp; |
474 | struct vnode *a_vp; | |
475 | struct componentname *a_cnp; | |
91447636 | 476 | vfs_context_t a_context; |
1c79356b A |
477 | } */; |
478 | ||
479 | int | |
2d21ac55 | 480 | nop_rmdir(__unused struct vnop_rmdir_args *ap) |
1c79356b | 481 | { |
1c79356b A |
482 | return (0); |
483 | } | |
484 | ||
485 | int | |
91447636 | 486 | err_rmdir(struct vnop_rmdir_args *ap) |
1c79356b A |
487 | { |
488 | (void)nop_rmdir(ap); | |
91447636 | 489 | return (ENOTSUP); |
1c79356b A |
490 | } |
491 | ||
492 | ||
91447636 | 493 | struct vnop_symlink_args /* { |
1c79356b A |
494 | struct vnode *a_dvp; |
495 | struct vnode **a_vpp; | |
496 | struct componentname *a_cnp; | |
91447636 | 497 | struct vnode_vattr *a_vap; |
1c79356b | 498 | char *a_target; |
91447636 | 499 | vfs_context_t a_context; |
1c79356b A |
500 | } */; |
501 | ||
502 | int | |
2d21ac55 | 503 | nop_symlink(__unused struct vnop_symlink_args *ap) |
1c79356b A |
504 | { |
505 | #if DIAGNOSTIC | |
506 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
507 | panic("nop_symlink: no name"); | |
508 | #endif | |
1c79356b A |
509 | return (0); |
510 | } | |
511 | ||
512 | int | |
91447636 | 513 | err_symlink(struct vnop_symlink_args *ap) |
1c79356b A |
514 | { |
515 | (void)nop_symlink(ap); | |
91447636 | 516 | return (ENOTSUP); |
1c79356b A |
517 | } |
518 | ||
519 | ||
91447636 A |
520 | struct vnop_readdir_args /* { |
521 | vnode_t a_vp; | |
1c79356b | 522 | struct uio *a_uio; |
91447636 | 523 | int a_flags; |
1c79356b | 524 | int *a_eofflag; |
91447636 A |
525 | int *a_numdirent; |
526 | vfs_context_t a_context; | |
1c79356b A |
527 | } */; |
528 | ||
529 | int | |
2d21ac55 | 530 | nop_readdir(__unused struct vnop_readdir_args *ap) |
1c79356b A |
531 | { |
532 | return (0); | |
533 | } | |
534 | ||
535 | int | |
2d21ac55 | 536 | err_readdir(__unused struct vnop_readdir_args *ap) |
1c79356b | 537 | { |
91447636 | 538 | return (ENOTSUP); |
1c79356b A |
539 | } |
540 | ||
541 | ||
91447636 | 542 | struct vnop_readdirattr_args /* { |
1c79356b A |
543 | struct vnode *a_vp; |
544 | struct attrlist *a_alist; | |
545 | struct uio *a_uio; | |
546 | u_long a_maxcount; | |
547 | u_long a_options; | |
548 | int *a_newstate; | |
549 | int *a_eofflag; | |
550 | u_long *a_actualcount; | |
91447636 | 551 | vfs_context_t a_context; |
1c79356b A |
552 | } */; |
553 | ||
554 | int | |
91447636 | 555 | nop_readdirattr(struct vnop_readdirattr_args *ap) |
1c79356b A |
556 | { |
557 | *(ap->a_actualcount) = 0; | |
558 | *(ap->a_eofflag) = 0; | |
559 | return (0); | |
560 | } | |
561 | ||
562 | int | |
91447636 | 563 | err_readdirattr(struct vnop_readdirattr_args *ap) |
1c79356b A |
564 | { |
565 | (void)nop_readdirattr(ap); | |
91447636 | 566 | return (ENOTSUP); |
1c79356b A |
567 | } |
568 | ||
569 | ||
91447636 | 570 | struct vnop_readlink_args /* { |
1c79356b A |
571 | struct vnode *vp; |
572 | struct uio *uio; | |
91447636 | 573 | vfs_context_t a_context; |
1c79356b A |
574 | } */; |
575 | ||
576 | int | |
2d21ac55 | 577 | nop_readlink(__unused struct vnop_readlink_args *ap) |
1c79356b | 578 | { |
1c79356b A |
579 | return (0); |
580 | } | |
581 | ||
582 | int | |
2d21ac55 | 583 | err_readlink(__unused struct vnop_readlink_args *ap) |
1c79356b | 584 | { |
91447636 | 585 | return (ENOTSUP); |
1c79356b A |
586 | } |
587 | ||
588 | ||
91447636 | 589 | struct vnop_inactive_args /* { |
1c79356b | 590 | struct vnode *a_vp; |
91447636 | 591 | vfs_context_t a_context; |
1c79356b A |
592 | } */; |
593 | ||
594 | int | |
2d21ac55 | 595 | nop_inactive(__unused struct vnop_inactive_args *ap) |
1c79356b | 596 | { |
1c79356b A |
597 | return (0); |
598 | } | |
599 | ||
600 | int | |
91447636 | 601 | err_inactive(struct vnop_inactive_args *ap) |
1c79356b A |
602 | { |
603 | (void)nop_inactive(ap); | |
91447636 | 604 | return (ENOTSUP); |
1c79356b A |
605 | } |
606 | ||
607 | ||
91447636 | 608 | struct vnop_reclaim_args /* { |
1c79356b | 609 | struct vnode *a_vp; |
91447636 | 610 | vfs_context_t a_context; |
1c79356b A |
611 | } */; |
612 | ||
613 | int | |
2d21ac55 | 614 | nop_reclaim(__unused struct vnop_reclaim_args *ap) |
1c79356b A |
615 | { |
616 | return (0); | |
617 | } | |
618 | ||
619 | int | |
2d21ac55 | 620 | err_reclaim(__unused struct vnop_reclaim_args *ap) |
1c79356b | 621 | { |
91447636 | 622 | return (ENOTSUP); |
1c79356b A |
623 | } |
624 | ||
625 | ||
91447636 | 626 | struct vnop_strategy_args /* { |
1c79356b A |
627 | struct buf *a_bp; |
628 | } */; | |
629 | ||
630 | int | |
2d21ac55 | 631 | nop_strategy(__unused struct vnop_strategy_args *ap) |
1c79356b A |
632 | { |
633 | return (0); | |
634 | } | |
635 | ||
636 | int | |
2d21ac55 | 637 | err_strategy(__unused struct vnop_strategy_args *ap) |
1c79356b | 638 | { |
91447636 | 639 | return (ENOTSUP); |
1c79356b A |
640 | } |
641 | ||
642 | ||
91447636 | 643 | struct vnop_pathconf_args /* { |
1c79356b A |
644 | struct vnode *a_vp; |
645 | int a_name; | |
646 | register_t *a_retval; | |
91447636 | 647 | vfs_context_t a_context; |
1c79356b A |
648 | } */; |
649 | ||
650 | int | |
2d21ac55 | 651 | nop_pathconf(__unused struct vnop_pathconf_args *ap) |
1c79356b A |
652 | { |
653 | return (0); | |
654 | } | |
655 | ||
656 | int | |
2d21ac55 | 657 | err_pathconf(__unused struct vnop_pathconf_args *ap) |
1c79356b | 658 | { |
91447636 | 659 | return (ENOTSUP); |
1c79356b A |
660 | } |
661 | ||
662 | ||
91447636 | 663 | struct vnop_advlock_args /* { |
1c79356b A |
664 | struct vnode *a_vp; |
665 | caddr_t a_id; | |
666 | int a_op; | |
667 | struct flock *a_fl; | |
668 | int a_flags; | |
91447636 | 669 | vfs_context_t a_context; |
1c79356b A |
670 | } */; |
671 | ||
672 | int | |
2d21ac55 | 673 | nop_advlock(__unused struct vnop_advlock_args *ap) |
1c79356b A |
674 | { |
675 | return (0); | |
676 | } | |
677 | ||
678 | int | |
2d21ac55 | 679 | err_advlock(__unused struct vnop_advlock_args *ap) |
1c79356b | 680 | { |
91447636 | 681 | return (ENOTSUP); |
1c79356b A |
682 | } |
683 | ||
684 | ||
1c79356b | 685 | |
91447636 | 686 | struct vnop_allocate_args /* { |
1c79356b A |
687 | struct vnode *a_vp; |
688 | off_t a_length; | |
689 | u_int32_t a_flags; | |
690 | off_t *a_bytesallocated; | |
0b4e3aa0 | 691 | off_t a_offset; |
91447636 | 692 | vfs_context_t a_context; |
1c79356b A |
693 | } */; |
694 | ||
695 | int | |
91447636 | 696 | nop_allocate(struct vnop_allocate_args *ap) |
1c79356b A |
697 | { |
698 | *(ap->a_bytesallocated) = 0; | |
699 | return (0); | |
700 | } | |
701 | ||
702 | int | |
91447636 | 703 | err_allocate(struct vnop_allocate_args *ap) |
1c79356b A |
704 | { |
705 | (void)nop_allocate(ap); | |
91447636 | 706 | return (ENOTSUP); |
1c79356b A |
707 | } |
708 | ||
91447636 | 709 | struct vnop_bwrite_args /* { |
1c79356b A |
710 | struct buf *a_bp; |
711 | } */; | |
712 | ||
713 | int | |
91447636 | 714 | nop_bwrite(struct vnop_bwrite_args *ap) |
1c79356b | 715 | { |
91447636 | 716 | return ((int)buf_bwrite(ap->a_bp)); |
1c79356b A |
717 | } |
718 | ||
719 | int | |
2d21ac55 | 720 | err_bwrite(__unused struct vnop_bwrite_args *ap) |
1c79356b | 721 | { |
91447636 | 722 | return (ENOTSUP); |
1c79356b A |
723 | } |
724 | ||
725 | ||
91447636 | 726 | struct vnop_pagein_args /* { |
1c79356b A |
727 | struct vnode *a_vp, |
728 | upl_t a_pl, | |
729 | vm_offset_t a_pl_offset, | |
730 | off_t a_foffset, | |
731 | size_t a_size, | |
1c79356b | 732 | int a_flags |
91447636 | 733 | vfs_context_t a_context; |
1c79356b A |
734 | } */; |
735 | ||
736 | int | |
91447636 | 737 | nop_pagein(struct vnop_pagein_args *ap) |
1c79356b | 738 | { |
91447636 A |
739 | if ( !(ap->a_flags & UPL_NOCOMMIT)) |
740 | ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR); | |
741 | return (EINVAL); | |
1c79356b A |
742 | } |
743 | ||
744 | int | |
91447636 | 745 | err_pagein(struct vnop_pagein_args *ap) |
1c79356b | 746 | { |
91447636 A |
747 | if ( !(ap->a_flags & UPL_NOCOMMIT)) |
748 | ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR); | |
749 | return (ENOTSUP); | |
1c79356b A |
750 | } |
751 | ||
752 | ||
91447636 | 753 | struct vnop_pageout_args /* { |
1c79356b A |
754 | struct vnode *a_vp, |
755 | upl_t a_pl, | |
756 | vm_offset_t a_pl_offset, | |
757 | off_t a_foffset, | |
758 | size_t a_size, | |
1c79356b | 759 | int a_flags |
91447636 | 760 | vfs_context_t a_context; |
1c79356b A |
761 | } */; |
762 | ||
763 | int | |
91447636 | 764 | nop_pageout(struct vnop_pageout_args *ap) |
1c79356b | 765 | { |
91447636 A |
766 | if ( !(ap->a_flags & UPL_NOCOMMIT)) |
767 | ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR); | |
768 | return (EINVAL); | |
1c79356b A |
769 | } |
770 | ||
771 | int | |
91447636 | 772 | err_pageout(struct vnop_pageout_args *ap) |
1c79356b | 773 | { |
91447636 A |
774 | if ( !(ap->a_flags & UPL_NOCOMMIT)) |
775 | ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR); | |
776 | return (ENOTSUP); | |
1c79356b A |
777 | } |
778 | ||
779 | ||
91447636 | 780 | struct vnop_searchfs /* { |
1c79356b A |
781 | struct vnode *a_vp; |
782 | void *a_searchparams1; | |
783 | void *a_searchparams2; | |
784 | struct attrlist *a_searchattrs; | |
785 | u_long a_maxmatches; | |
786 | struct timeval *a_timelimit; | |
787 | struct attrlist *a_returnattrs; | |
788 | u_long *a_nummatches; | |
789 | u_long a_scriptcode; | |
790 | u_long a_options; | |
791 | struct uio *a_uio; | |
792 | struct searchstate *a_searchstate; | |
91447636 | 793 | vfs_context_t a_context; |
1c79356b A |
794 | } */; |
795 | ||
796 | int | |
91447636 | 797 | nop_searchfs(struct vnop_searchfs_args *ap) |
1c79356b A |
798 | { |
799 | *(ap->a_nummatches) = 0; | |
800 | return (0); | |
801 | } | |
802 | ||
803 | int | |
91447636 | 804 | err_searchfs(struct vnop_searchfs_args *ap) |
1c79356b A |
805 | { |
806 | (void)nop_searchfs(ap); | |
91447636 | 807 | return (ENOTSUP); |
1c79356b A |
808 | } |
809 | ||
91447636 | 810 | struct vnop_copyfile_args /*{ |
1c79356b A |
811 | struct vnodeop_desc *a_desc; |
812 | struct vnode *a_fvp; | |
813 | struct vnode *a_tdvp; | |
814 | struct vnode *a_tvp; | |
815 | struct componentname *a_tcnp; | |
816 | int a_flags; | |
817 | }*/; | |
818 | ||
819 | int | |
2d21ac55 | 820 | nop_copyfile(__unused struct vnop_copyfile_args *ap) |
1c79356b | 821 | { |
1c79356b A |
822 | return (0); |
823 | } | |
824 | ||
825 | ||
826 | int | |
91447636 | 827 | err_copyfile(struct vnop_copyfile_args *ap) |
1c79356b A |
828 | { |
829 | (void)nop_copyfile(ap); | |
91447636 | 830 | return (ENOTSUP); |
1c79356b A |
831 | } |
832 | ||
833 | ||
91447636 | 834 | struct vnop_blktooff_args /* { |
1c79356b | 835 | struct vnode *a_vp; |
91447636 | 836 | daddr64_t a_lblkno; |
1c79356b A |
837 | off_t *a_offset; |
838 | } */; | |
839 | ||
840 | int | |
91447636 | 841 | nop_blktooff(struct vnop_blktooff_args *ap) |
1c79356b A |
842 | { |
843 | *ap->a_offset = (off_t)-1; /* failure */ | |
844 | return (0); | |
845 | } | |
846 | ||
847 | int | |
91447636 | 848 | err_blktooff(struct vnop_blktooff_args *ap) |
1c79356b A |
849 | { |
850 | (void)nop_blktooff(ap); | |
91447636 | 851 | return (ENOTSUP); |
1c79356b A |
852 | } |
853 | ||
91447636 | 854 | struct vnop_offtoblk_args /* { |
1c79356b A |
855 | struct vnode *a_vp; |
856 | off_t a_offset; | |
91447636 | 857 | daddr64_t *a_lblkno; |
1c79356b A |
858 | } */; |
859 | ||
860 | int | |
91447636 | 861 | nop_offtoblk(struct vnop_offtoblk_args *ap) |
1c79356b | 862 | { |
91447636 | 863 | *ap->a_lblkno = (daddr64_t)-1; /* failure */ |
1c79356b A |
864 | return (0); |
865 | } | |
866 | ||
867 | int | |
91447636 | 868 | err_offtoblk(struct vnop_offtoblk_args *ap) |
1c79356b A |
869 | { |
870 | (void)nop_offtoblk(ap); | |
91447636 | 871 | return (ENOTSUP); |
1c79356b A |
872 | } |
873 | ||
91447636 | 874 | struct vnop_blockmap_args /* { |
1c79356b A |
875 | struct vnode *a_vp; |
876 | off_t a_foffset; | |
877 | size_t a_size; | |
91447636 | 878 | daddr64_t *a_bpn; |
1c79356b A |
879 | size_t *a_run; |
880 | void *a_poff; | |
91447636 | 881 | int a_flags; |
1c79356b A |
882 | } */; |
883 | ||
2d21ac55 | 884 | int nop_blockmap(__unused struct vnop_blockmap_args *ap) |
1c79356b A |
885 | { |
886 | return (0); | |
887 | } | |
888 | ||
2d21ac55 | 889 | int err_blockmap(__unused struct vnop_blockmap_args *ap) |
1c79356b | 890 | { |
91447636 | 891 | return (ENOTSUP); |
1c79356b A |
892 | } |
893 |