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