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