]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | { | |
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 | ||
748 | int | |
749 | err_abortop(struct vop_abortop_args *ap) | |
750 | { | |
751 | (void)nop_abortop(ap); | |
752 | return (EOPNOTSUPP); | |
753 | } | |
754 | ||
755 | ||
756 | struct vop_inactive_args /* { | |
757 | struct vnode *a_vp; | |
758 | struct proc *a_p; | |
759 | } */; | |
760 | ||
761 | int | |
762 | nop_inactive(struct vop_inactive_args *ap) | |
763 | { | |
764 | VOP_UNLOCK(ap->a_vp, 0, ap->a_p); | |
765 | return (0); | |
766 | } | |
767 | ||
768 | int | |
769 | err_inactive(struct vop_inactive_args *ap) | |
770 | { | |
771 | (void)nop_inactive(ap); | |
772 | return (EOPNOTSUPP); | |
773 | } | |
774 | ||
775 | ||
776 | struct vop_reclaim_args /* { | |
777 | struct vnode *a_vp; | |
778 | struct proc *a_p; | |
779 | } */; | |
780 | ||
781 | int | |
782 | nop_reclaim(struct vop_reclaim_args *ap) | |
783 | { | |
784 | return (0); | |
785 | } | |
786 | ||
787 | int | |
788 | err_reclaim(struct vop_reclaim_args *ap) | |
789 | { | |
790 | return (EOPNOTSUPP); | |
791 | } | |
792 | ||
793 | ||
794 | struct vop_lock_args /* { | |
795 | struct vnode *a_vp; | |
796 | int a_flags; | |
797 | struct proc *a_p; | |
798 | } */; | |
799 | ||
800 | int | |
801 | nop_lock(struct vop_lock_args *ap) | |
802 | { | |
803 | return (vop_nolock(ap)); | |
804 | } | |
805 | ||
806 | int | |
807 | err_lock(struct vop_lock_args *ap) | |
808 | { | |
809 | (void)nop_lock(ap); | |
810 | return (EOPNOTSUPP); | |
811 | } | |
812 | ||
813 | ||
814 | struct vop_unlock_args /* { | |
815 | struct vnode *a_vp; | |
816 | int a_flags; | |
817 | struct proc *a_p; | |
818 | } */; | |
819 | ||
820 | int | |
821 | nop_unlock(struct vop_unlock_args *ap) | |
822 | { | |
823 | return (vop_nounlock(ap)); | |
824 | } | |
825 | ||
826 | int | |
827 | err_unlock(struct vop_unlock_args *ap) | |
828 | { | |
829 | (void)nop_unlock(ap); | |
830 | return (EOPNOTSUPP); | |
831 | } | |
832 | ||
833 | ||
834 | struct vop_bmap_args /* { | |
835 | struct vnode *vp; | |
836 | daddr_t bn; | |
837 | struct vnode **vpp; | |
838 | daddr_t *bnp; | |
839 | int *runp; | |
840 | } */; | |
841 | ||
842 | int | |
843 | nop_bmap(struct vop_bmap_args *ap) | |
844 | { | |
845 | return (0); | |
846 | } | |
847 | ||
848 | int | |
849 | err_bmap(struct vop_bmap_args *ap) | |
850 | { | |
851 | return (EOPNOTSUPP); | |
852 | } | |
853 | ||
854 | ||
855 | struct vop_strategy_args /* { | |
856 | struct buf *a_bp; | |
857 | } */; | |
858 | ||
859 | int | |
860 | nop_strategy(struct vop_strategy_args *ap) | |
861 | { | |
862 | return (0); | |
863 | } | |
864 | ||
865 | int | |
866 | err_strategy(struct vop_strategy_args *ap) | |
867 | { | |
868 | return (EOPNOTSUPP); | |
869 | } | |
870 | ||
871 | ||
872 | struct vop_print_args /* { | |
873 | struct vnode *a_vp; | |
874 | } */; | |
875 | ||
876 | int | |
877 | nop_print(struct vop_print_args *ap) | |
878 | { | |
879 | return (0); | |
880 | } | |
881 | ||
882 | int | |
883 | err_print(struct vop_print_args *ap) | |
884 | { | |
885 | return (EOPNOTSUPP); | |
886 | } | |
887 | ||
888 | ||
889 | struct vop_islocked_args /* { | |
890 | struct vnode *a_vp; | |
891 | } */; | |
892 | ||
893 | int | |
894 | nop_islocked(struct vop_islocked_args *ap) | |
895 | { | |
896 | return (vop_noislocked(ap)); | |
897 | } | |
898 | ||
899 | int | |
900 | err_islocked(struct vop_islocked_args *ap) | |
901 | { | |
902 | (void)nop_islocked(ap); | |
903 | return (EOPNOTSUPP); | |
904 | } | |
905 | ||
906 | ||
907 | struct vop_pathconf_args /* { | |
908 | struct vnode *a_vp; | |
909 | int a_name; | |
910 | register_t *a_retval; | |
911 | } */; | |
912 | ||
913 | int | |
914 | nop_pathconf(struct vop_pathconf_args *ap) | |
915 | { | |
916 | return (0); | |
917 | } | |
918 | ||
919 | int | |
920 | err_pathconf(struct vop_pathconf_args *ap) | |
921 | { | |
922 | return (EOPNOTSUPP); | |
923 | } | |
924 | ||
925 | ||
926 | struct 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 | ||
934 | int | |
935 | nop_advlock(struct vop_advlock_args *ap) | |
936 | { | |
937 | return (0); | |
938 | } | |
939 | ||
940 | int | |
941 | err_advlock(struct vop_advlock_args *ap) | |
942 | { | |
943 | return (EOPNOTSUPP); | |
944 | } | |
945 | ||
946 | ||
947 | struct vop_blkatoff_args /* { | |
948 | struct vnode *a_vp; | |
949 | off_t a_offset; | |
950 | char **a_res; | |
951 | struct buf **a_bpp; | |
952 | } */; | |
953 | ||
954 | int | |
955 | nop_blkatoff(struct vop_blkatoff_args *ap) | |
956 | { | |
957 | *ap->a_bpp = NULL; | |
958 | return (0); | |
959 | } | |
960 | ||
961 | int | |
962 | err_blkatoff(struct vop_blkatoff_args *ap) | |
963 | { | |
964 | (void)nop_blkatoff(ap); | |
965 | return (EOPNOTSUPP); | |
966 | } | |
967 | ||
968 | ||
969 | struct vop_valloc_args /* { | |
970 | struct vnode *a_pvp; | |
971 | int a_mode; | |
972 | struct ucred *a_cred; | |
973 | struct vnode **a_vpp; | |
974 | } */; | |
975 | ||
976 | int | |
977 | nop_valloc(struct vop_valloc_args *ap) | |
978 | { | |
979 | *ap->a_vpp = NULL; | |
980 | return (0); | |
981 | } | |
982 | ||
983 | int | |
984 | err_valloc(struct vop_valloc_args *ap) | |
985 | { | |
986 | (void)nop_valloc(ap); | |
987 | return (EOPNOTSUPP); | |
988 | } | |
989 | ||
990 | ||
991 | struct vop_reallocblks_args /* { | |
992 | struct vnode *a_vp; | |
993 | struct cluster_save *a_buflist; | |
994 | } */; | |
995 | ||
996 | int | |
997 | nop_reallocblks(struct vop_reallocblks_args *ap) | |
998 | { | |
999 | return (0); | |
1000 | } | |
1001 | ||
1002 | int | |
1003 | err_reallocblks(struct vop_reallocblks_args *ap) | |
1004 | { | |
1005 | return (EOPNOTSUPP); | |
1006 | } | |
1007 | ||
1008 | ||
1009 | struct vop_vfree_args /* { | |
1010 | struct vnode *a_pvp; | |
1011 | ino_t a_ino; | |
1012 | int a_mode; | |
1013 | } */; | |
1014 | ||
1015 | int | |
1016 | nop_vfree(struct vop_vfree_args *ap) | |
1017 | { | |
1018 | return (0); | |
1019 | } | |
1020 | ||
1021 | int | |
1022 | err_vfree(struct vop_vfree_args *ap) | |
1023 | { | |
1024 | return (EOPNOTSUPP); | |
1025 | } | |
1026 | ||
1027 | ||
1028 | struct 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 | ||
1036 | int | |
1037 | nop_truncate(struct vop_truncate_args *ap) | |
1038 | { | |
1039 | return (0); | |
1040 | } | |
1041 | ||
1042 | int | |
1043 | err_truncate(struct vop_truncate_args *ap) | |
1044 | { | |
1045 | return (EOPNOTSUPP); | |
1046 | } | |
1047 | ||
1048 | ||
1049 | struct 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 | ||
1059 | int | |
1060 | nop_allocate(struct vop_allocate_args *ap) | |
1061 | { | |
1062 | *(ap->a_bytesallocated) = 0; | |
1063 | return (0); | |
1064 | } | |
1065 | ||
1066 | int | |
1067 | err_allocate(struct vop_allocate_args *ap) | |
1068 | { | |
1069 | (void)nop_allocate(ap); | |
1070 | return (EOPNOTSUPP); | |
1071 | } | |
1072 | ||
1073 | ||
1074 | struct vop_update_args /* { | |
1075 | struct vnode *a_vp; | |
1076 | struct timeval *a_access; | |
1077 | struct timeval *a_modify; | |
1078 | int a_waitfor; | |
1079 | } */; | |
1080 | ||
1081 | int | |
1082 | nop_update(struct vop_update_args *ap) | |
1083 | { | |
1084 | return (0); | |
1085 | } | |
1086 | ||
1087 | int | |
1088 | err_update(struct vop_update_args *ap) | |
1089 | { | |
1090 | return (EOPNOTSUPP); | |
1091 | } | |
1092 | ||
1093 | ||
1094 | struct vop_pgrd_args /* { | |
1095 | struct vnode *a_vp; | |
1096 | struct uio *a_uio; | |
1097 | struct ucred *a_cred; | |
1098 | } */; | |
1099 | ||
1100 | int | |
1101 | nop_pgrd(struct vop_pgrd_args *ap) | |
1102 | { | |
1103 | return (0); | |
1104 | } | |
1105 | ||
1106 | int | |
1107 | err_pgrd(struct vop_pgrd_args *ap) | |
1108 | { | |
1109 | return (EOPNOTSUPP); | |
1110 | } | |
1111 | ||
1112 | ||
1113 | struct 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 | ||
1120 | int | |
1121 | nop_pgwr(struct vop_pgwr_args *ap) | |
1122 | { | |
1123 | return (0); | |
1124 | } | |
1125 | ||
1126 | int | |
1127 | err_pgwr(struct vop_pgwr_args *ap) | |
1128 | { | |
1129 | return (EOPNOTSUPP); | |
1130 | } | |
1131 | ||
1132 | ||
1133 | struct vop_bwrite_args /* { | |
1134 | struct buf *a_bp; | |
1135 | } */; | |
1136 | ||
1137 | int | |
1138 | nop_bwrite(struct vop_bwrite_args *ap) | |
1139 | { | |
1140 | return (bwrite(ap->a_bp)); | |
1141 | } | |
1142 | ||
1143 | int | |
1144 | err_bwrite(struct vop_bwrite_args *ap) | |
1145 | { | |
1146 | return (EOPNOTSUPP); | |
1147 | } | |
1148 | ||
1149 | ||
1150 | struct 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 | ||
1160 | int | |
1161 | nop_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 | ||
1167 | int | |
1168 | err_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 | ||
1175 | struct 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 | ||
1185 | int | |
1186 | nop_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 | ||
1192 | int | |
1193 | err_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 | ||
1200 | struct vop_devblocksize_args /* { | |
1201 | struct vnode *a_vp; | |
1202 | register_t *a_retval; | |
1203 | } */; | |
1204 | ||
1205 | int | |
1206 | nop_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 | ||
1213 | int | |
1214 | err_devblocksize(struct vop_devblocksize_args *ap) | |
1215 | { | |
1216 | (void)nop_devblocksize(ap); | |
1217 | return (EOPNOTSUPP); | |
1218 | } | |
1219 | ||
1220 | ||
1221 | struct 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 | ||
1236 | int | |
1237 | nop_searchfs(struct vop_searchfs_args *ap) | |
1238 | { | |
1239 | *(ap->a_nummatches) = 0; | |
1240 | return (0); | |
1241 | } | |
1242 | ||
1243 | int | |
1244 | err_searchfs(struct vop_searchfs_args *ap) | |
1245 | { | |
1246 | (void)nop_searchfs(ap); | |
1247 | return (EOPNOTSUPP); | |
1248 | } | |
1249 | ||
1250 | struct 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 | ||
1259 | int | |
1260 | nop_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 | ||
1273 | int | |
1274 | err_copyfile(struct vop_copyfile_args *ap) | |
1275 | { | |
1276 | (void)nop_copyfile(ap); | |
1277 | return (EOPNOTSUPP); | |
1278 | } | |
1279 | ||
1280 | ||
1281 | struct vop_blktooff_args /* { | |
1282 | struct vnode *a_vp; | |
1283 | daddr_t a_lblkno; | |
1284 | off_t *a_offset; | |
1285 | } */; | |
1286 | ||
1287 | int | |
1288 | nop_blktooff(struct vop_blktooff_args *ap) | |
1289 | { | |
1290 | *ap->a_offset = (off_t)-1; /* failure */ | |
1291 | return (0); | |
1292 | } | |
1293 | ||
1294 | int | |
1295 | err_blktooff(struct vop_blktooff_args *ap) | |
1296 | { | |
1297 | (void)nop_blktooff(ap); | |
1298 | return (EOPNOTSUPP); | |
1299 | } | |
1300 | ||
1301 | struct vop_offtoblk_args /* { | |
1302 | struct vnode *a_vp; | |
1303 | off_t a_offset; | |
1304 | daddr_t *a_lblkno; | |
1305 | } */; | |
1306 | ||
1307 | int | |
1308 | nop_offtoblk(struct vop_offtoblk_args *ap) | |
1309 | { | |
1310 | *ap->a_lblkno = (daddr_t)-1; /* failure */ | |
1311 | return (0); | |
1312 | } | |
1313 | ||
1314 | int | |
1315 | err_offtoblk(struct vop_offtoblk_args *ap) | |
1316 | { | |
1317 | (void)nop_offtoblk(ap); | |
1318 | return (EOPNOTSUPP); | |
1319 | } | |
1320 | ||
1321 | struct 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 | ||
1330 | int nop_cmap(struct vop_cmap_args *ap) | |
1331 | { | |
1332 | return (0); | |
1333 | } | |
1334 | ||
1335 | int err_cmap(struct vop_cmap_args *ap) | |
1336 | { | |
1337 | return (EOPNOTSUPP); | |
1338 | } | |
1339 |