]>
Commit | Line | Data |
---|---|---|
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 | ||
48 | struct 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 | ||
55 | int | |
56 | nop_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 | ||
67 | int | |
68 | err_create(struct vop_create_args *ap) | |
69 | { | |
70 | (void)nop_create(ap); | |
71 | return (EOPNOTSUPP); | |
72 | } | |
73 | ||
74 | ||
75 | struct vop_whiteout_args /* { | |
76 | struct vnode *a_dvp; | |
77 | struct componentname *a_cnp; | |
78 | int a_flags; | |
79 | } */; | |
80 | ||
81 | int | |
82 | nop_whiteout(struct vop_whiteout_args *ap) | |
83 | { | |
84 | return (0); | |
85 | } | |
86 | ||
87 | int | |
88 | err_whiteout(struct vop_whiteout_args *ap) | |
89 | { | |
90 | return (EOPNOTSUPP); | |
91 | } | |
92 | ||
93 | ||
94 | struct 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 | ||
101 | int | |
102 | nop_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 | ||
113 | int | |
114 | err_mknod(struct vop_mknod_args *ap) | |
115 | { | |
116 | (void)nop_mknod(ap); | |
117 | return (EOPNOTSUPP); | |
118 | } | |
119 | ||
120 | ||
121 | struct 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 | ||
129 | int | |
130 | nop_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 | ||
141 | int | |
142 | err_mkcomplex(struct vop_mkcomplex_args *ap) | |
143 | { | |
144 | (void)nop_mkcomplex(ap); | |
145 | return (EOPNOTSUPP); | |
146 | } | |
147 | ||
148 | ||
149 | struct vop_open_args /* { | |
150 | struct vnode *a_vp; | |
151 | int a_mode; | |
152 | struct ucred *a_cred; | |
153 | struct proc *a_p; | |
154 | } */; | |
155 | ||
156 | int | |
157 | nop_open(struct vop_open_args *ap) | |
158 | { | |
159 | return (0); | |
160 | } | |
161 | ||
162 | int | |
163 | err_open(struct vop_open_args *ap) | |
164 | { | |
165 | return (EOPNOTSUPP); | |
166 | } | |
167 | ||
168 | ||
169 | struct vop_close_args /* { | |
170 | struct vnode *a_vp; | |
171 | int a_fflag; | |
172 | struct ucred *a_cred; | |
173 | struct proc *a_p; | |
174 | } */; | |
175 | ||
176 | int | |
177 | nop_close(struct vop_close_args *ap) | |
178 | { | |
179 | return (0); | |
180 | } | |
181 | ||
182 | int | |
183 | err_close(struct vop_close_args *ap) | |
184 | { | |
185 | return (EOPNOTSUPP); | |
186 | } | |
187 | ||
188 | ||
189 | struct vop_access_args /* { | |
190 | struct vnode *a_vp; | |
191 | int a_mode; | |
192 | struct ucred *a_cred; | |
193 | struct proc *a_p; | |
194 | } */; | |
195 | ||
196 | int | |
197 | nop_access(struct vop_access_args *ap) | |
198 | { | |
199 | return (0); | |
200 | } | |
201 | ||
202 | int | |
203 | err_access(struct vop_access_args *ap) | |
204 | { | |
205 | return (EOPNOTSUPP); | |
206 | } | |
207 | ||
208 | ||
209 | struct 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 | ||
216 | int | |
217 | nop_getattr(struct vop_getattr_args *ap) | |
218 | { | |
219 | return (0); | |
220 | } | |
221 | ||
222 | int | |
223 | err_getattr(struct vop_getattr_args *ap) | |
224 | { | |
225 | return (EOPNOTSUPP); | |
226 | } | |
227 | ||
228 | ||
229 | struct 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 | ||
236 | int | |
237 | nop_setattr(struct vop_setattr_args *ap) | |
238 | { | |
239 | return (0); | |
240 | } | |
241 | ||
242 | int | |
243 | err_setattr(struct vop_setattr_args *ap) | |
244 | { | |
245 | return (EOPNOTSUPP); | |
246 | } | |
247 | ||
248 | ||
249 | struct 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 | ||
257 | int | |
258 | nop_getattrlist(struct vop_getattrlist_args *ap) | |
259 | { | |
260 | return (0); | |
261 | } | |
262 | ||
263 | int | |
264 | err_getattrlist(struct vop_getattrlist_args *ap) | |
265 | { | |
266 | return (EOPNOTSUPP); | |
267 | } | |
268 | ||
269 | ||
270 | struct 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 | ||
278 | int | |
279 | nop_setattrlist(struct vop_setattrlist_args *ap) | |
280 | { | |
281 | return (0); | |
282 | } | |
283 | ||
284 | int | |
285 | err_setattrlist(struct vop_setattrlist_args *ap) | |
286 | { | |
287 | return (EOPNOTSUPP); | |
288 | } | |
289 | ||
290 | ||
291 | struct vop_read_args /* { | |
292 | struct vnode *a_vp; | |
293 | struct uio *a_uio; | |
294 | int a_ioflag; | |
295 | struct ucred *a_cred; | |
296 | } */; | |
297 | ||
298 | int | |
299 | nop_read(struct vop_read_args *ap) | |
300 | { | |
301 | return (0); | |
302 | } | |
303 | ||
304 | int | |
305 | err_read(struct vop_read_args *ap) | |
306 | { | |
307 | return (EOPNOTSUPP); | |
308 | } | |
309 | ||
310 | ||
311 | struct vop_write_args /* { | |
312 | struct vnode *a_vp; | |
313 | struct uio *a_uio; | |
314 | int a_ioflag; | |
315 | struct ucred *a_cred; | |
316 | } */; | |
317 | ||
318 | int | |
319 | nop_write(struct vop_write_args *ap) | |
320 | { | |
321 | return (0); | |
322 | } | |
323 | ||
324 | int | |
325 | err_write(struct vop_write_args *ap) | |
326 | { | |
327 | return (EOPNOTSUPP); | |
328 | } | |
329 | ||
330 | ||
331 | struct vop_lease_args /* { | |
332 | struct vnode *a_vp; | |
333 | struct proc *a_p; | |
334 | struct ucred *a_cred; | |
335 | int a_flag; | |
336 | } */; | |
337 | ||
338 | int | |
339 | nop_lease(struct vop_lease_args *ap) | |
340 | { | |
341 | return (0); | |
342 | } | |
343 | ||
344 | int | |
345 | err_lease(struct vop_lease_args *ap) | |
346 | { | |
347 | return (EOPNOTSUPP); | |
348 | } | |
349 | ||
350 | ||
351 | struct 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 | ||
360 | int | |
361 | nop_ioctl(struct vop_ioctl_args *ap) | |
362 | { | |
363 | return (0); | |
364 | } | |
365 | ||
366 | int | |
367 | err_ioctl(struct vop_ioctl_args *ap) | |
368 | { | |
369 | return (EOPNOTSUPP); | |
370 | } | |
371 | ||
372 | ||
373 | struct 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 | ||
382 | int | |
383 | nop_select(struct vop_select_args *ap) | |
384 | { | |
385 | return (0); | |
386 | } | |
387 | ||
388 | int | |
389 | err_select(struct vop_select_args *ap) | |
390 | { | |
391 | return (EOPNOTSUPP); | |
392 | } | |
393 | ||
394 | ||
395 | struct 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 | ||
402 | int | |
403 | nop_exchange(struct vop_exchange_args *ap) | |
404 | { | |
405 | return (0); | |
406 | } | |
407 | ||
408 | int | |
409 | err_exchange(struct vop_exchange_args *ap) | |
410 | { | |
411 | return (EOPNOTSUPP); | |
412 | } | |
413 | ||
414 | ||
415 | struct vop_revoke_args /* { | |
416 | struct vnode *a_vp; | |
417 | int a_flags; | |
418 | } */; | |
419 | ||
420 | int | |
421 | nop_revoke(struct vop_revoke_args *ap) | |
422 | { | |
423 | return (vop_revoke(ap)); | |
424 | } | |
425 | ||
426 | int | |
427 | err_revoke(struct vop_revoke_args *ap) | |
428 | { | |
429 | (void)nop_revoke(ap); | |
430 | return (EOPNOTSUPP); | |
431 | } | |
432 | ||
433 | ||
434 | struct vop_mmap_args /* { | |
435 | struct vnode *a_vp; | |
436 | int a_fflags; | |
437 | struct ucred *a_cred; | |
438 | struct proc *a_p; | |
439 | } */; | |
440 | ||
441 | int | |
442 | nop_mmap(struct vop_mmap_args *ap) | |
443 | { | |
444 | return (0); | |
445 | } | |
446 | ||
447 | int | |
448 | err_mmap(struct vop_mmap_args *ap) | |
449 | { | |
450 | return (EOPNOTSUPP); | |
451 | } | |
452 | ||
453 | ||
454 | struct vop_fsync_args /* { | |
455 | struct vnode *a_vp; | |
456 | struct ucred *a_cred; | |
457 | int a_waitfor; | |
458 | struct proc *a_p; | |
459 | } */; | |
460 | ||
461 | int | |
462 | nop_fsync(struct vop_fsync_args *ap) | |
463 | { | |
464 | return (0); | |
465 | } | |
466 | ||
467 | int | |
468 | err_fsync(struct vop_fsync_args *ap) | |
469 | { | |
470 | return (EOPNOTSUPP); | |
471 | } | |
472 | ||
473 | ||
474 | struct 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 | ||
481 | int | |
482 | nop_seek(struct vop_seek_args *ap) | |
483 | { | |
484 | return (0); | |
485 | } | |
486 | ||
487 | int | |
488 | err_seek(struct vop_seek_args *ap) | |
489 | { | |
490 | return (EOPNOTSUPP); | |
491 | } | |
492 | ||
493 | ||
494 | struct vop_remove_args /* { | |
495 | struct vnode *a_dvp; | |
496 | struct vnode *a_vp; | |
497 | struct componentname *a_cnp; | |
498 | } */; | |
499 | ||
500 | int | |
501 | nop_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 | ||
511 | int | |
512 | err_remove(struct vop_remove_args *ap) | |
513 | { | |
514 | (void)nop_remove(ap); | |
515 | return (EOPNOTSUPP); | |
516 | } | |
517 | ||
518 | ||
519 | struct vop_link_args /* { | |
520 | struct vnode *a_vp; | |
521 | struct vnode *a_tdvp; | |
522 | struct componentname *a_cnp; | |
523 | } */; | |
524 | ||
525 | int | |
526 | nop_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 | ||
537 | int | |
538 | err_link(struct vop_link_args *ap) | |
539 | { | |
540 | (void)nop_link(ap); | |
541 | return (EOPNOTSUPP); | |
542 | } | |
543 | ||
544 | ||
545 | struct 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 | ||
554 | int | |
555 | nop_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 | ||
575 | int | |
576 | err_rename(struct vop_rename_args *ap) | |
577 | { | |
578 | (void)nop_rename(ap); | |
579 | return (EOPNOTSUPP); | |
580 | } | |
581 | ||
582 | ||
583 | struct 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 | ||
590 | int | |
591 | nop_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 | ||
602 | int | |
603 | err_mkdir(struct vop_mkdir_args *ap) | |
604 | { | |
605 | (void)nop_mkdir(ap); | |
606 | return (EOPNOTSUPP); | |
607 | } | |
608 | ||
609 | ||
610 | struct vop_rmdir_args /* { | |
611 | struct vnode *a_dvp; | |
612 | struct vnode *a_vp; | |
613 | struct componentname *a_cnp; | |
614 | } */; | |
615 | ||
616 | int | |
617 | nop_rmdir(struct vop_rmdir_args *ap) | |
618 | { | |
619 | vput(ap->a_dvp); | |
620 | vput(ap->a_vp); | |
621 | return (0); | |
622 | } | |
623 | ||
624 | int | |
625 | err_rmdir(struct vop_rmdir_args *ap) | |
626 | { | |
627 | (void)nop_rmdir(ap); | |
628 | return (EOPNOTSUPP); | |
629 | } | |
630 | ||
631 | ||
632 | struct 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 | ||
640 | int | |
641 | nop_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 | ||
652 | int | |
653 | err_symlink(struct vop_symlink_args *ap) | |
654 | { | |
655 | (void)nop_symlink(ap); | |
656 | return (EOPNOTSUPP); | |
657 | } | |
658 | ||
659 | ||
660 | struct 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 | ||
669 | int | |
670 | nop_readdir(struct vop_readdir_args *ap) | |
671 | { | |
672 | return (0); | |
673 | } | |
674 | ||
675 | int | |
676 | err_readdir(struct vop_readdir_args *ap) | |
677 | { | |
678 | return (EOPNOTSUPP); | |
679 | } | |
680 | ||
681 | ||
682 | struct 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 | ||
695 | int | |
696 | nop_readdirattr(struct vop_readdirattr_args *ap) | |
697 | { | |
698 | *(ap->a_actualcount) = 0; | |
699 | *(ap->a_eofflag) = 0; | |
700 | return (0); | |
701 | } | |
702 | ||
703 | int | |
704 | err_readdirattr(struct vop_readdirattr_args *ap) | |
705 | { | |
706 | (void)nop_readdirattr(ap); | |
707 | return (EOPNOTSUPP); | |
708 | } | |
709 | ||
710 | ||
711 | struct vop_readlink_args /* { | |
712 | struct vnode *vp; | |
713 | struct uio *uio; | |
714 | struct ucred *cred; | |
715 | } */; | |
716 | ||
717 | int | |
718 | nop_readlink(struct vop_readlink_args *ap) | |
719 | { | |
720 | return (0); | |
721 | } | |
722 | ||
723 | int | |
724 | err_readlink(struct vop_readlink_args *ap) | |
725 | { | |
726 | return (EOPNOTSUPP); | |
727 | } | |
728 | ||
729 | ||
730 | struct vop_abortop_args /* { | |
731 | struct vnode *a_dvp; | |
732 | struct componentname *a_cnp; | |
733 | } */; | |
734 | ||
735 | int | |
736 | nop_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 | ||
743 | int | |
744 | err_abortop(struct vop_abortop_args *ap) | |
745 | { | |
746 | (void)nop_abortop(ap); | |
747 | return (EOPNOTSUPP); | |
748 | } | |
749 | ||
750 | ||
751 | struct vop_inactive_args /* { | |
752 | struct vnode *a_vp; | |
753 | struct proc *a_p; | |
754 | } */; | |
755 | ||
756 | int | |
757 | nop_inactive(struct vop_inactive_args *ap) | |
758 | { | |
759 | VOP_UNLOCK(ap->a_vp, 0, ap->a_p); | |
760 | return (0); | |
761 | } | |
762 | ||
763 | int | |
764 | err_inactive(struct vop_inactive_args *ap) | |
765 | { | |
766 | (void)nop_inactive(ap); | |
767 | return (EOPNOTSUPP); | |
768 | } | |
769 | ||
770 | ||
771 | struct vop_reclaim_args /* { | |
772 | struct vnode *a_vp; | |
773 | struct proc *a_p; | |
774 | } */; | |
775 | ||
776 | int | |
777 | nop_reclaim(struct vop_reclaim_args *ap) | |
778 | { | |
779 | return (0); | |
780 | } | |
781 | ||
782 | int | |
783 | err_reclaim(struct vop_reclaim_args *ap) | |
784 | { | |
785 | return (EOPNOTSUPP); | |
786 | } | |
787 | ||
788 | ||
789 | struct vop_lock_args /* { | |
790 | struct vnode *a_vp; | |
791 | int a_flags; | |
792 | struct proc *a_p; | |
793 | } */; | |
794 | ||
795 | int | |
796 | nop_lock(struct vop_lock_args *ap) | |
797 | { | |
798 | return (vop_nolock(ap)); | |
799 | } | |
800 | ||
801 | int | |
802 | err_lock(struct vop_lock_args *ap) | |
803 | { | |
804 | (void)nop_lock(ap); | |
805 | return (EOPNOTSUPP); | |
806 | } | |
807 | ||
808 | ||
809 | struct vop_unlock_args /* { | |
810 | struct vnode *a_vp; | |
811 | int a_flags; | |
812 | struct proc *a_p; | |
813 | } */; | |
814 | ||
815 | int | |
816 | nop_unlock(struct vop_unlock_args *ap) | |
817 | { | |
818 | return (vop_nounlock(ap)); | |
819 | } | |
820 | ||
821 | int | |
822 | err_unlock(struct vop_unlock_args *ap) | |
823 | { | |
824 | (void)nop_unlock(ap); | |
825 | return (EOPNOTSUPP); | |
826 | } | |
827 | ||
828 | ||
829 | struct vop_bmap_args /* { | |
830 | struct vnode *vp; | |
831 | daddr_t bn; | |
832 | struct vnode **vpp; | |
833 | daddr_t *bnp; | |
834 | int *runp; | |
835 | } */; | |
836 | ||
837 | int | |
838 | nop_bmap(struct vop_bmap_args *ap) | |
839 | { | |
840 | return (0); | |
841 | } | |
842 | ||
843 | int | |
844 | err_bmap(struct vop_bmap_args *ap) | |
845 | { | |
846 | return (EOPNOTSUPP); | |
847 | } | |
848 | ||
849 | ||
850 | struct vop_strategy_args /* { | |
851 | struct buf *a_bp; | |
852 | } */; | |
853 | ||
854 | int | |
855 | nop_strategy(struct vop_strategy_args *ap) | |
856 | { | |
857 | return (0); | |
858 | } | |
859 | ||
860 | int | |
861 | err_strategy(struct vop_strategy_args *ap) | |
862 | { | |
863 | return (EOPNOTSUPP); | |
864 | } | |
865 | ||
866 | ||
867 | struct vop_print_args /* { | |
868 | struct vnode *a_vp; | |
869 | } */; | |
870 | ||
871 | int | |
872 | nop_print(struct vop_print_args *ap) | |
873 | { | |
874 | return (0); | |
875 | } | |
876 | ||
877 | int | |
878 | err_print(struct vop_print_args *ap) | |
879 | { | |
880 | return (EOPNOTSUPP); | |
881 | } | |
882 | ||
883 | ||
884 | struct vop_islocked_args /* { | |
885 | struct vnode *a_vp; | |
886 | } */; | |
887 | ||
888 | int | |
889 | nop_islocked(struct vop_islocked_args *ap) | |
890 | { | |
891 | return (vop_noislocked(ap)); | |
892 | } | |
893 | ||
894 | int | |
895 | err_islocked(struct vop_islocked_args *ap) | |
896 | { | |
897 | (void)nop_islocked(ap); | |
898 | return (EOPNOTSUPP); | |
899 | } | |
900 | ||
901 | ||
902 | struct vop_pathconf_args /* { | |
903 | struct vnode *a_vp; | |
904 | int a_name; | |
905 | register_t *a_retval; | |
906 | } */; | |
907 | ||
908 | int | |
909 | nop_pathconf(struct vop_pathconf_args *ap) | |
910 | { | |
911 | return (0); | |
912 | } | |
913 | ||
914 | int | |
915 | err_pathconf(struct vop_pathconf_args *ap) | |
916 | { | |
917 | return (EOPNOTSUPP); | |
918 | } | |
919 | ||
920 | ||
921 | struct 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 | ||
929 | int | |
930 | nop_advlock(struct vop_advlock_args *ap) | |
931 | { | |
932 | return (0); | |
933 | } | |
934 | ||
935 | int | |
936 | err_advlock(struct vop_advlock_args *ap) | |
937 | { | |
938 | return (EOPNOTSUPP); | |
939 | } | |
940 | ||
941 | ||
942 | struct vop_blkatoff_args /* { | |
943 | struct vnode *a_vp; | |
944 | off_t a_offset; | |
945 | char **a_res; | |
946 | struct buf **a_bpp; | |
947 | } */; | |
948 | ||
949 | int | |
950 | nop_blkatoff(struct vop_blkatoff_args *ap) | |
951 | { | |
952 | *ap->a_bpp = NULL; | |
953 | return (0); | |
954 | } | |
955 | ||
956 | int | |
957 | err_blkatoff(struct vop_blkatoff_args *ap) | |
958 | { | |
959 | (void)nop_blkatoff(ap); | |
960 | return (EOPNOTSUPP); | |
961 | } | |
962 | ||
963 | ||
964 | struct vop_valloc_args /* { | |
965 | struct vnode *a_pvp; | |
966 | int a_mode; | |
967 | struct ucred *a_cred; | |
968 | struct vnode **a_vpp; | |
969 | } */; | |
970 | ||
971 | int | |
972 | nop_valloc(struct vop_valloc_args *ap) | |
973 | { | |
974 | *ap->a_vpp = NULL; | |
975 | return (0); | |
976 | } | |
977 | ||
978 | int | |
979 | err_valloc(struct vop_valloc_args *ap) | |
980 | { | |
981 | (void)nop_valloc(ap); | |
982 | return (EOPNOTSUPP); | |
983 | } | |
984 | ||
985 | ||
986 | struct vop_reallocblks_args /* { | |
987 | struct vnode *a_vp; | |
988 | struct cluster_save *a_buflist; | |
989 | } */; | |
990 | ||
991 | int | |
992 | nop_reallocblks(struct vop_reallocblks_args *ap) | |
993 | { | |
994 | return (0); | |
995 | } | |
996 | ||
997 | int | |
998 | err_reallocblks(struct vop_reallocblks_args *ap) | |
999 | { | |
1000 | return (EOPNOTSUPP); | |
1001 | } | |
1002 | ||
1003 | ||
1004 | struct vop_vfree_args /* { | |
1005 | struct vnode *a_pvp; | |
1006 | ino_t a_ino; | |
1007 | int a_mode; | |
1008 | } */; | |
1009 | ||
1010 | int | |
1011 | nop_vfree(struct vop_vfree_args *ap) | |
1012 | { | |
1013 | return (0); | |
1014 | } | |
1015 | ||
1016 | int | |
1017 | err_vfree(struct vop_vfree_args *ap) | |
1018 | { | |
1019 | return (EOPNOTSUPP); | |
1020 | } | |
1021 | ||
1022 | ||
1023 | struct 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 | ||
1031 | int | |
1032 | nop_truncate(struct vop_truncate_args *ap) | |
1033 | { | |
1034 | return (0); | |
1035 | } | |
1036 | ||
1037 | int | |
1038 | err_truncate(struct vop_truncate_args *ap) | |
1039 | { | |
1040 | return (EOPNOTSUPP); | |
1041 | } | |
1042 | ||
1043 | ||
1044 | struct 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 | ||
1054 | int | |
1055 | nop_allocate(struct vop_allocate_args *ap) | |
1056 | { | |
1057 | *(ap->a_bytesallocated) = 0; | |
1058 | return (0); | |
1059 | } | |
1060 | ||
1061 | int | |
1062 | err_allocate(struct vop_allocate_args *ap) | |
1063 | { | |
1064 | (void)nop_allocate(ap); | |
1065 | return (EOPNOTSUPP); | |
1066 | } | |
1067 | ||
1068 | ||
1069 | struct vop_update_args /* { | |
1070 | struct vnode *a_vp; | |
1071 | struct timeval *a_access; | |
1072 | struct timeval *a_modify; | |
1073 | int a_waitfor; | |
1074 | } */; | |
1075 | ||
1076 | int | |
1077 | nop_update(struct vop_update_args *ap) | |
1078 | { | |
1079 | return (0); | |
1080 | } | |
1081 | ||
1082 | int | |
1083 | err_update(struct vop_update_args *ap) | |
1084 | { | |
1085 | return (EOPNOTSUPP); | |
1086 | } | |
1087 | ||
1088 | ||
1089 | struct vop_pgrd_args /* { | |
1090 | struct vnode *a_vp; | |
1091 | struct uio *a_uio; | |
1092 | struct ucred *a_cred; | |
1093 | } */; | |
1094 | ||
1095 | int | |
1096 | nop_pgrd(struct vop_pgrd_args *ap) | |
1097 | { | |
1098 | return (0); | |
1099 | } | |
1100 | ||
1101 | int | |
1102 | err_pgrd(struct vop_pgrd_args *ap) | |
1103 | { | |
1104 | return (EOPNOTSUPP); | |
1105 | } | |
1106 | ||
1107 | ||
1108 | struct 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 | ||
1115 | int | |
1116 | nop_pgwr(struct vop_pgwr_args *ap) | |
1117 | { | |
1118 | return (0); | |
1119 | } | |
1120 | ||
1121 | int | |
1122 | err_pgwr(struct vop_pgwr_args *ap) | |
1123 | { | |
1124 | return (EOPNOTSUPP); | |
1125 | } | |
1126 | ||
1127 | ||
1128 | struct vop_bwrite_args /* { | |
1129 | struct buf *a_bp; | |
1130 | } */; | |
1131 | ||
1132 | int | |
1133 | nop_bwrite(struct vop_bwrite_args *ap) | |
1134 | { | |
1135 | return (bwrite(ap->a_bp)); | |
1136 | } | |
1137 | ||
1138 | int | |
1139 | err_bwrite(struct vop_bwrite_args *ap) | |
1140 | { | |
1141 | return (EOPNOTSUPP); | |
1142 | } | |
1143 | ||
1144 | ||
1145 | struct 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 | ||
1155 | int | |
1156 | nop_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 | ||
1162 | int | |
1163 | err_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 | ||
1170 | struct 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 | ||
1180 | int | |
1181 | nop_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 | ||
1187 | int | |
1188 | err_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 | ||
1195 | struct vop_devblocksize_args /* { | |
1196 | struct vnode *a_vp; | |
1197 | register_t *a_retval; | |
1198 | } */; | |
1199 | ||
1200 | int | |
1201 | nop_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 | ||
1208 | int | |
1209 | err_devblocksize(struct vop_devblocksize_args *ap) | |
1210 | { | |
1211 | (void)nop_devblocksize(ap); | |
1212 | return (EOPNOTSUPP); | |
1213 | } | |
1214 | ||
1215 | ||
1216 | struct 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 | ||
1231 | int | |
1232 | nop_searchfs(struct vop_searchfs_args *ap) | |
1233 | { | |
1234 | *(ap->a_nummatches) = 0; | |
1235 | return (0); | |
1236 | } | |
1237 | ||
1238 | int | |
1239 | err_searchfs(struct vop_searchfs_args *ap) | |
1240 | { | |
1241 | (void)nop_searchfs(ap); | |
1242 | return (EOPNOTSUPP); | |
1243 | } | |
1244 | ||
1245 | struct 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 | ||
1254 | int | |
1255 | nop_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 | ||
1268 | int | |
1269 | err_copyfile(struct vop_copyfile_args *ap) | |
1270 | { | |
1271 | (void)nop_copyfile(ap); | |
1272 | return (EOPNOTSUPP); | |
1273 | } | |
1274 | ||
1275 | ||
1276 | struct vop_blktooff_args /* { | |
1277 | struct vnode *a_vp; | |
1278 | daddr_t a_lblkno; | |
1279 | off_t *a_offset; | |
1280 | } */; | |
1281 | ||
1282 | int | |
1283 | nop_blktooff(struct vop_blktooff_args *ap) | |
1284 | { | |
1285 | *ap->a_offset = (off_t)-1; /* failure */ | |
1286 | return (0); | |
1287 | } | |
1288 | ||
1289 | int | |
1290 | err_blktooff(struct vop_blktooff_args *ap) | |
1291 | { | |
1292 | (void)nop_blktooff(ap); | |
1293 | return (EOPNOTSUPP); | |
1294 | } | |
1295 | ||
1296 | struct vop_offtoblk_args /* { | |
1297 | struct vnode *a_vp; | |
1298 | off_t a_offset; | |
1299 | daddr_t *a_lblkno; | |
1300 | } */; | |
1301 | ||
1302 | int | |
1303 | nop_offtoblk(struct vop_offtoblk_args *ap) | |
1304 | { | |
1305 | *ap->a_lblkno = (daddr_t)-1; /* failure */ | |
1306 | return (0); | |
1307 | } | |
1308 | ||
1309 | int | |
1310 | err_offtoblk(struct vop_offtoblk_args *ap) | |
1311 | { | |
1312 | (void)nop_offtoblk(ap); | |
1313 | return (EOPNOTSUPP); | |
1314 | } | |
1315 | ||
1316 | struct 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 | ||
1325 | int nop_cmap(struct vop_cmap_args *ap) | |
1326 | { | |
1327 | return (0); | |
1328 | } | |
1329 | ||
1330 | int err_cmap(struct vop_cmap_args *ap) | |
1331 | { | |
1332 | return (EOPNOTSUPP); | |
1333 | } | |
1334 |