]> git.saurik.com Git - apple/xnu.git/blame - bsd/vfs/vfs_support.c
xnu-4570.31.3.tar.gz
[apple/xnu.git] / bsd / vfs / vfs_support.c
CommitLineData
1c79356b 1/*
5d5c5d0d
A
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * Copyright (c) 1998-1999 Apple Computer, Inc. All rights reserved.
30 *
31 * File: vfs/vfs_support.c
32 *
33 * The default VFS routines. A VFS plugin can use these
34 * functions in case it does not want to implement all. These functions
35 * take care of releasing locks and free up memory that they are
36 * supposed to.
37 *
38 * nop_* routines always return 0 [success]
91447636 39 * err_* routines always return ENOTSUP
1c79356b
A
40 *
41 * This file could be auto-generated from vnode_if.src. but that needs
42 * support for freeing cnp.
43 *
44 * HISTORY
45 * 15-Jul-1998 Earsh Nandkeshwar (earsh@apple.com)
46 * Fixed up readdirattr for its existance now.
47 * 18-Aug-1998 Umesh Vaishampayan (umeshv@apple.com)
48 * Created.
49 */
50
51#include <vfs/vfs_support.h>
91447636 52#include <sys/kauth.h>
2d21ac55 53#include <sys/ubc.h> /* ubc_upl_abort_range() */
1c79356b
A
54
55
91447636 56struct vnop_create_args /* {
1c79356b
A
57 struct vnode *a_dvp;
58 struct vnode **a_vpp;
59 struct componentname *a_cnp;
91447636
A
60 struct vnode_vattr *a_vap;
61 vfs_context_t a_context;
1c79356b
A
62} */;
63
64int
2d21ac55 65nop_create(__unused struct vnop_create_args *ap)
1c79356b
A
66{
67#if DIAGNOSTIC
68 if ((ap->a_cnp->cn_flags & HASBUF) == 0)
69 panic("nop_create: no name");
70#endif
1c79356b
A
71 return (0);
72}
73
74int
91447636 75err_create(struct vnop_create_args *ap)
1c79356b
A
76{
77 (void)nop_create(ap);
91447636 78 return (ENOTSUP);
1c79356b
A
79}
80
81
91447636 82struct vnop_whiteout_args /* {
1c79356b
A
83 struct vnode *a_dvp;
84 struct componentname *a_cnp;
85 int a_flags;
91447636 86 vfs_context_t a_context;
1c79356b
A
87} */;
88
89int
2d21ac55 90nop_whiteout(__unused struct vnop_whiteout_args *ap)
1c79356b
A
91{
92 return (0);
93}
94
95int
2d21ac55 96err_whiteout(__unused struct vnop_whiteout_args *ap)
1c79356b 97{
91447636 98 return (ENOTSUP);
1c79356b
A
99}
100
101
91447636 102struct vnop_mknod_args /* {
1c79356b
A
103 struct vnode *a_dvp;
104 struct vnode **a_vpp;
105 struct componentname *a_cnp;
91447636
A
106 struct vnode_vattr *a_vap;
107 vfs_context_t a_context;
1c79356b
A
108} */;
109
110int
2d21ac55 111nop_mknod(__unused struct vnop_mknod_args *ap)
1c79356b
A
112{
113#if DIAGNOSTIC
114 if ((ap->a_cnp->cn_flags & HASBUF) == 0)
115 panic("nop_mknod: no name");
116#endif
1c79356b
A
117 return (0);
118}
119
120int
91447636 121err_mknod(struct vnop_mknod_args *ap)
1c79356b
A
122{
123 (void)nop_mknod(ap);
91447636 124 return (ENOTSUP);
1c79356b
A
125}
126
91447636 127struct vnop_open_args /* {
1c79356b
A
128 struct vnode *a_vp;
129 int a_mode;
91447636 130 vfs_context_t a_context;
1c79356b
A
131} */;
132
133int
2d21ac55 134nop_open(__unused struct vnop_open_args *ap)
1c79356b
A
135{
136 return (0);
137}
138
139int
2d21ac55 140err_open(__unused struct vnop_open_args *ap)
1c79356b 141{
91447636 142 return (ENOTSUP);
1c79356b
A
143}
144
145
91447636 146struct vnop_close_args /* {
1c79356b
A
147 struct vnode *a_vp;
148 int a_fflag;
91447636 149 vfs_context_t a_context;
1c79356b
A
150} */;
151
152int
2d21ac55 153nop_close(__unused struct vnop_close_args *ap)
1c79356b
A
154{
155 return (0);
156}
157
158int
2d21ac55 159err_close(__unused struct vnop_close_args *ap)
1c79356b 160{
91447636 161 return (ENOTSUP);
1c79356b
A
162}
163
164
91447636 165struct vnop_access_args /* {
1c79356b
A
166 struct vnode *a_vp;
167 int a_mode;
91447636 168 vfs_context_t a_context;
1c79356b
A
169} */;
170
171int
2d21ac55 172nop_access(__unused struct vnop_access_args *ap)
1c79356b
A
173{
174 return (0);
175}
176
177int
2d21ac55 178err_access(__unused struct vnop_access_args *ap)
1c79356b 179{
91447636 180 return (ENOTSUP);
1c79356b
A
181}
182
183
91447636 184struct vnop_getattr_args /* {
1c79356b 185 struct vnode *a_vp;
91447636
A
186 struct vnode_vattr *a_vap;
187 vfs_context_t a_context;
1c79356b
A
188} */;
189
190int
2d21ac55 191nop_getattr(__unused struct vnop_getattr_args *ap)
1c79356b
A
192{
193 return (0);
194}
195
196int
2d21ac55 197err_getattr(__unused struct vnop_getattr_args *ap)
1c79356b 198{
91447636 199 return (ENOTSUP);
1c79356b
A
200}
201
202
91447636 203struct vnop_setattr_args /* {
1c79356b 204 struct vnode *a_vp;
91447636
A
205 struct vnode_vattr *a_vap;
206 vfs_context_t a_context;
1c79356b
A
207} */;
208
209int
2d21ac55 210nop_setattr(__unused struct vnop_setattr_args *ap)
1c79356b
A
211{
212 return (0);
213}
214
215int
2d21ac55 216err_setattr(__unused struct vnop_setattr_args *ap)
1c79356b 217{
91447636 218 return (ENOTSUP);
1c79356b
A
219}
220
91447636 221struct vnop_read_args /* {
1c79356b
A
222 struct vnode *a_vp;
223 struct uio *a_uio;
224 int a_ioflag;
91447636 225 vfs_context_t a_context;
1c79356b
A
226} */;
227
228int
2d21ac55 229nop_read(__unused struct vnop_read_args *ap)
1c79356b
A
230{
231 return (0);
232}
233
234int
2d21ac55 235err_read(__unused struct vnop_read_args *ap)
1c79356b 236{
91447636 237 return (ENOTSUP);
1c79356b
A
238}
239
240
91447636 241struct vnop_write_args /* {
1c79356b
A
242 struct vnode *a_vp;
243 struct uio *a_uio;
244 int a_ioflag;
91447636 245 vfs_context_t a_context;
1c79356b
A
246} */;
247
248int
2d21ac55 249nop_write(__unused struct vnop_write_args *ap)
1c79356b
A
250{
251 return (0);
252}
253
254int
2d21ac55 255err_write(__unused struct vnop_write_args *ap)
1c79356b 256{
91447636 257 return (ENOTSUP);
1c79356b
A
258}
259
260
91447636 261struct vnop_ioctl_args /* {
1c79356b
A
262 struct vnode *a_vp;
263 u_long a_command;
264 caddr_t a_data;
265 int a_fflag;
91447636 266 kauth_cred_t a_cred;
1c79356b
A
267 struct proc *a_p;
268} */;
269
270int
91447636 271nop_ioctl(__unused struct vnop_ioctl_args *ap)
1c79356b
A
272{
273 return (0);
274}
275
276int
2d21ac55 277err_ioctl(__unused struct vnop_ioctl_args *ap)
1c79356b 278{
91447636 279 return (ENOTSUP);
1c79356b
A
280}
281
282
91447636 283struct vnop_select_args /* {
1c79356b
A
284 struct vnode *a_vp;
285 int a_which;
286 int a_fflags;
91447636 287 kauth_cred_t a_cred;
0b4e3aa0 288 void *a_wql;
1c79356b
A
289 struct proc *a_p;
290} */;
291
292int
91447636 293nop_select(__unused struct vnop_select_args *ap)
1c79356b
A
294{
295 return (0);
296}
297
298int
2d21ac55 299err_select(__unused struct vnop_select_args *ap)
1c79356b 300{
91447636 301 return (ENOTSUP);
1c79356b
A
302}
303
304
91447636 305struct vnop_exchange_args /* {
1c79356b
A
306 struct vnode *a_fvp;
307 struct vnode *a_tvp;
91447636
A
308 int a_options;
309 vfs_context_t a_context;
1c79356b
A
310} */;
311
312int
2d21ac55 313nop_exchange(__unused struct vnop_exchange_args *ap)
1c79356b
A
314{
315 return (0);
316}
317
318int
2d21ac55 319err_exchange(__unused struct vnop_exchange_args *ap)
1c79356b 320{
91447636 321 return (ENOTSUP);
1c79356b
A
322}
323
324
91447636 325struct vnop_revoke_args /* {
1c79356b
A
326 struct vnode *a_vp;
327 int a_flags;
91447636 328 vfs_context_t a_context;
1c79356b
A
329} */;
330
331int
91447636 332nop_revoke(struct vnop_revoke_args *ap)
1c79356b 333{
91447636 334 return vn_revoke(ap->a_vp, ap->a_flags, ap->a_context);
1c79356b
A
335}
336
337int
91447636 338err_revoke(struct vnop_revoke_args *ap)
1c79356b
A
339{
340 (void)nop_revoke(ap);
91447636 341 return (ENOTSUP);
1c79356b
A
342}
343
344
91447636 345struct vnop_mmap_args /* {
1c79356b
A
346 struct vnode *a_vp;
347 int a_fflags;
91447636 348 kauth_cred_t a_cred;
1c79356b
A
349 struct proc *a_p;
350} */;
351
352int
91447636 353nop_mmap(__unused struct vnop_mmap_args *ap)
1c79356b
A
354{
355 return (0);
356}
357
358int
2d21ac55 359err_mmap(__unused struct vnop_mmap_args *ap)
1c79356b 360{
91447636 361 return (ENOTSUP);
1c79356b
A
362}
363
364
91447636 365struct vnop_fsync_args /* {
1c79356b 366 struct vnode *a_vp;
1c79356b 367 int a_waitfor;
91447636 368 vfs_context_t a_context;
1c79356b
A
369} */;
370
371int
2d21ac55 372nop_fsync(__unused struct vnop_fsync_args *ap)
1c79356b
A
373{
374 return (0);
375}
376
377int
2d21ac55 378err_fsync(__unused struct vnop_fsync_args *ap)
1c79356b 379{
91447636 380 return (ENOTSUP);
1c79356b
A
381}
382
383
91447636 384struct vnop_remove_args /* {
1c79356b
A
385 struct vnode *a_dvp;
386 struct vnode *a_vp;
387 struct componentname *a_cnp;
91447636
A
388 int a_flags;
389 vfs_context_t a_context;
1c79356b
A
390} */;
391
392int
2d21ac55 393nop_remove(__unused struct vnop_remove_args *ap)
1c79356b 394{
1c79356b
A
395 return (0);
396}
397
398int
91447636 399err_remove(struct vnop_remove_args *ap)
1c79356b
A
400{
401 (void)nop_remove(ap);
91447636 402 return (ENOTSUP);
1c79356b
A
403}
404
405
91447636 406struct vnop_link_args /* {
1c79356b
A
407 struct vnode *a_vp;
408 struct vnode *a_tdvp;
409 struct componentname *a_cnp;
91447636 410 vfs_context_t a_context;
1c79356b
A
411} */;
412
413int
2d21ac55 414nop_link(__unused struct vnop_link_args *ap)
1c79356b 415{
1c79356b
A
416 return (0);
417}
418
419int
91447636 420err_link(struct vnop_link_args *ap)
1c79356b
A
421{
422 (void)nop_link(ap);
91447636 423 return (ENOTSUP);
1c79356b
A
424}
425
426
91447636 427struct vnop_rename_args /* {
1c79356b
A
428 struct vnode *a_fdvp;
429 struct vnode *a_fvp;
430 struct componentname *a_fcnp;
431 struct vnode *a_tdvp;
432 struct vnode *a_tvp;
433 struct componentname *a_tcnp;
91447636 434 vfs_context_t a_context;
1c79356b
A
435} */;
436
437int
2d21ac55 438nop_rename(__unused struct vnop_rename_args *ap)
1c79356b 439{
1c79356b
A
440 return (0);
441}
442
443int
91447636 444err_rename(struct vnop_rename_args *ap)
1c79356b
A
445{
446 (void)nop_rename(ap);
91447636 447 return (ENOTSUP);
1c79356b
A
448}
449
450
91447636 451struct vnop_mkdir_args /* {
1c79356b
A
452 struct vnode *a_dvp;
453 struct vnode **a_vpp;
454 struct componentname *a_cnp;
91447636
A
455 struct vnode_vattr *a_vap;
456 vfs_context_t a_context;
1c79356b
A
457} */;
458
459int
2d21ac55 460nop_mkdir(__unused struct vnop_mkdir_args *ap)
1c79356b 461{
1c79356b
A
462 return (0);
463}
464
465int
2d21ac55 466err_mkdir(__unused struct vnop_mkdir_args *ap)
1c79356b 467{
91447636 468 return (ENOTSUP);
1c79356b
A
469}
470
471
91447636 472struct vnop_rmdir_args /* {
1c79356b
A
473 struct vnode *a_dvp;
474 struct vnode *a_vp;
475 struct componentname *a_cnp;
91447636 476 vfs_context_t a_context;
1c79356b
A
477} */;
478
479int
2d21ac55 480nop_rmdir(__unused struct vnop_rmdir_args *ap)
1c79356b 481{
1c79356b
A
482 return (0);
483}
484
485int
91447636 486err_rmdir(struct vnop_rmdir_args *ap)
1c79356b
A
487{
488 (void)nop_rmdir(ap);
91447636 489 return (ENOTSUP);
1c79356b
A
490}
491
492
91447636 493struct vnop_symlink_args /* {
1c79356b
A
494 struct vnode *a_dvp;
495 struct vnode **a_vpp;
496 struct componentname *a_cnp;
91447636 497 struct vnode_vattr *a_vap;
1c79356b 498 char *a_target;
91447636 499 vfs_context_t a_context;
1c79356b
A
500} */;
501
502int
2d21ac55 503nop_symlink(__unused struct vnop_symlink_args *ap)
1c79356b
A
504{
505#if DIAGNOSTIC
506 if ((ap->a_cnp->cn_flags & HASBUF) == 0)
507 panic("nop_symlink: no name");
508#endif
1c79356b
A
509 return (0);
510}
511
512int
91447636 513err_symlink(struct vnop_symlink_args *ap)
1c79356b
A
514{
515 (void)nop_symlink(ap);
91447636 516 return (ENOTSUP);
1c79356b
A
517}
518
519
91447636
A
520struct vnop_readdir_args /* {
521 vnode_t a_vp;
1c79356b 522 struct uio *a_uio;
91447636 523 int a_flags;
1c79356b 524 int *a_eofflag;
91447636
A
525 int *a_numdirent;
526 vfs_context_t a_context;
1c79356b
A
527} */;
528
529int
2d21ac55 530nop_readdir(__unused struct vnop_readdir_args *ap)
1c79356b
A
531{
532 return (0);
533}
534
535int
2d21ac55 536err_readdir(__unused struct vnop_readdir_args *ap)
1c79356b 537{
91447636 538 return (ENOTSUP);
1c79356b
A
539}
540
541
91447636 542struct vnop_readdirattr_args /* {
b0d623f7
A
543 struct vnodeop_desc *a_desc;
544 vnode_t a_vp;
1c79356b
A
545 struct attrlist *a_alist;
546 struct uio *a_uio;
547 u_long a_maxcount;
b0d623f7
A
548 u_long a_options;
549 u_long *a_newstate;
1c79356b 550 int *a_eofflag;
b0d623f7 551 u_long *a_actualcount;
91447636 552 vfs_context_t a_context;
b0d623f7 553} */ ;
1c79356b
A
554
555int
91447636 556nop_readdirattr(struct vnop_readdirattr_args *ap)
1c79356b
A
557{
558 *(ap->a_actualcount) = 0;
559 *(ap->a_eofflag) = 0;
560 return (0);
561}
562
563int
91447636 564err_readdirattr(struct vnop_readdirattr_args *ap)
1c79356b
A
565{
566 (void)nop_readdirattr(ap);
91447636 567 return (ENOTSUP);
1c79356b
A
568}
569
570
91447636 571struct vnop_readlink_args /* {
1c79356b
A
572 struct vnode *vp;
573 struct uio *uio;
91447636 574 vfs_context_t a_context;
1c79356b
A
575} */;
576
577int
2d21ac55 578nop_readlink(__unused struct vnop_readlink_args *ap)
1c79356b 579{
1c79356b
A
580 return (0);
581}
582
583int
2d21ac55 584err_readlink(__unused struct vnop_readlink_args *ap)
1c79356b 585{
91447636 586 return (ENOTSUP);
1c79356b
A
587}
588
589
91447636 590struct vnop_inactive_args /* {
1c79356b 591 struct vnode *a_vp;
91447636 592 vfs_context_t a_context;
1c79356b
A
593} */;
594
595int
2d21ac55 596nop_inactive(__unused struct vnop_inactive_args *ap)
1c79356b 597{
1c79356b
A
598 return (0);
599}
600
601int
91447636 602err_inactive(struct vnop_inactive_args *ap)
1c79356b
A
603{
604 (void)nop_inactive(ap);
91447636 605 return (ENOTSUP);
1c79356b
A
606}
607
608
91447636 609struct vnop_reclaim_args /* {
1c79356b 610 struct vnode *a_vp;
91447636 611 vfs_context_t a_context;
1c79356b
A
612} */;
613
614int
2d21ac55 615nop_reclaim(__unused struct vnop_reclaim_args *ap)
1c79356b
A
616{
617 return (0);
618}
619
620int
2d21ac55 621err_reclaim(__unused struct vnop_reclaim_args *ap)
1c79356b 622{
91447636 623 return (ENOTSUP);
1c79356b
A
624}
625
626
91447636 627struct vnop_strategy_args /* {
1c79356b
A
628 struct buf *a_bp;
629} */;
630
631int
2d21ac55 632nop_strategy(__unused struct vnop_strategy_args *ap)
1c79356b
A
633{
634 return (0);
635}
636
637int
2d21ac55 638err_strategy(__unused struct vnop_strategy_args *ap)
1c79356b 639{
91447636 640 return (ENOTSUP);
1c79356b
A
641}
642
643
91447636 644struct vnop_pathconf_args /* {
1c79356b
A
645 struct vnode *a_vp;
646 int a_name;
b0d623f7 647 int32_t *a_retval;
91447636 648 vfs_context_t a_context;
1c79356b
A
649} */;
650
651int
2d21ac55 652nop_pathconf(__unused struct vnop_pathconf_args *ap)
1c79356b
A
653{
654 return (0);
655}
656
657int
2d21ac55 658err_pathconf(__unused struct vnop_pathconf_args *ap)
1c79356b 659{
91447636 660 return (ENOTSUP);
1c79356b
A
661}
662
663
91447636 664struct vnop_advlock_args /* {
1c79356b
A
665 struct vnode *a_vp;
666 caddr_t a_id;
667 int a_op;
668 struct flock *a_fl;
669 int a_flags;
91447636 670 vfs_context_t a_context;
1c79356b
A
671} */;
672
673int
2d21ac55 674nop_advlock(__unused struct vnop_advlock_args *ap)
1c79356b
A
675{
676 return (0);
677}
678
679int
2d21ac55 680err_advlock(__unused struct vnop_advlock_args *ap)
1c79356b 681{
91447636 682 return (ENOTSUP);
1c79356b
A
683}
684
685
1c79356b 686
91447636 687struct vnop_allocate_args /* {
1c79356b
A
688 struct vnode *a_vp;
689 off_t a_length;
690 u_int32_t a_flags;
691 off_t *a_bytesallocated;
0b4e3aa0 692 off_t a_offset;
91447636 693 vfs_context_t a_context;
1c79356b
A
694} */;
695
696int
91447636 697nop_allocate(struct vnop_allocate_args *ap)
1c79356b
A
698{
699 *(ap->a_bytesallocated) = 0;
700 return (0);
701}
702
703int
91447636 704err_allocate(struct vnop_allocate_args *ap)
1c79356b
A
705{
706 (void)nop_allocate(ap);
91447636 707 return (ENOTSUP);
1c79356b
A
708}
709
91447636 710struct vnop_bwrite_args /* {
1c79356b
A
711 struct buf *a_bp;
712} */;
713
714int
91447636 715nop_bwrite(struct vnop_bwrite_args *ap)
1c79356b 716{
91447636 717 return ((int)buf_bwrite(ap->a_bp));
1c79356b
A
718}
719
720int
2d21ac55 721err_bwrite(__unused struct vnop_bwrite_args *ap)
1c79356b 722{
91447636 723 return (ENOTSUP);
1c79356b
A
724}
725
726
91447636 727struct vnop_pagein_args /* {
1c79356b
A
728 struct vnode *a_vp,
729 upl_t a_pl,
730 vm_offset_t a_pl_offset,
731 off_t a_foffset,
732 size_t a_size,
1c79356b 733 int a_flags
91447636 734 vfs_context_t a_context;
1c79356b
A
735} */;
736
737int
91447636 738nop_pagein(struct vnop_pagein_args *ap)
1c79356b 739{
91447636
A
740 if ( !(ap->a_flags & UPL_NOCOMMIT))
741 ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR);
742 return (EINVAL);
1c79356b
A
743}
744
745int
91447636 746err_pagein(struct vnop_pagein_args *ap)
1c79356b 747{
91447636
A
748 if ( !(ap->a_flags & UPL_NOCOMMIT))
749 ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR);
750 return (ENOTSUP);
1c79356b
A
751}
752
753
91447636 754struct vnop_pageout_args /* {
1c79356b
A
755 struct vnode *a_vp,
756 upl_t a_pl,
757 vm_offset_t a_pl_offset,
758 off_t a_foffset,
759 size_t a_size,
1c79356b 760 int a_flags
91447636 761 vfs_context_t a_context;
1c79356b
A
762} */;
763
764int
91447636 765nop_pageout(struct vnop_pageout_args *ap)
1c79356b 766{
91447636
A
767 if ( !(ap->a_flags & UPL_NOCOMMIT))
768 ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR);
769 return (EINVAL);
1c79356b
A
770}
771
772int
91447636 773err_pageout(struct vnop_pageout_args *ap)
1c79356b 774{
91447636
A
775 if ( !(ap->a_flags & UPL_NOCOMMIT))
776 ubc_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR);
777 return (ENOTSUP);
1c79356b
A
778}
779
780
91447636 781struct vnop_searchfs /* {
1c79356b
A
782 struct vnode *a_vp;
783 void *a_searchparams1;
784 void *a_searchparams2;
785 struct attrlist *a_searchattrs;
786 u_long a_maxmatches;
787 struct timeval *a_timelimit;
788 struct attrlist *a_returnattrs;
789 u_long *a_nummatches;
790 u_long a_scriptcode;
791 u_long a_options;
792 struct uio *a_uio;
793 struct searchstate *a_searchstate;
91447636 794 vfs_context_t a_context;
1c79356b
A
795} */;
796
797int
91447636 798nop_searchfs(struct vnop_searchfs_args *ap)
1c79356b
A
799{
800 *(ap->a_nummatches) = 0;
801 return (0);
802}
803
804int
91447636 805err_searchfs(struct vnop_searchfs_args *ap)
1c79356b
A
806{
807 (void)nop_searchfs(ap);
91447636 808 return (ENOTSUP);
1c79356b
A
809}
810
91447636 811struct vnop_copyfile_args /*{
1c79356b
A
812 struct vnodeop_desc *a_desc;
813 struct vnode *a_fvp;
814 struct vnode *a_tdvp;
815 struct vnode *a_tvp;
816 struct componentname *a_tcnp;
817 int a_flags;
818}*/;
819
820int
2d21ac55 821nop_copyfile(__unused struct vnop_copyfile_args *ap)
1c79356b 822{
1c79356b
A
823 return (0);
824}
825
826
827int
91447636 828err_copyfile(struct vnop_copyfile_args *ap)
1c79356b
A
829{
830 (void)nop_copyfile(ap);
91447636 831 return (ENOTSUP);
1c79356b
A
832}
833
834
91447636 835struct vnop_blktooff_args /* {
1c79356b 836 struct vnode *a_vp;
91447636 837 daddr64_t a_lblkno;
1c79356b
A
838 off_t *a_offset;
839} */;
840
841int
91447636 842nop_blktooff(struct vnop_blktooff_args *ap)
1c79356b
A
843{
844 *ap->a_offset = (off_t)-1; /* failure */
845 return (0);
846}
847
848int
91447636 849err_blktooff(struct vnop_blktooff_args *ap)
1c79356b
A
850{
851 (void)nop_blktooff(ap);
91447636 852 return (ENOTSUP);
1c79356b
A
853}
854
91447636 855struct vnop_offtoblk_args /* {
1c79356b
A
856 struct vnode *a_vp;
857 off_t a_offset;
91447636 858 daddr64_t *a_lblkno;
1c79356b
A
859} */;
860
861int
91447636 862nop_offtoblk(struct vnop_offtoblk_args *ap)
1c79356b 863{
91447636 864 *ap->a_lblkno = (daddr64_t)-1; /* failure */
1c79356b
A
865 return (0);
866}
867
868int
91447636 869err_offtoblk(struct vnop_offtoblk_args *ap)
1c79356b
A
870{
871 (void)nop_offtoblk(ap);
91447636 872 return (ENOTSUP);
1c79356b
A
873}
874
91447636 875struct vnop_blockmap_args /* {
1c79356b
A
876 struct vnode *a_vp;
877 off_t a_foffset;
878 size_t a_size;
91447636 879 daddr64_t *a_bpn;
1c79356b
A
880 size_t *a_run;
881 void *a_poff;
91447636 882 int a_flags;
1c79356b
A
883} */;
884
2d21ac55 885int nop_blockmap(__unused struct vnop_blockmap_args *ap)
1c79356b
A
886{
887 return (0);
888}
889
2d21ac55 890int err_blockmap(__unused struct vnop_blockmap_args *ap)
1c79356b 891{
91447636 892 return (ENOTSUP);
1c79356b
A
893}
894