]> git.saurik.com Git - apple/xnu.git/blame - bsd/vfs/vfs_support.c
xnu-517.9.4.tar.gz
[apple/xnu.git] / bsd / vfs / vfs_support.c
CommitLineData
1c79356b 1/*
55e303ae 2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
e5568f75
A
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.
1c79356b 11 *
e5568f75
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
e5568f75
A
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.
1c79356b
A
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{
55e303ae
A
738 if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) {
739 char *tmp = ap->a_cnp->cn_pnbuf;
740 ap->a_cnp->cn_pnbuf = NULL;
741 ap->a_cnp->cn_flags &= ~HASBUF;
742 FREE_ZONE(tmp, ap->a_cnp->cn_pnlen, M_NAMEI);
743 }
744
1c79356b
A
745 return (0);
746}
747
748int
749err_abortop(struct vop_abortop_args *ap)
750{
751 (void)nop_abortop(ap);
752 return (EOPNOTSUPP);
753}
754
755
756struct vop_inactive_args /* {
757 struct vnode *a_vp;
758 struct proc *a_p;
759} */;
760
761int
762nop_inactive(struct vop_inactive_args *ap)
763{
764 VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
765 return (0);
766}
767
768int
769err_inactive(struct vop_inactive_args *ap)
770{
771 (void)nop_inactive(ap);
772 return (EOPNOTSUPP);
773}
774
775
776struct vop_reclaim_args /* {
777 struct vnode *a_vp;
778 struct proc *a_p;
779} */;
780
781int
782nop_reclaim(struct vop_reclaim_args *ap)
783{
784 return (0);
785}
786
787int
788err_reclaim(struct vop_reclaim_args *ap)
789{
790 return (EOPNOTSUPP);
791}
792
793
794struct vop_lock_args /* {
795 struct vnode *a_vp;
796 int a_flags;
797 struct proc *a_p;
798} */;
799
800int
801nop_lock(struct vop_lock_args *ap)
802{
803 return (vop_nolock(ap));
804}
805
806int
807err_lock(struct vop_lock_args *ap)
808{
809 (void)nop_lock(ap);
810 return (EOPNOTSUPP);
811}
812
813
814struct vop_unlock_args /* {
815 struct vnode *a_vp;
816 int a_flags;
817 struct proc *a_p;
818} */;
819
820int
821nop_unlock(struct vop_unlock_args *ap)
822{
823 return (vop_nounlock(ap));
824}
825
826int
827err_unlock(struct vop_unlock_args *ap)
828{
829 (void)nop_unlock(ap);
830 return (EOPNOTSUPP);
831}
832
833
834struct vop_bmap_args /* {
835 struct vnode *vp;
836 daddr_t bn;
837 struct vnode **vpp;
838 daddr_t *bnp;
839 int *runp;
840} */;
841
842int
843nop_bmap(struct vop_bmap_args *ap)
844{
845 return (0);
846}
847
848int
849err_bmap(struct vop_bmap_args *ap)
850{
851 return (EOPNOTSUPP);
852}
853
854
855struct vop_strategy_args /* {
856 struct buf *a_bp;
857} */;
858
859int
860nop_strategy(struct vop_strategy_args *ap)
861{
862 return (0);
863}
864
865int
866err_strategy(struct vop_strategy_args *ap)
867{
868 return (EOPNOTSUPP);
869}
870
871
872struct vop_print_args /* {
873 struct vnode *a_vp;
874} */;
875
876int
877nop_print(struct vop_print_args *ap)
878{
879 return (0);
880}
881
882int
883err_print(struct vop_print_args *ap)
884{
885 return (EOPNOTSUPP);
886}
887
888
889struct vop_islocked_args /* {
890 struct vnode *a_vp;
891} */;
892
893int
894nop_islocked(struct vop_islocked_args *ap)
895{
896 return (vop_noislocked(ap));
897}
898
899int
900err_islocked(struct vop_islocked_args *ap)
901{
902 (void)nop_islocked(ap);
903 return (EOPNOTSUPP);
904}
905
906
907struct vop_pathconf_args /* {
908 struct vnode *a_vp;
909 int a_name;
910 register_t *a_retval;
911} */;
912
913int
914nop_pathconf(struct vop_pathconf_args *ap)
915{
916 return (0);
917}
918
919int
920err_pathconf(struct vop_pathconf_args *ap)
921{
922 return (EOPNOTSUPP);
923}
924
925
926struct vop_advlock_args /* {
927 struct vnode *a_vp;
928 caddr_t a_id;
929 int a_op;
930 struct flock *a_fl;
931 int a_flags;
932} */;
933
934int
935nop_advlock(struct vop_advlock_args *ap)
936{
937 return (0);
938}
939
940int
941err_advlock(struct vop_advlock_args *ap)
942{
943 return (EOPNOTSUPP);
944}
945
946
947struct vop_blkatoff_args /* {
948 struct vnode *a_vp;
949 off_t a_offset;
950 char **a_res;
951 struct buf **a_bpp;
952} */;
953
954int
955nop_blkatoff(struct vop_blkatoff_args *ap)
956{
957 *ap->a_bpp = NULL;
958 return (0);
959}
960
961int
962err_blkatoff(struct vop_blkatoff_args *ap)
963{
964 (void)nop_blkatoff(ap);
965 return (EOPNOTSUPP);
966}
967
968
969struct vop_valloc_args /* {
970 struct vnode *a_pvp;
971 int a_mode;
972 struct ucred *a_cred;
973 struct vnode **a_vpp;
974} */;
975
976int
977nop_valloc(struct vop_valloc_args *ap)
978{
979 *ap->a_vpp = NULL;
980 return (0);
981}
982
983int
984err_valloc(struct vop_valloc_args *ap)
985{
986 (void)nop_valloc(ap);
987 return (EOPNOTSUPP);
988}
989
990
991struct vop_reallocblks_args /* {
992 struct vnode *a_vp;
993 struct cluster_save *a_buflist;
994} */;
995
996int
997nop_reallocblks(struct vop_reallocblks_args *ap)
998{
999 return (0);
1000}
1001
1002int
1003err_reallocblks(struct vop_reallocblks_args *ap)
1004{
1005 return (EOPNOTSUPP);
1006}
1007
1008
1009struct vop_vfree_args /* {
1010 struct vnode *a_pvp;
1011 ino_t a_ino;
1012 int a_mode;
1013} */;
1014
1015int
1016nop_vfree(struct vop_vfree_args *ap)
1017{
1018 return (0);
1019}
1020
1021int
1022err_vfree(struct vop_vfree_args *ap)
1023{
1024 return (EOPNOTSUPP);
1025}
1026
1027
1028struct vop_truncate_args /* {
1029 struct vnode *a_vp;
1030 off_t a_length;
1031 int a_flags;
1032 struct ucred *a_cred;
1033 struct proc *a_p;
1034} */;
1035
1036int
1037nop_truncate(struct vop_truncate_args *ap)
1038{
1039 return (0);
1040}
1041
1042int
1043err_truncate(struct vop_truncate_args *ap)
1044{
1045 return (EOPNOTSUPP);
1046}
1047
1048
1049struct vop_allocate_args /* {
1050 struct vnode *a_vp;
1051 off_t a_length;
1052 u_int32_t a_flags;
1053 off_t *a_bytesallocated;
0b4e3aa0 1054 off_t a_offset;
1c79356b
A
1055 struct ucred *a_cred;
1056 struct proc *a_p;
1057} */;
1058
1059int
1060nop_allocate(struct vop_allocate_args *ap)
1061{
1062 *(ap->a_bytesallocated) = 0;
1063 return (0);
1064}
1065
1066int
1067err_allocate(struct vop_allocate_args *ap)
1068{
1069 (void)nop_allocate(ap);
1070 return (EOPNOTSUPP);
1071}
1072
1073
1074struct vop_update_args /* {
1075 struct vnode *a_vp;
1076 struct timeval *a_access;
1077 struct timeval *a_modify;
1078 int a_waitfor;
1079} */;
1080
1081int
1082nop_update(struct vop_update_args *ap)
1083{
1084 return (0);
1085}
1086
1087int
1088err_update(struct vop_update_args *ap)
1089{
1090 return (EOPNOTSUPP);
1091}
1092
1093
1094struct vop_pgrd_args /* {
1095 struct vnode *a_vp;
1096 struct uio *a_uio;
1097 struct ucred *a_cred;
1098} */;
1099
1100int
1101nop_pgrd(struct vop_pgrd_args *ap)
1102{
1103 return (0);
1104}
1105
1106int
1107err_pgrd(struct vop_pgrd_args *ap)
1108{
1109 return (EOPNOTSUPP);
1110}
1111
1112
1113struct vop_pgwr_args /* {
1114 struct vnode *a_vp;
1115 struct uio *a_uio;
1116 struct ucred *a_cred;
1117 vm_offset_t a_offset;
1118} */;
1119
1120int
1121nop_pgwr(struct vop_pgwr_args *ap)
1122{
1123 return (0);
1124}
1125
1126int
1127err_pgwr(struct vop_pgwr_args *ap)
1128{
1129 return (EOPNOTSUPP);
1130}
1131
1132
1133struct vop_bwrite_args /* {
1134 struct buf *a_bp;
1135} */;
1136
1137int
1138nop_bwrite(struct vop_bwrite_args *ap)
1139{
1140 return (bwrite(ap->a_bp));
1141}
1142
1143int
1144err_bwrite(struct vop_bwrite_args *ap)
1145{
1146 return (EOPNOTSUPP);
1147}
1148
1149
1150struct vop_pagein_args /* {
1151 struct vnode *a_vp,
1152 upl_t a_pl,
1153 vm_offset_t a_pl_offset,
1154 off_t a_foffset,
1155 size_t a_size,
1156 struct ucred *a_cred,
1157 int a_flags
1158} */;
1159
1160int
1161nop_pagein(struct vop_pagein_args *ap)
1162{
0b4e3aa0 1163 ubc_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1c79356b
A
1164 return (0);
1165}
1166
1167int
1168err_pagein(struct vop_pagein_args *ap)
1169{
0b4e3aa0 1170 ubc_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1c79356b
A
1171 return (EOPNOTSUPP);
1172}
1173
1174
1175struct vop_pageout_args /* {
1176 struct vnode *a_vp,
1177 upl_t a_pl,
1178 vm_offset_t a_pl_offset,
1179 off_t a_foffset,
1180 size_t a_size,
1181 struct ucred *a_cred,
1182 int a_flags
1183} */;
1184
1185int
1186nop_pageout(struct vop_pageout_args *ap)
1187{
0b4e3aa0 1188 ubc_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1c79356b
A
1189 return (0);
1190}
1191
1192int
1193err_pageout(struct vop_pageout_args *ap)
1194{
0b4e3aa0 1195 ubc_upl_abort(ap->a_pl, UPL_ABORT_ERROR);
1c79356b
A
1196 return (EOPNOTSUPP);
1197}
1198
1199
1200struct vop_devblocksize_args /* {
1201 struct vnode *a_vp;
1202 register_t *a_retval;
1203} */;
1204
1205int
1206nop_devblocksize(struct vop_devblocksize_args *ap)
1207{
1208 /* XXX default value because the call sites do not check error */
1209 *ap->a_retval = 512;
1210 return (0);
1211}
1212
1213int
1214err_devblocksize(struct vop_devblocksize_args *ap)
1215{
1216 (void)nop_devblocksize(ap);
1217 return (EOPNOTSUPP);
1218}
1219
1220
1221struct vop_searchfs /* {
1222 struct vnode *a_vp;
1223 void *a_searchparams1;
1224 void *a_searchparams2;
1225 struct attrlist *a_searchattrs;
1226 u_long a_maxmatches;
1227 struct timeval *a_timelimit;
1228 struct attrlist *a_returnattrs;
1229 u_long *a_nummatches;
1230 u_long a_scriptcode;
1231 u_long a_options;
1232 struct uio *a_uio;
1233 struct searchstate *a_searchstate;
1234} */;
1235
1236int
1237nop_searchfs(struct vop_searchfs_args *ap)
1238{
1239 *(ap->a_nummatches) = 0;
1240 return (0);
1241}
1242
1243int
1244err_searchfs(struct vop_searchfs_args *ap)
1245{
1246 (void)nop_searchfs(ap);
1247 return (EOPNOTSUPP);
1248}
1249
1250struct vop_copyfile_args /*{
1251 struct vnodeop_desc *a_desc;
1252 struct vnode *a_fvp;
1253 struct vnode *a_tdvp;
1254 struct vnode *a_tvp;
1255 struct componentname *a_tcnp;
1256 int a_flags;
1257}*/;
1258
1259int
1260nop_copyfile(struct vop_copyfile_args *ap)
1261{
1262 if (ap->a_tdvp == ap->a_tvp)
1263 vrele(ap->a_tdvp);
1264 else
1265 vput(ap->a_tdvp);
1266 if (ap->a_tvp)
1267 vput(ap->a_tvp);
1268 vrele(ap->a_fvp);
1269 return (0);
1270}
1271
1272
1273int
1274err_copyfile(struct vop_copyfile_args *ap)
1275{
1276 (void)nop_copyfile(ap);
1277 return (EOPNOTSUPP);
1278}
1279
1280
1281struct vop_blktooff_args /* {
1282 struct vnode *a_vp;
1283 daddr_t a_lblkno;
1284 off_t *a_offset;
1285} */;
1286
1287int
1288nop_blktooff(struct vop_blktooff_args *ap)
1289{
1290 *ap->a_offset = (off_t)-1; /* failure */
1291 return (0);
1292}
1293
1294int
1295err_blktooff(struct vop_blktooff_args *ap)
1296{
1297 (void)nop_blktooff(ap);
1298 return (EOPNOTSUPP);
1299}
1300
1301struct vop_offtoblk_args /* {
1302 struct vnode *a_vp;
1303 off_t a_offset;
1304 daddr_t *a_lblkno;
1305} */;
1306
1307int
1308nop_offtoblk(struct vop_offtoblk_args *ap)
1309{
1310 *ap->a_lblkno = (daddr_t)-1; /* failure */
1311 return (0);
1312}
1313
1314int
1315err_offtoblk(struct vop_offtoblk_args *ap)
1316{
1317 (void)nop_offtoblk(ap);
1318 return (EOPNOTSUPP);
1319}
1320
1321struct vop_cmap_args /* {
1322 struct vnode *a_vp;
1323 off_t a_foffset;
1324 size_t a_size;
1325 daddr_t *a_bpn;
1326 size_t *a_run;
1327 void *a_poff;
1328} */;
1329
1330int nop_cmap(struct vop_cmap_args *ap)
1331{
1332 return (0);
1333}
1334
1335int err_cmap(struct vop_cmap_args *ap)
1336{
1337 return (EOPNOTSUPP);
1338}
1339