]> git.saurik.com Git - apple/xnu.git/blame - bsd/vfs/vfs_support.c
xnu-123.5.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;
378 struct proc *a_p;
379} */;
380
381int
382nop_select(struct vop_select_args *ap)
383{
384 return (0);
385}
386
387int
388err_select(struct vop_select_args *ap)
389{
390 return (EOPNOTSUPP);
391}
392
393
394struct 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
401int
402nop_exchange(struct vop_exchange_args *ap)
403{
404 return (0);
405}
406
407int
408err_exchange(struct vop_exchange_args *ap)
409{
410 return (EOPNOTSUPP);
411}
412
413
414struct vop_revoke_args /* {
415 struct vnode *a_vp;
416 int a_flags;
417} */;
418
419int
420nop_revoke(struct vop_revoke_args *ap)
421{
422 return (vop_revoke(ap));
423}
424
425int
426err_revoke(struct vop_revoke_args *ap)
427{
428 (void)nop_revoke(ap);
429 return (EOPNOTSUPP);
430}
431
432
433struct vop_mmap_args /* {
434 struct vnode *a_vp;
435 int a_fflags;
436 struct ucred *a_cred;
437 struct proc *a_p;
438} */;
439
440int
441nop_mmap(struct vop_mmap_args *ap)
442{
443 return (0);
444}
445
446int
447err_mmap(struct vop_mmap_args *ap)
448{
449 return (EOPNOTSUPP);
450}
451
452
453struct vop_fsync_args /* {
454 struct vnode *a_vp;
455 struct ucred *a_cred;
456 int a_waitfor;
457 struct proc *a_p;
458} */;
459
460int
461nop_fsync(struct vop_fsync_args *ap)
462{
463 return (0);
464}
465
466int
467err_fsync(struct vop_fsync_args *ap)
468{
469 return (EOPNOTSUPP);
470}
471
472
473struct 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
480int
481nop_seek(struct vop_seek_args *ap)
482{
483 return (0);
484}
485
486int
487err_seek(struct vop_seek_args *ap)
488{
489 return (EOPNOTSUPP);
490}
491
492
493struct vop_remove_args /* {
494 struct vnode *a_dvp;
495 struct vnode *a_vp;
496 struct componentname *a_cnp;
497} */;
498
499int
500nop_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
510int
511err_remove(struct vop_remove_args *ap)
512{
513 (void)nop_remove(ap);
514 return (EOPNOTSUPP);
515}
516
517
518struct vop_link_args /* {
519 struct vnode *a_vp;
520 struct vnode *a_tdvp;
521 struct componentname *a_cnp;
522} */;
523
524int
525nop_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
536int
537err_link(struct vop_link_args *ap)
538{
539 (void)nop_link(ap);
540 return (EOPNOTSUPP);
541}
542
543
544struct 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
553int
554nop_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
574int
575err_rename(struct vop_rename_args *ap)
576{
577 (void)nop_rename(ap);
578 return (EOPNOTSUPP);
579}
580
581
582struct 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
589int
590nop_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
601int
602err_mkdir(struct vop_mkdir_args *ap)
603{
604 (void)nop_mkdir(ap);
605 return (EOPNOTSUPP);
606}
607
608
609struct vop_rmdir_args /* {
610 struct vnode *a_dvp;
611 struct vnode *a_vp;
612 struct componentname *a_cnp;
613} */;
614
615int
616nop_rmdir(struct vop_rmdir_args *ap)
617{
618 vput(ap->a_dvp);
619 vput(ap->a_vp);
620 return (0);
621}
622
623int
624err_rmdir(struct vop_rmdir_args *ap)
625{
626 (void)nop_rmdir(ap);
627 return (EOPNOTSUPP);
628}
629
630
631struct 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
639int
640nop_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
651int
652err_symlink(struct vop_symlink_args *ap)
653{
654 (void)nop_symlink(ap);
655 return (EOPNOTSUPP);
656}
657
658
659struct 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
668int
669nop_readdir(struct vop_readdir_args *ap)
670{
671 return (0);
672}
673
674int
675err_readdir(struct vop_readdir_args *ap)
676{
677 return (EOPNOTSUPP);
678}
679
680
681struct 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
694int
695nop_readdirattr(struct vop_readdirattr_args *ap)
696{
697 *(ap->a_actualcount) = 0;
698 *(ap->a_eofflag) = 0;
699 return (0);
700}
701
702int
703err_readdirattr(struct vop_readdirattr_args *ap)
704{
705 (void)nop_readdirattr(ap);
706 return (EOPNOTSUPP);
707}
708
709
710struct vop_readlink_args /* {
711 struct vnode *vp;
712 struct uio *uio;
713 struct ucred *cred;
714} */;
715
716int
717nop_readlink(struct vop_readlink_args *ap)
718{
719 return (0);
720}
721
722int
723err_readlink(struct vop_readlink_args *ap)
724{
725 return (EOPNOTSUPP);
726}
727
728
729struct vop_abortop_args /* {
730 struct vnode *a_dvp;
731 struct componentname *a_cnp;
732} */;
733
734int
735nop_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
742int
743err_abortop(struct vop_abortop_args *ap)
744{
745 (void)nop_abortop(ap);
746 return (EOPNOTSUPP);
747}
748
749
750struct vop_inactive_args /* {
751 struct vnode *a_vp;
752 struct proc *a_p;
753} */;
754
755int
756nop_inactive(struct vop_inactive_args *ap)
757{
758 VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
759 return (0);
760}
761
762int
763err_inactive(struct vop_inactive_args *ap)
764{
765 (void)nop_inactive(ap);
766 return (EOPNOTSUPP);
767}
768
769
770struct vop_reclaim_args /* {
771 struct vnode *a_vp;
772 struct proc *a_p;
773} */;
774
775int
776nop_reclaim(struct vop_reclaim_args *ap)
777{
778 return (0);
779}
780
781int
782err_reclaim(struct vop_reclaim_args *ap)
783{
784 return (EOPNOTSUPP);
785}
786
787
788struct vop_lock_args /* {
789 struct vnode *a_vp;
790 int a_flags;
791 struct proc *a_p;
792} */;
793
794int
795nop_lock(struct vop_lock_args *ap)
796{
797 return (vop_nolock(ap));
798}
799
800int
801err_lock(struct vop_lock_args *ap)
802{
803 (void)nop_lock(ap);
804 return (EOPNOTSUPP);
805}
806
807
808struct vop_unlock_args /* {
809 struct vnode *a_vp;
810 int a_flags;
811 struct proc *a_p;
812} */;
813
814int
815nop_unlock(struct vop_unlock_args *ap)
816{
817 return (vop_nounlock(ap));
818}
819
820int
821err_unlock(struct vop_unlock_args *ap)
822{
823 (void)nop_unlock(ap);
824 return (EOPNOTSUPP);
825}
826
827
828struct vop_bmap_args /* {
829 struct vnode *vp;
830 daddr_t bn;
831 struct vnode **vpp;
832 daddr_t *bnp;
833 int *runp;
834} */;
835
836int
837nop_bmap(struct vop_bmap_args *ap)
838{
839 return (0);
840}
841
842int
843err_bmap(struct vop_bmap_args *ap)
844{
845 return (EOPNOTSUPP);
846}
847
848
849struct vop_strategy_args /* {
850 struct buf *a_bp;
851} */;
852
853int
854nop_strategy(struct vop_strategy_args *ap)
855{
856 return (0);
857}
858
859int
860err_strategy(struct vop_strategy_args *ap)
861{
862 return (EOPNOTSUPP);
863}
864
865
866struct vop_print_args /* {
867 struct vnode *a_vp;
868} */;
869
870int
871nop_print(struct vop_print_args *ap)
872{
873 return (0);
874}
875
876int
877err_print(struct vop_print_args *ap)
878{
879 return (EOPNOTSUPP);
880}
881
882
883struct vop_islocked_args /* {
884 struct vnode *a_vp;
885} */;
886
887int
888nop_islocked(struct vop_islocked_args *ap)
889{
890 return (vop_noislocked(ap));
891}
892
893int
894err_islocked(struct vop_islocked_args *ap)
895{
896 (void)nop_islocked(ap);
897 return (EOPNOTSUPP);
898}
899
900
901struct vop_pathconf_args /* {
902 struct vnode *a_vp;
903 int a_name;
904 register_t *a_retval;
905} */;
906
907int
908nop_pathconf(struct vop_pathconf_args *ap)
909{
910 return (0);
911}
912
913int
914err_pathconf(struct vop_pathconf_args *ap)
915{
916 return (EOPNOTSUPP);
917}
918
919
920struct 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
928int
929nop_advlock(struct vop_advlock_args *ap)
930{
931 return (0);
932}
933
934int
935err_advlock(struct vop_advlock_args *ap)
936{
937 return (EOPNOTSUPP);
938}
939
940
941struct vop_blkatoff_args /* {
942 struct vnode *a_vp;
943 off_t a_offset;
944 char **a_res;
945 struct buf **a_bpp;
946} */;
947
948int
949nop_blkatoff(struct vop_blkatoff_args *ap)
950{
951 *ap->a_bpp = NULL;
952 return (0);
953}
954
955int
956err_blkatoff(struct vop_blkatoff_args *ap)
957{
958 (void)nop_blkatoff(ap);
959 return (EOPNOTSUPP);
960}
961
962
963struct vop_valloc_args /* {
964 struct vnode *a_pvp;
965 int a_mode;
966 struct ucred *a_cred;
967 struct vnode **a_vpp;
968} */;
969
970int
971nop_valloc(struct vop_valloc_args *ap)
972{
973 *ap->a_vpp = NULL;
974 return (0);
975}
976
977int
978err_valloc(struct vop_valloc_args *ap)
979{
980 (void)nop_valloc(ap);
981 return (EOPNOTSUPP);
982}
983
984
985struct vop_reallocblks_args /* {
986 struct vnode *a_vp;
987 struct cluster_save *a_buflist;
988} */;
989
990int
991nop_reallocblks(struct vop_reallocblks_args *ap)
992{
993 return (0);
994}
995
996int
997err_reallocblks(struct vop_reallocblks_args *ap)
998{
999 return (EOPNOTSUPP);
1000}
1001
1002
1003struct vop_vfree_args /* {
1004 struct vnode *a_pvp;
1005 ino_t a_ino;
1006 int a_mode;
1007} */;
1008
1009int
1010nop_vfree(struct vop_vfree_args *ap)
1011{
1012 return (0);
1013}
1014
1015int
1016err_vfree(struct vop_vfree_args *ap)
1017{
1018 return (EOPNOTSUPP);
1019}
1020
1021
1022struct 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
1030int
1031nop_truncate(struct vop_truncate_args *ap)
1032{
1033 return (0);
1034}
1035
1036int
1037err_truncate(struct vop_truncate_args *ap)
1038{
1039 return (EOPNOTSUPP);
1040}
1041
1042
1043struct 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
1052int
1053nop_allocate(struct vop_allocate_args *ap)
1054{
1055 *(ap->a_bytesallocated) = 0;
1056 return (0);
1057}
1058
1059int
1060err_allocate(struct vop_allocate_args *ap)
1061{
1062 (void)nop_allocate(ap);
1063 return (EOPNOTSUPP);
1064}
1065
1066
1067struct vop_update_args /* {
1068 struct vnode *a_vp;
1069 struct timeval *a_access;
1070 struct timeval *a_modify;
1071 int a_waitfor;
1072} */;
1073
1074int
1075nop_update(struct vop_update_args *ap)
1076{
1077 return (0);
1078}
1079
1080int
1081err_update(struct vop_update_args *ap)
1082{
1083 return (EOPNOTSUPP);
1084}
1085
1086
1087struct vop_pgrd_args /* {
1088 struct vnode *a_vp;
1089 struct uio *a_uio;
1090 struct ucred *a_cred;
1091} */;
1092
1093int
1094nop_pgrd(struct vop_pgrd_args *ap)
1095{
1096 return (0);
1097}
1098
1099int
1100err_pgrd(struct vop_pgrd_args *ap)
1101{
1102 return (EOPNOTSUPP);
1103}
1104
1105
1106struct 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
1113int
1114nop_pgwr(struct vop_pgwr_args *ap)
1115{
1116 return (0);
1117}
1118
1119int
1120err_pgwr(struct vop_pgwr_args *ap)
1121{
1122 return (EOPNOTSUPP);
1123}
1124
1125
1126struct vop_bwrite_args /* {
1127 struct buf *a_bp;
1128} */;
1129
1130int
1131nop_bwrite(struct vop_bwrite_args *ap)
1132{
1133 return (bwrite(ap->a_bp));
1134}
1135
1136int
1137err_bwrite(struct vop_bwrite_args *ap)
1138{
1139 return (EOPNOTSUPP);
1140}
1141
1142
1143struct 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
1153int
1154nop_pagein(struct vop_pagein_args *ap)
1155{
1156 kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1157 return (0);
1158}
1159
1160int
1161err_pagein(struct vop_pagein_args *ap)
1162{
1163 kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1164 return (EOPNOTSUPP);
1165}
1166
1167
1168struct 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
1178int
1179nop_pageout(struct vop_pageout_args *ap)
1180{
1181 kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1182 return (0);
1183}
1184
1185int
1186err_pageout(struct vop_pageout_args *ap)
1187{
1188 kernel_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1189 return (EOPNOTSUPP);
1190}
1191
1192
1193struct vop_devblocksize_args /* {
1194 struct vnode *a_vp;
1195 register_t *a_retval;
1196} */;
1197
1198int
1199nop_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
1206int
1207err_devblocksize(struct vop_devblocksize_args *ap)
1208{
1209 (void)nop_devblocksize(ap);
1210 return (EOPNOTSUPP);
1211}
1212
1213
1214struct 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
1229int
1230nop_searchfs(struct vop_searchfs_args *ap)
1231{
1232 *(ap->a_nummatches) = 0;
1233 return (0);
1234}
1235
1236int
1237err_searchfs(struct vop_searchfs_args *ap)
1238{
1239 (void)nop_searchfs(ap);
1240 return (EOPNOTSUPP);
1241}
1242
1243struct 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
1252int
1253nop_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
1266int
1267err_copyfile(struct vop_copyfile_args *ap)
1268{
1269 (void)nop_copyfile(ap);
1270 return (EOPNOTSUPP);
1271}
1272
1273
1274struct vop_blktooff_args /* {
1275 struct vnode *a_vp;
1276 daddr_t a_lblkno;
1277 off_t *a_offset;
1278} */;
1279
1280int
1281nop_blktooff(struct vop_blktooff_args *ap)
1282{
1283 *ap->a_offset = (off_t)-1; /* failure */
1284 return (0);
1285}
1286
1287int
1288err_blktooff(struct vop_blktooff_args *ap)
1289{
1290 (void)nop_blktooff(ap);
1291 return (EOPNOTSUPP);
1292}
1293
1294struct vop_offtoblk_args /* {
1295 struct vnode *a_vp;
1296 off_t a_offset;
1297 daddr_t *a_lblkno;
1298} */;
1299
1300int
1301nop_offtoblk(struct vop_offtoblk_args *ap)
1302{
1303 *ap->a_lblkno = (daddr_t)-1; /* failure */
1304 return (0);
1305}
1306
1307int
1308err_offtoblk(struct vop_offtoblk_args *ap)
1309{
1310 (void)nop_offtoblk(ap);
1311 return (EOPNOTSUPP);
1312}
1313
1314struct 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
1323int nop_cmap(struct vop_cmap_args *ap)
1324{
1325 return (0);
1326}
1327
1328int err_cmap(struct vop_cmap_args *ap)
1329{
1330 return (EOPNOTSUPP);
1331}
1332