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