]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
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. | |
11 | * | |
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 | |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
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. | |
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] | |
33 | * err_* routines always return EOPNOTSUPP | |
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> | |
46 | ||
47 | ||
48 | struct vop_create_args /* { | |
49 | struct vnode *a_dvp; | |
50 | struct vnode **a_vpp; | |
51 | struct componentname *a_cnp; | |
52 | struct vattr *a_vap; | |
53 | } */; | |
54 | ||
55 | int | |
56 | nop_create(struct vop_create_args *ap) | |
57 | { | |
58 | #if DIAGNOSTIC | |
59 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
60 | panic("nop_create: no name"); | |
61 | #endif | |
62 | VOP_ABORTOP(ap->a_dvp, ap->a_cnp); | |
63 | vput(ap->a_dvp); | |
64 | return (0); | |
65 | } | |
66 | ||
67 | int | |
68 | err_create(struct vop_create_args *ap) | |
69 | { | |
70 | (void)nop_create(ap); | |
71 | return (EOPNOTSUPP); | |
72 | } | |
73 | ||
74 | ||
75 | struct vop_whiteout_args /* { | |
76 | struct vnode *a_dvp; | |
77 | struct componentname *a_cnp; | |
78 | int a_flags; | |
79 | } */; | |
80 | ||
81 | int | |
82 | nop_whiteout(struct vop_whiteout_args *ap) | |
83 | { | |
84 | return (0); | |
85 | } | |
86 | ||
87 | int | |
88 | err_whiteout(struct vop_whiteout_args *ap) | |
89 | { | |
90 | return (EOPNOTSUPP); | |
91 | } | |
92 | ||
93 | ||
94 | struct vop_mknod_args /* { | |
95 | struct vnode *a_dvp; | |
96 | struct vnode **a_vpp; | |
97 | struct componentname *a_cnp; | |
98 | struct vattr *a_vap; | |
99 | } */; | |
100 | ||
101 | int | |
102 | nop_mknod(struct vop_mknod_args *ap) | |
103 | { | |
104 | #if DIAGNOSTIC | |
105 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
106 | panic("nop_mknod: no name"); | |
107 | #endif | |
108 | VOP_ABORTOP(ap->a_dvp, ap->a_cnp); | |
109 | vput(ap->a_dvp); | |
110 | return (0); | |
111 | } | |
112 | ||
113 | int | |
114 | err_mknod(struct vop_mknod_args *ap) | |
115 | { | |
116 | (void)nop_mknod(ap); | |
117 | return (EOPNOTSUPP); | |
118 | } | |
119 | ||
120 | ||
121 | struct vop_mkcomplex_args /* { | |
122 | struct vnode *a_dvp, | |
123 | struct vnode **a_vpp, | |
124 | struct componentname *a_cnp, | |
125 | struct vattr *a_vap, | |
126 | u_long a_type) | |
127 | } */; | |
128 | ||
129 | int | |
130 | nop_mkcomplex(struct vop_mkcomplex_args *ap) | |
131 | { | |
132 | #if DIAGNOSTIC | |
133 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
134 | panic("nop_mkcomplex: no name"); | |
135 | #endif | |
136 | VOP_ABORTOP(ap->a_dvp, ap->a_cnp); | |
137 | vput(ap->a_dvp); | |
138 | return (0); | |
139 | } | |
140 | ||
141 | int | |
142 | err_mkcomplex(struct vop_mkcomplex_args *ap) | |
143 | { | |
144 | (void)nop_mkcomplex(ap); | |
145 | return (EOPNOTSUPP); | |
146 | } | |
147 | ||
148 | ||
149 | struct vop_open_args /* { | |
150 | struct vnode *a_vp; | |
151 | int a_mode; | |
152 | struct ucred *a_cred; | |
153 | struct proc *a_p; | |
154 | } */; | |
155 | ||
156 | int | |
157 | nop_open(struct vop_open_args *ap) | |
158 | { | |
159 | return (0); | |
160 | } | |
161 | ||
162 | int | |
163 | err_open(struct vop_open_args *ap) | |
164 | { | |
165 | return (EOPNOTSUPP); | |
166 | } | |
167 | ||
168 | ||
169 | struct vop_close_args /* { | |
170 | struct vnode *a_vp; | |
171 | int a_fflag; | |
172 | struct ucred *a_cred; | |
173 | struct proc *a_p; | |
174 | } */; | |
175 | ||
176 | int | |
177 | nop_close(struct vop_close_args *ap) | |
178 | { | |
179 | return (0); | |
180 | } | |
181 | ||
182 | int | |
183 | err_close(struct vop_close_args *ap) | |
184 | { | |
185 | return (EOPNOTSUPP); | |
186 | } | |
187 | ||
188 | ||
189 | struct vop_access_args /* { | |
190 | struct vnode *a_vp; | |
191 | int a_mode; | |
192 | struct ucred *a_cred; | |
193 | struct proc *a_p; | |
194 | } */; | |
195 | ||
196 | int | |
197 | nop_access(struct vop_access_args *ap) | |
198 | { | |
199 | return (0); | |
200 | } | |
201 | ||
202 | int | |
203 | err_access(struct vop_access_args *ap) | |
204 | { | |
205 | return (EOPNOTSUPP); | |
206 | } | |
207 | ||
208 | ||
209 | struct vop_getattr_args /* { | |
210 | struct vnode *a_vp; | |
211 | struct vattr *a_vap; | |
212 | struct ucred *a_cred; | |
213 | struct proc *a_p; | |
214 | } */; | |
215 | ||
216 | int | |
217 | nop_getattr(struct vop_getattr_args *ap) | |
218 | { | |
219 | return (0); | |
220 | } | |
221 | ||
222 | int | |
223 | err_getattr(struct vop_getattr_args *ap) | |
224 | { | |
225 | return (EOPNOTSUPP); | |
226 | } | |
227 | ||
228 | ||
229 | struct vop_setattr_args /* { | |
230 | struct vnode *a_vp; | |
231 | struct vattr *a_vap; | |
232 | struct ucred *a_cred; | |
233 | struct proc *a_p; | |
234 | } */; | |
235 | ||
236 | int | |
237 | nop_setattr(struct vop_setattr_args *ap) | |
238 | { | |
239 | return (0); | |
240 | } | |
241 | ||
242 | int | |
243 | err_setattr(struct vop_setattr_args *ap) | |
244 | { | |
245 | return (EOPNOTSUPP); | |
246 | } | |
247 | ||
248 | ||
249 | struct vop_getattrlist_args /* { | |
250 | struct vnode *a_vp; | |
251 | struct attrlist *a_alist; | |
252 | struct uio *a_uio; | |
253 | struct ucred *a_cred; | |
254 | struct proc *a_p; | |
255 | } */; | |
256 | ||
257 | int | |
258 | nop_getattrlist(struct vop_getattrlist_args *ap) | |
259 | { | |
260 | return (0); | |
261 | } | |
262 | ||
263 | int | |
264 | err_getattrlist(struct vop_getattrlist_args *ap) | |
265 | { | |
266 | return (EOPNOTSUPP); | |
267 | } | |
268 | ||
269 | ||
270 | struct vop_setattrlist_args /* { | |
271 | struct vnode *a_vp; | |
272 | struct attrlist *a_alist; | |
273 | struct uio *a_uio; | |
274 | struct ucred *a_cred; | |
275 | struct proc *a_p; | |
276 | } */; | |
277 | ||
278 | int | |
279 | nop_setattrlist(struct vop_setattrlist_args *ap) | |
280 | { | |
281 | return (0); | |
282 | } | |
283 | ||
284 | int | |
285 | err_setattrlist(struct vop_setattrlist_args *ap) | |
286 | { | |
287 | return (EOPNOTSUPP); | |
288 | } | |
289 | ||
290 | ||
291 | struct vop_read_args /* { | |
292 | struct vnode *a_vp; | |
293 | struct uio *a_uio; | |
294 | int a_ioflag; | |
295 | struct ucred *a_cred; | |
296 | } */; | |
297 | ||
298 | int | |
299 | nop_read(struct vop_read_args *ap) | |
300 | { | |
301 | return (0); | |
302 | } | |
303 | ||
304 | int | |
305 | err_read(struct vop_read_args *ap) | |
306 | { | |
307 | return (EOPNOTSUPP); | |
308 | } | |
309 | ||
310 | ||
311 | struct vop_write_args /* { | |
312 | struct vnode *a_vp; | |
313 | struct uio *a_uio; | |
314 | int a_ioflag; | |
315 | struct ucred *a_cred; | |
316 | } */; | |
317 | ||
318 | int | |
319 | nop_write(struct vop_write_args *ap) | |
320 | { | |
321 | return (0); | |
322 | } | |
323 | ||
324 | int | |
325 | err_write(struct vop_write_args *ap) | |
326 | { | |
327 | return (EOPNOTSUPP); | |
328 | } | |
329 | ||
330 | ||
331 | struct vop_lease_args /* { | |
332 | struct vnode *a_vp; | |
333 | struct proc *a_p; | |
334 | struct ucred *a_cred; | |
335 | int a_flag; | |
336 | } */; | |
337 | ||
338 | int | |
339 | nop_lease(struct vop_lease_args *ap) | |
340 | { | |
341 | return (0); | |
342 | } | |
343 | ||
344 | int | |
345 | err_lease(struct vop_lease_args *ap) | |
346 | { | |
347 | return (EOPNOTSUPP); | |
348 | } | |
349 | ||
350 | ||
351 | struct vop_ioctl_args /* { | |
352 | struct vnode *a_vp; | |
353 | u_long a_command; | |
354 | caddr_t a_data; | |
355 | int a_fflag; | |
356 | struct ucred *a_cred; | |
357 | struct proc *a_p; | |
358 | } */; | |
359 | ||
360 | int | |
361 | nop_ioctl(struct vop_ioctl_args *ap) | |
362 | { | |
363 | return (0); | |
364 | } | |
365 | ||
366 | int | |
367 | err_ioctl(struct vop_ioctl_args *ap) | |
368 | { | |
369 | return (EOPNOTSUPP); | |
370 | } | |
371 | ||
372 | ||
373 | struct vop_select_args /* { | |
374 | struct vnode *a_vp; | |
375 | int a_which; | |
376 | int a_fflags; | |
377 | struct ucred *a_cred; | |
378 | struct proc *a_p; | |
379 | } */; | |
380 | ||
381 | int | |
382 | nop_select(struct vop_select_args *ap) | |
383 | { | |
384 | return (0); | |
385 | } | |
386 | ||
387 | int | |
388 | err_select(struct vop_select_args *ap) | |
389 | { | |
390 | return (EOPNOTSUPP); | |
391 | } | |
392 | ||
393 | ||
394 | struct vop_exchange_args /* { | |
395 | struct vnode *a_fvp; | |
396 | struct vnode *a_tvp; | |
397 | struct ucred *a_cred; | |
398 | struct proc *a_p; | |
399 | } */; | |
400 | ||
401 | int | |
402 | nop_exchange(struct vop_exchange_args *ap) | |
403 | { | |
404 | return (0); | |
405 | } | |
406 | ||
407 | int | |
408 | err_exchange(struct vop_exchange_args *ap) | |
409 | { | |
410 | return (EOPNOTSUPP); | |
411 | } | |
412 | ||
413 | ||
414 | struct vop_revoke_args /* { | |
415 | struct vnode *a_vp; | |
416 | int a_flags; | |
417 | } */; | |
418 | ||
419 | int | |
420 | nop_revoke(struct vop_revoke_args *ap) | |
421 | { | |
422 | return (vop_revoke(ap)); | |
423 | } | |
424 | ||
425 | int | |
426 | err_revoke(struct vop_revoke_args *ap) | |
427 | { | |
428 | (void)nop_revoke(ap); | |
429 | return (EOPNOTSUPP); | |
430 | } | |
431 | ||
432 | ||
433 | struct vop_mmap_args /* { | |
434 | struct vnode *a_vp; | |
435 | int a_fflags; | |
436 | struct ucred *a_cred; | |
437 | struct proc *a_p; | |
438 | } */; | |
439 | ||
440 | int | |
441 | nop_mmap(struct vop_mmap_args *ap) | |
442 | { | |
443 | return (0); | |
444 | } | |
445 | ||
446 | int | |
447 | err_mmap(struct vop_mmap_args *ap) | |
448 | { | |
449 | return (EOPNOTSUPP); | |
450 | } | |
451 | ||
452 | ||
453 | struct vop_fsync_args /* { | |
454 | struct vnode *a_vp; | |
455 | struct ucred *a_cred; | |
456 | int a_waitfor; | |
457 | struct proc *a_p; | |
458 | } */; | |
459 | ||
460 | int | |
461 | nop_fsync(struct vop_fsync_args *ap) | |
462 | { | |
463 | return (0); | |
464 | } | |
465 | ||
466 | int | |
467 | err_fsync(struct vop_fsync_args *ap) | |
468 | { | |
469 | return (EOPNOTSUPP); | |
470 | } | |
471 | ||
472 | ||
473 | struct vop_seek_args /* { | |
474 | struct vnode *a_vp; | |
475 | off_t a_oldoff; | |
476 | off_t a_newoff; | |
477 | struct ucred *a_cred; | |
478 | } */; | |
479 | ||
480 | int | |
481 | nop_seek(struct vop_seek_args *ap) | |
482 | { | |
483 | return (0); | |
484 | } | |
485 | ||
486 | int | |
487 | err_seek(struct vop_seek_args *ap) | |
488 | { | |
489 | return (EOPNOTSUPP); | |
490 | } | |
491 | ||
492 | ||
493 | struct vop_remove_args /* { | |
494 | struct vnode *a_dvp; | |
495 | struct vnode *a_vp; | |
496 | struct componentname *a_cnp; | |
497 | } */; | |
498 | ||
499 | int | |
500 | nop_remove(struct vop_remove_args *ap) | |
501 | { | |
502 | if (ap->a_dvp == ap->a_vp) | |
503 | vrele(ap->a_vp); | |
504 | else | |
505 | vput(ap->a_vp); | |
506 | vput(ap->a_dvp); | |
507 | return (0); | |
508 | } | |
509 | ||
510 | int | |
511 | err_remove(struct vop_remove_args *ap) | |
512 | { | |
513 | (void)nop_remove(ap); | |
514 | return (EOPNOTSUPP); | |
515 | } | |
516 | ||
517 | ||
518 | struct vop_link_args /* { | |
519 | struct vnode *a_vp; | |
520 | struct vnode *a_tdvp; | |
521 | struct componentname *a_cnp; | |
522 | } */; | |
523 | ||
524 | int | |
525 | nop_link(struct vop_link_args *ap) | |
526 | { | |
527 | #if DIAGNOSTIC | |
528 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
529 | panic("nop_link: no name"); | |
530 | #endif | |
531 | VOP_ABORTOP(ap->a_tdvp, ap->a_cnp); | |
532 | vput(ap->a_tdvp); | |
533 | return (0); | |
534 | } | |
535 | ||
536 | int | |
537 | err_link(struct vop_link_args *ap) | |
538 | { | |
539 | (void)nop_link(ap); | |
540 | return (EOPNOTSUPP); | |
541 | } | |
542 | ||
543 | ||
544 | struct vop_rename_args /* { | |
545 | struct vnode *a_fdvp; | |
546 | struct vnode *a_fvp; | |
547 | struct componentname *a_fcnp; | |
548 | struct vnode *a_tdvp; | |
549 | struct vnode *a_tvp; | |
550 | struct componentname *a_tcnp; | |
551 | } */; | |
552 | ||
553 | int | |
554 | nop_rename(struct vop_rename_args *ap) | |
555 | { | |
556 | #if DIAGNOSTIC | |
557 | if ((ap->a_tcnp->cn_flags & HASBUF) == 0 || | |
558 | (ap->a_fcnp->cn_flags & HASBUF) == 0) | |
559 | panic("nop_rename: no name"); | |
560 | #endif | |
561 | VOP_ABORTOP(ap->a_tdvp, ap->a_tcnp); | |
562 | if (ap->a_tdvp == ap->a_tvp) | |
563 | vrele(ap->a_tdvp); | |
564 | else | |
565 | vput(ap->a_tdvp); | |
566 | if (ap->a_tvp) | |
567 | vput(ap->a_tvp); | |
568 | VOP_ABORTOP(ap->a_fdvp, ap->a_fcnp); | |
569 | vrele(ap->a_fdvp); | |
570 | vrele(ap->a_fvp); | |
571 | return (0); | |
572 | } | |
573 | ||
574 | int | |
575 | err_rename(struct vop_rename_args *ap) | |
576 | { | |
577 | (void)nop_rename(ap); | |
578 | return (EOPNOTSUPP); | |
579 | } | |
580 | ||
581 | ||
582 | struct vop_mkdir_args /* { | |
583 | struct vnode *a_dvp; | |
584 | struct vnode **a_vpp; | |
585 | struct componentname *a_cnp; | |
586 | struct vattr *a_vap; | |
587 | } */; | |
588 | ||
589 | int | |
590 | nop_mkdir(struct vop_mkdir_args *ap) | |
591 | { | |
592 | #if DIAGNOSTIC | |
593 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
594 | panic("nop_mkdir: no name"); | |
595 | #endif | |
596 | VOP_ABORTOP(ap->a_dvp, ap->a_cnp); | |
597 | vput(ap->a_dvp); | |
598 | return (0); | |
599 | } | |
600 | ||
601 | int | |
602 | err_mkdir(struct vop_mkdir_args *ap) | |
603 | { | |
604 | (void)nop_mkdir(ap); | |
605 | return (EOPNOTSUPP); | |
606 | } | |
607 | ||
608 | ||
609 | struct vop_rmdir_args /* { | |
610 | struct vnode *a_dvp; | |
611 | struct vnode *a_vp; | |
612 | struct componentname *a_cnp; | |
613 | } */; | |
614 | ||
615 | int | |
616 | nop_rmdir(struct vop_rmdir_args *ap) | |
617 | { | |
618 | vput(ap->a_dvp); | |
619 | vput(ap->a_vp); | |
620 | return (0); | |
621 | } | |
622 | ||
623 | int | |
624 | err_rmdir(struct vop_rmdir_args *ap) | |
625 | { | |
626 | (void)nop_rmdir(ap); | |
627 | return (EOPNOTSUPP); | |
628 | } | |
629 | ||
630 | ||
631 | struct vop_symlink_args /* { | |
632 | struct vnode *a_dvp; | |
633 | struct vnode **a_vpp; | |
634 | struct componentname *a_cnp; | |
635 | struct vattr *a_vap; | |
636 | char *a_target; | |
637 | } */; | |
638 | ||
639 | int | |
640 | nop_symlink(struct vop_symlink_args *ap) | |
641 | { | |
642 | #if DIAGNOSTIC | |
643 | if ((ap->a_cnp->cn_flags & HASBUF) == 0) | |
644 | panic("nop_symlink: no name"); | |
645 | #endif | |
646 | VOP_ABORTOP(ap->a_dvp, ap->a_cnp); | |
647 | vput(ap->a_dvp); | |
648 | return (0); | |
649 | } | |
650 | ||
651 | int | |
652 | err_symlink(struct vop_symlink_args *ap) | |
653 | { | |
654 | (void)nop_symlink(ap); | |
655 | return (EOPNOTSUPP); | |
656 | } | |
657 | ||
658 | ||
659 | struct vop_readdir_args /* { | |
660 | struct vnode *a_vp; | |
661 | struct uio *a_uio; | |
662 | struct ucred *a_cred; | |
663 | int *a_eofflag; | |
664 | int *a_ncookies; | |
665 | u_long **a_cookies; | |
666 | } */; | |
667 | ||
668 | int | |
669 | nop_readdir(struct vop_readdir_args *ap) | |
670 | { | |
671 | return (0); | |
672 | } | |
673 | ||
674 | int | |
675 | err_readdir(struct vop_readdir_args *ap) | |
676 | { | |
677 | return (EOPNOTSUPP); | |
678 | } | |
679 | ||
680 | ||
681 | struct vop_readdirattr_args /* { | |
682 | struct vnode *a_vp; | |
683 | struct attrlist *a_alist; | |
684 | struct uio *a_uio; | |
685 | u_long a_maxcount; | |
686 | u_long a_options; | |
687 | int *a_newstate; | |
688 | int *a_eofflag; | |
689 | u_long *a_actualcount; | |
690 | u_long **a_cookies; | |
691 | struct ucred *a_cred; | |
692 | } */; | |
693 | ||
694 | int | |
695 | nop_readdirattr(struct vop_readdirattr_args *ap) | |
696 | { | |
697 | *(ap->a_actualcount) = 0; | |
698 | *(ap->a_eofflag) = 0; | |
699 | return (0); | |
700 | } | |
701 | ||
702 | int | |
703 | err_readdirattr(struct vop_readdirattr_args *ap) | |
704 | { | |
705 | (void)nop_readdirattr(ap); | |
706 | return (EOPNOTSUPP); | |
707 | } | |
708 | ||
709 | ||
710 | struct vop_readlink_args /* { | |
711 | struct vnode *vp; | |
712 | struct uio *uio; | |
713 | struct ucred *cred; | |
714 | } */; | |
715 | ||
716 | int | |
717 | nop_readlink(struct vop_readlink_args *ap) | |
718 | { | |
719 | return (0); | |
720 | } | |
721 | ||
722 | int | |
723 | err_readlink(struct vop_readlink_args *ap) | |
724 | { | |
725 | return (EOPNOTSUPP); | |
726 | } | |
727 | ||
728 | ||
729 | struct vop_abortop_args /* { | |
730 | struct vnode *a_dvp; | |
731 | struct componentname *a_cnp; | |
732 | } */; | |
733 | ||
734 | int | |
735 | nop_abortop(struct vop_abortop_args *ap) | |
736 | { | |
737 | if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) | |
738 | FREE_ZONE(ap->a_cnp->cn_pnbuf, ap->a_cnp->cn_pnlen, M_NAMEI); | |
739 | return (0); | |
740 | } | |
741 | ||
742 | int | |
743 | err_abortop(struct vop_abortop_args *ap) | |
744 | { | |
745 | (void)nop_abortop(ap); | |
746 | return (EOPNOTSUPP); | |
747 | } | |
748 | ||
749 | ||
750 | struct vop_inactive_args /* { | |
751 | struct vnode *a_vp; | |
752 | struct proc *a_p; | |
753 | } */; | |
754 | ||
755 | int | |
756 | nop_inactive(struct vop_inactive_args *ap) | |
757 | { | |
758 | VOP_UNLOCK(ap->a_vp, 0, ap->a_p); | |
759 | return (0); | |
760 | } | |
761 | ||
762 | int | |
763 | err_inactive(struct vop_inactive_args *ap) | |
764 | { | |
765 | (void)nop_inactive(ap); | |
766 | return (EOPNOTSUPP); | |
767 | } | |
768 | ||
769 | ||
770 | struct vop_reclaim_args /* { | |
771 | struct vnode *a_vp; | |
772 | struct proc *a_p; | |
773 | } */; | |
774 | ||
775 | int | |
776 | nop_reclaim(struct vop_reclaim_args *ap) | |
777 | { | |
778 | return (0); | |
779 | } | |
780 | ||
781 | int | |
782 | err_reclaim(struct vop_reclaim_args *ap) | |
783 | { | |
784 | return (EOPNOTSUPP); | |
785 | } | |
786 | ||
787 | ||
788 | struct vop_lock_args /* { | |
789 | struct vnode *a_vp; | |
790 | int a_flags; | |
791 | struct proc *a_p; | |
792 | } */; | |
793 | ||
794 | int | |
795 | nop_lock(struct vop_lock_args *ap) | |
796 | { | |
797 | return (vop_nolock(ap)); | |
798 | } | |
799 | ||
800 | int | |
801 | err_lock(struct vop_lock_args *ap) | |
802 | { | |
803 | (void)nop_lock(ap); | |
804 | return (EOPNOTSUPP); | |
805 | } | |
806 | ||
807 | ||
808 | struct vop_unlock_args /* { | |
809 | struct vnode *a_vp; | |
810 | int a_flags; | |
811 | struct proc *a_p; | |
812 | } */; | |
813 | ||
814 | int | |
815 | nop_unlock(struct vop_unlock_args *ap) | |
816 | { | |
817 | return (vop_nounlock(ap)); | |
818 | } | |
819 | ||
820 | int | |
821 | err_unlock(struct vop_unlock_args *ap) | |
822 | { | |
823 | (void)nop_unlock(ap); | |
824 | return (EOPNOTSUPP); | |
825 | } | |
826 | ||
827 | ||
828 | struct vop_bmap_args /* { | |
829 | struct vnode *vp; | |
830 | daddr_t bn; | |
831 | struct vnode **vpp; | |
832 | daddr_t *bnp; | |
833 | int *runp; | |
834 | } */; | |
835 | ||
836 | int | |
837 | nop_bmap(struct vop_bmap_args *ap) | |
838 | { | |
839 | return (0); | |
840 | } | |
841 | ||
842 | int | |
843 | err_bmap(struct vop_bmap_args *ap) | |
844 | { | |
845 | return (EOPNOTSUPP); | |
846 | } | |
847 | ||
848 | ||
849 | struct vop_strategy_args /* { | |
850 | struct buf *a_bp; | |
851 | } */; | |
852 | ||
853 | int | |
854 | nop_strategy(struct vop_strategy_args *ap) | |
855 | { | |
856 | return (0); | |
857 | } | |
858 | ||
859 | int | |
860 | err_strategy(struct vop_strategy_args *ap) | |
861 | { | |
862 | return (EOPNOTSUPP); | |
863 | } | |
864 | ||
865 | ||
866 | struct vop_print_args /* { | |
867 | struct vnode *a_vp; | |
868 | } */; | |
869 | ||
870 | int | |
871 | nop_print(struct vop_print_args *ap) | |
872 | { | |
873 | return (0); | |
874 | } | |
875 | ||
876 | int | |
877 | err_print(struct vop_print_args *ap) | |
878 | { | |
879 | return (EOPNOTSUPP); | |
880 | } | |
881 | ||
882 | ||
883 | struct vop_islocked_args /* { | |
884 | struct vnode *a_vp; | |
885 | } */; | |
886 | ||
887 | int | |
888 | nop_islocked(struct vop_islocked_args *ap) | |
889 | { | |
890 | return (vop_noislocked(ap)); | |
891 | } | |
892 | ||
893 | int | |
894 | err_islocked(struct vop_islocked_args *ap) | |
895 | { | |
896 | (void)nop_islocked(ap); | |
897 | return (EOPNOTSUPP); | |
898 | } | |
899 | ||
900 | ||
901 | struct vop_pathconf_args /* { | |
902 | struct vnode *a_vp; | |
903 | int a_name; | |
904 | register_t *a_retval; | |
905 | } */; | |
906 | ||
907 | int | |
908 | nop_pathconf(struct vop_pathconf_args *ap) | |
909 | { | |
910 | return (0); | |
911 | } | |
912 | ||
913 | int | |
914 | err_pathconf(struct vop_pathconf_args *ap) | |
915 | { | |
916 | return (EOPNOTSUPP); | |
917 | } | |
918 | ||
919 | ||
920 | struct vop_advlock_args /* { | |
921 | struct vnode *a_vp; | |
922 | caddr_t a_id; | |
923 | int a_op; | |
924 | struct flock *a_fl; | |
925 | int a_flags; | |
926 | } */; | |
927 | ||
928 | int | |
929 | nop_advlock(struct vop_advlock_args *ap) | |
930 | { | |
931 | return (0); | |
932 | } | |
933 | ||
934 | int | |
935 | err_advlock(struct vop_advlock_args *ap) | |
936 | { | |
937 | return (EOPNOTSUPP); | |
938 | } | |
939 | ||
940 | ||
941 | struct vop_blkatoff_args /* { | |
942 | struct vnode *a_vp; | |
943 | off_t a_offset; | |
944 | char **a_res; | |
945 | struct buf **a_bpp; | |
946 | } */; | |
947 | ||
948 | int | |
949 | nop_blkatoff(struct vop_blkatoff_args *ap) | |
950 | { | |
951 | *ap->a_bpp = NULL; | |
952 | return (0); | |
953 | } | |
954 | ||
955 | int | |
956 | err_blkatoff(struct vop_blkatoff_args *ap) | |
957 | { | |
958 | (void)nop_blkatoff(ap); | |
959 | return (EOPNOTSUPP); | |
960 | } | |
961 | ||
962 | ||
963 | struct vop_valloc_args /* { | |
964 | struct vnode *a_pvp; | |
965 | int a_mode; | |
966 | struct ucred *a_cred; | |
967 | struct vnode **a_vpp; | |
968 | } */; | |
969 | ||
970 | int | |
971 | nop_valloc(struct vop_valloc_args *ap) | |
972 | { | |
973 | *ap->a_vpp = NULL; | |
974 | return (0); | |
975 | } | |
976 | ||
977 | int | |
978 | err_valloc(struct vop_valloc_args *ap) | |
979 | { | |
980 | (void)nop_valloc(ap); | |
981 | return (EOPNOTSUPP); | |
982 | } | |
983 | ||
984 | ||
985 | struct vop_reallocblks_args /* { | |
986 | struct vnode *a_vp; | |
987 | struct cluster_save *a_buflist; | |
988 | } */; | |
989 | ||
990 | int | |
991 | nop_reallocblks(struct vop_reallocblks_args *ap) | |
992 | { | |
993 | return (0); | |
994 | } | |
995 | ||
996 | int | |
997 | err_reallocblks(struct vop_reallocblks_args *ap) | |
998 | { | |
999 | return (EOPNOTSUPP); | |
1000 | } | |
1001 | ||
1002 | ||
1003 | struct vop_vfree_args /* { | |
1004 | struct vnode *a_pvp; | |
1005 | ino_t a_ino; | |
1006 | int a_mode; | |
1007 | } */; | |
1008 | ||
1009 | int | |
1010 | nop_vfree(struct vop_vfree_args *ap) | |
1011 | { | |
1012 | return (0); | |
1013 | } | |
1014 | ||
1015 | int | |
1016 | err_vfree(struct vop_vfree_args *ap) | |
1017 | { | |
1018 | return (EOPNOTSUPP); | |
1019 | } | |
1020 | ||
1021 | ||
1022 | struct vop_truncate_args /* { | |
1023 | struct vnode *a_vp; | |
1024 | off_t a_length; | |
1025 | int a_flags; | |
1026 | struct ucred *a_cred; | |
1027 | struct proc *a_p; | |
1028 | } */; | |
1029 | ||
1030 | int | |
1031 | nop_truncate(struct vop_truncate_args *ap) | |
1032 | { | |
1033 | return (0); | |
1034 | } | |
1035 | ||
1036 | int | |
1037 | err_truncate(struct vop_truncate_args *ap) | |
1038 | { | |
1039 | return (EOPNOTSUPP); | |
1040 | } | |
1041 | ||
1042 | ||
1043 | struct vop_allocate_args /* { | |
1044 | struct vnode *a_vp; | |
1045 | off_t a_length; | |
1046 | u_int32_t a_flags; | |
1047 | off_t *a_bytesallocated; | |
1048 | struct ucred *a_cred; | |
1049 | struct proc *a_p; | |
1050 | } */; | |
1051 | ||
1052 | int | |
1053 | nop_allocate(struct vop_allocate_args *ap) | |
1054 | { | |
1055 | *(ap->a_bytesallocated) = 0; | |
1056 | return (0); | |
1057 | } | |
1058 | ||
1059 | int | |
1060 | err_allocate(struct vop_allocate_args *ap) | |
1061 | { | |
1062 | (void)nop_allocate(ap); | |
1063 | return (EOPNOTSUPP); | |
1064 | } | |
1065 | ||
1066 | ||
1067 | struct vop_update_args /* { | |
1068 | struct vnode *a_vp; | |
1069 | struct timeval *a_access; | |
1070 | struct timeval *a_modify; | |
1071 | int a_waitfor; | |
1072 | } */; | |
1073 | ||
1074 | int | |
1075 | nop_update(struct vop_update_args *ap) | |
1076 | { | |
1077 | return (0); | |
1078 | } | |
1079 | ||
1080 | int | |
1081 | err_update(struct vop_update_args *ap) | |
1082 | { | |
1083 | return (EOPNOTSUPP); | |
1084 | } | |
1085 | ||
1086 | ||
1087 | struct vop_pgrd_args /* { | |
1088 | struct vnode *a_vp; | |
1089 | struct uio *a_uio; | |
1090 | struct ucred *a_cred; | |
1091 | } */; | |
1092 | ||
1093 | int | |
1094 | nop_pgrd(struct vop_pgrd_args *ap) | |
1095 | { | |
1096 | return (0); | |
1097 | } | |
1098 | ||
1099 | int | |
1100 | err_pgrd(struct vop_pgrd_args *ap) | |
1101 | { | |
1102 | return (EOPNOTSUPP); | |
1103 | } | |
1104 | ||
1105 | ||
1106 | struct vop_pgwr_args /* { | |
1107 | struct vnode *a_vp; | |
1108 | struct uio *a_uio; | |
1109 | struct ucred *a_cred; | |
1110 | vm_offset_t a_offset; | |
1111 | } */; | |
1112 | ||
1113 | int | |
1114 | nop_pgwr(struct vop_pgwr_args *ap) | |
1115 | { | |
1116 | return (0); | |
1117 | } | |
1118 | ||
1119 | int | |
1120 | err_pgwr(struct vop_pgwr_args *ap) | |
1121 | { | |
1122 | return (EOPNOTSUPP); | |
1123 | } | |
1124 | ||
1125 | ||
1126 | struct vop_bwrite_args /* { | |
1127 | struct buf *a_bp; | |
1128 | } */; | |
1129 | ||
1130 | int | |
1131 | nop_bwrite(struct vop_bwrite_args *ap) | |
1132 | { | |
1133 | return (bwrite(ap->a_bp)); | |
1134 | } | |
1135 | ||
1136 | int | |
1137 | err_bwrite(struct vop_bwrite_args *ap) | |
1138 | { | |
1139 | return (EOPNOTSUPP); | |
1140 | } | |
1141 | ||
1142 | ||
1143 | struct vop_pagein_args /* { | |
1144 | struct vnode *a_vp, | |
1145 | upl_t a_pl, | |
1146 | vm_offset_t a_pl_offset, | |
1147 | off_t a_foffset, | |
1148 | size_t a_size, | |
1149 | struct ucred *a_cred, | |
1150 | int a_flags | |
1151 | } */; | |
1152 | ||
1153 | int | |
1154 | nop_pagein(struct vop_pagein_args *ap) | |
1155 | { | |
1156 | kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR); | |
1157 | return (0); | |
1158 | } | |
1159 | ||
1160 | int | |
1161 | err_pagein(struct vop_pagein_args *ap) | |
1162 | { | |
1163 | kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR); | |
1164 | return (EOPNOTSUPP); | |
1165 | } | |
1166 | ||
1167 | ||
1168 | struct vop_pageout_args /* { | |
1169 | struct vnode *a_vp, | |
1170 | upl_t a_pl, | |
1171 | vm_offset_t a_pl_offset, | |
1172 | off_t a_foffset, | |
1173 | size_t a_size, | |
1174 | struct ucred *a_cred, | |
1175 | int a_flags | |
1176 | } */; | |
1177 | ||
1178 | int | |
1179 | nop_pageout(struct vop_pageout_args *ap) | |
1180 | { | |
1181 | kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR); | |
1182 | return (0); | |
1183 | } | |
1184 | ||
1185 | int | |
1186 | err_pageout(struct vop_pageout_args *ap) | |
1187 | { | |
1188 | kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR); | |
1189 | return (EOPNOTSUPP); | |
1190 | } | |
1191 | ||
1192 | ||
1193 | struct vop_devblocksize_args /* { | |
1194 | struct vnode *a_vp; | |
1195 | register_t *a_retval; | |
1196 | } */; | |
1197 | ||
1198 | int | |
1199 | nop_devblocksize(struct vop_devblocksize_args *ap) | |
1200 | { | |
1201 | /* XXX default value because the call sites do not check error */ | |
1202 | *ap->a_retval = 512; | |
1203 | return (0); | |
1204 | } | |
1205 | ||
1206 | int | |
1207 | err_devblocksize(struct vop_devblocksize_args *ap) | |
1208 | { | |
1209 | (void)nop_devblocksize(ap); | |
1210 | return (EOPNOTSUPP); | |
1211 | } | |
1212 | ||
1213 | ||
1214 | struct vop_searchfs /* { | |
1215 | struct vnode *a_vp; | |
1216 | void *a_searchparams1; | |
1217 | void *a_searchparams2; | |
1218 | struct attrlist *a_searchattrs; | |
1219 | u_long a_maxmatches; | |
1220 | struct timeval *a_timelimit; | |
1221 | struct attrlist *a_returnattrs; | |
1222 | u_long *a_nummatches; | |
1223 | u_long a_scriptcode; | |
1224 | u_long a_options; | |
1225 | struct uio *a_uio; | |
1226 | struct searchstate *a_searchstate; | |
1227 | } */; | |
1228 | ||
1229 | int | |
1230 | nop_searchfs(struct vop_searchfs_args *ap) | |
1231 | { | |
1232 | *(ap->a_nummatches) = 0; | |
1233 | return (0); | |
1234 | } | |
1235 | ||
1236 | int | |
1237 | err_searchfs(struct vop_searchfs_args *ap) | |
1238 | { | |
1239 | (void)nop_searchfs(ap); | |
1240 | return (EOPNOTSUPP); | |
1241 | } | |
1242 | ||
1243 | struct vop_copyfile_args /*{ | |
1244 | struct vnodeop_desc *a_desc; | |
1245 | struct vnode *a_fvp; | |
1246 | struct vnode *a_tdvp; | |
1247 | struct vnode *a_tvp; | |
1248 | struct componentname *a_tcnp; | |
1249 | int a_flags; | |
1250 | }*/; | |
1251 | ||
1252 | int | |
1253 | nop_copyfile(struct vop_copyfile_args *ap) | |
1254 | { | |
1255 | if (ap->a_tdvp == ap->a_tvp) | |
1256 | vrele(ap->a_tdvp); | |
1257 | else | |
1258 | vput(ap->a_tdvp); | |
1259 | if (ap->a_tvp) | |
1260 | vput(ap->a_tvp); | |
1261 | vrele(ap->a_fvp); | |
1262 | return (0); | |
1263 | } | |
1264 | ||
1265 | ||
1266 | int | |
1267 | err_copyfile(struct vop_copyfile_args *ap) | |
1268 | { | |
1269 | (void)nop_copyfile(ap); | |
1270 | return (EOPNOTSUPP); | |
1271 | } | |
1272 | ||
1273 | ||
1274 | struct vop_blktooff_args /* { | |
1275 | struct vnode *a_vp; | |
1276 | daddr_t a_lblkno; | |
1277 | off_t *a_offset; | |
1278 | } */; | |
1279 | ||
1280 | int | |
1281 | nop_blktooff(struct vop_blktooff_args *ap) | |
1282 | { | |
1283 | *ap->a_offset = (off_t)-1; /* failure */ | |
1284 | return (0); | |
1285 | } | |
1286 | ||
1287 | int | |
1288 | err_blktooff(struct vop_blktooff_args *ap) | |
1289 | { | |
1290 | (void)nop_blktooff(ap); | |
1291 | return (EOPNOTSUPP); | |
1292 | } | |
1293 | ||
1294 | struct vop_offtoblk_args /* { | |
1295 | struct vnode *a_vp; | |
1296 | off_t a_offset; | |
1297 | daddr_t *a_lblkno; | |
1298 | } */; | |
1299 | ||
1300 | int | |
1301 | nop_offtoblk(struct vop_offtoblk_args *ap) | |
1302 | { | |
1303 | *ap->a_lblkno = (daddr_t)-1; /* failure */ | |
1304 | return (0); | |
1305 | } | |
1306 | ||
1307 | int | |
1308 | err_offtoblk(struct vop_offtoblk_args *ap) | |
1309 | { | |
1310 | (void)nop_offtoblk(ap); | |
1311 | return (EOPNOTSUPP); | |
1312 | } | |
1313 | ||
1314 | struct vop_cmap_args /* { | |
1315 | struct vnode *a_vp; | |
1316 | off_t a_foffset; | |
1317 | size_t a_size; | |
1318 | daddr_t *a_bpn; | |
1319 | size_t *a_run; | |
1320 | void *a_poff; | |
1321 | } */; | |
1322 | ||
1323 | int nop_cmap(struct vop_cmap_args *ap) | |
1324 | { | |
1325 | return (0); | |
1326 | } | |
1327 | ||
1328 | int err_cmap(struct vop_cmap_args *ap) | |
1329 | { | |
1330 | return (EOPNOTSUPP); | |
1331 | } | |
1332 |