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