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