Kernel - fix access checks
[dragonfly.git] / sys / sys / vfsops.h
CommitLineData
2d3e977e
MD
1/*
2 * Copyright (c) 2004 The DragonFly Project. All rights reserved.
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
e92ca23a 34 * $DragonFly: src/sys/sys/vfsops.h,v 1.32 2008/06/19 23:27:36 dillon Exp $
2d3e977e
MD
35 */
36
37/*
0961aa92 38 * The vop_ops structure vectors all access to a filesystem. It contains a
66a1ddf5 39 * fixed set of vectors.
2d3e977e
MD
40 *
41 * In DragonFly the ultimate goal is to thread the VFS, which means that
42 * the dispatch functions will eventually be called from the context of
43 * a management thread rather then directly called by a process. This
44 * requires us to divorce direct process dependancies (in particular ioctl
45 * and UIO's). In addition, it is our intention to implement kernel
46 * level cache management and coherency in the vop_*() interfacing
47 * layer.
48 *
49 * The number of management threads will depend on the VFS. The idea is
50 * to give a high performance VFS such as UFS at least one thread per cpu,
51 * and a low performance VFS such as CD9660 perhaps just one thread period.
52 * Blocking issues within the management thread are up to the VFS itself,
53 * but DragonFly will introduce a layer above the VFS to handle cacheable
54 * requests without having to enter the VFS (e.g. by making attribute
55 * and VM object information a permanent fixture of the vnode structure
56 * and accessing them directly).
57 *
58 * THE VOPOPS VECTORS SHOULD NEVER BE CALLED DIRECTLY! Instead always use
59 * the kernel helper procedures vop_*() to call a vopop. The kernel
60 * helper procedure will be responsible for handling the DragonFly messaging
61 * conversion when it occurs.
62 */
63
0961aa92
MD
64#ifndef _SYS_VFSOPS_H_
65#define _SYS_VFSOPS_H_
66
67#ifndef _SYS_ACL_H_
68#include <sys/acl.h>
69#endif
e92ca23a
MD
70#ifndef _SYS_BUF_H_
71#include <sys/buf.h> /* buf_cmd_t */
72#endif
cb66845a
MD
73#ifndef _SYS_FCNTL_H_
74#include <sys/fcntl.h> /* AT_EACCESS */
75#endif
2d3e977e 76
fef8985e 77struct syslink_desc;
2d3e977e
MD
78struct vnode;
79struct thread;
28623bf9 80struct nchandle;
2d3e977e
MD
81struct componentname;
82struct vattr;
83struct ucred;
84struct uio;
fad57d0e 85struct file;
2d3e977e
MD
86struct knote;
87struct vm_object;
88struct vm_page;
0961aa92 89struct vfscache;
2d3e977e
MD
90
91struct vop_generic_args {
31bd717a 92 struct syslink_desc *a_desc; /* command descriptor for the call */
cbe54d63
MD
93 struct vop_ops *a_ops; /* operations vector for the call */
94 int a_reserved[4];
2d3e977e
MD
95};
96
e62afb5f 97struct vop_old_lookup_args {
2d3e977e
MD
98 struct vop_generic_args a_head;
99 struct vnode *a_dvp;
2d3e977e 100 struct vnode **a_vpp;
2d3e977e
MD
101 struct componentname *a_cnp;
102};
103
e62afb5f 104struct vop_old_create_args {
2d3e977e
MD
105 struct vop_generic_args a_head;
106 struct vnode *a_dvp;
2d3e977e
MD
107 struct vnode **a_vpp;
108 struct componentname *a_cnp;
109 struct vattr *a_vap;
110};
111
e62afb5f 112struct vop_old_whiteout_args {
2d3e977e
MD
113 struct vop_generic_args a_head;
114 struct vnode *a_dvp;
2d3e977e
MD
115 struct componentname *a_cnp;
116 int a_flags;
117};
118
e62afb5f 119struct vop_old_mknod_args {
2d3e977e
MD
120 struct vop_generic_args a_head;
121 struct vnode *a_dvp;
2d3e977e
MD
122 struct vnode **a_vpp;
123 struct componentname *a_cnp;
124 struct vattr *a_vap;
125};
126
127struct vop_open_args {
128 struct vop_generic_args a_head;
129 struct vnode *a_vp;
130 int a_mode;
131 struct ucred *a_cred;
fad57d0e 132 struct file *a_fp; /* optional fp for fileops override */
2d3e977e
MD
133};
134
135struct vop_close_args {
136 struct vop_generic_args a_head;
137 struct vnode *a_vp;
138 int a_fflag;
2d3e977e
MD
139};
140
141struct vop_access_args {
142 struct vop_generic_args a_head;
143 struct vnode *a_vp;
b2aed953
NT
144 int a_mode; /* V* bitmask */
145 int a_flags; /* AT_* bitmask */
2d3e977e 146 struct ucred *a_cred;
2d3e977e
MD
147};
148
149struct vop_getattr_args {
150 struct vop_generic_args a_head;
151 struct vnode *a_vp;
152 struct vattr *a_vap;
2d3e977e
MD
153};
154
155struct vop_setattr_args {
156 struct vop_generic_args a_head;
157 struct vnode *a_vp;
158 struct vattr *a_vap;
159 struct ucred *a_cred;
2d3e977e
MD
160};
161
162struct vop_read_args {
163 struct vop_generic_args a_head;
164 struct vnode *a_vp;
165 struct uio *a_uio;
166 int a_ioflag;
167 struct ucred *a_cred;
168};
169
170struct vop_write_args {
171 struct vop_generic_args a_head;
172 struct vnode *a_vp;
173 struct uio *a_uio;
174 int a_ioflag;
175 struct ucred *a_cred;
176};
177
2d3e977e
MD
178struct vop_ioctl_args {
179 struct vop_generic_args a_head;
180 struct vnode *a_vp;
181 u_long a_command;
182 caddr_t a_data;
183 int a_fflag;
184 struct ucred *a_cred;
87baaf0c 185 struct sysmsg *a_sysmsg;
2d3e977e
MD
186};
187
188struct vop_poll_args {
189 struct vop_generic_args a_head;
190 struct vnode *a_vp;
191 int a_events;
192 struct ucred *a_cred;
2d3e977e
MD
193};
194
195struct vop_kqfilter_args {
196 struct vop_generic_args a_head;
197 struct vnode *a_vp;
198 struct knote *a_kn;
199};
200
2d3e977e
MD
201struct vop_mmap_args {
202 struct vop_generic_args a_head;
203 struct vnode *a_vp;
204 int a_fflags;
205 struct ucred *a_cred;
2d3e977e
MD
206};
207
208struct vop_fsync_args {
209 struct vop_generic_args a_head;
210 struct vnode *a_vp;
211 int a_waitfor;
52174f71 212 int a_flags;
2d3e977e
MD
213};
214
e62afb5f 215struct vop_old_remove_args {
2d3e977e
MD
216 struct vop_generic_args a_head;
217 struct vnode *a_dvp;
2d3e977e
MD
218 struct vnode *a_vp;
219 struct componentname *a_cnp;
220};
221
e62afb5f 222struct vop_old_link_args {
2d3e977e
MD
223 struct vop_generic_args a_head;
224 struct vnode *a_tdvp;
2d3e977e
MD
225 struct vnode *a_vp;
226 struct componentname *a_cnp;
227};
228
e62afb5f 229struct vop_old_rename_args {
2d3e977e
MD
230 struct vop_generic_args a_head;
231 struct vnode *a_fdvp;
2d3e977e
MD
232 struct vnode *a_fvp;
233 struct componentname *a_fcnp;
234 struct vnode *a_tdvp;
2d3e977e
MD
235 struct vnode *a_tvp;
236 struct componentname *a_tcnp;
237};
238
e62afb5f 239struct vop_old_mkdir_args {
2d3e977e
MD
240 struct vop_generic_args a_head;
241 struct vnode *a_dvp;
2d3e977e
MD
242 struct vnode **a_vpp;
243 struct componentname *a_cnp;
244 struct vattr *a_vap;
245};
246
e62afb5f 247struct vop_old_rmdir_args {
2d3e977e
MD
248 struct vop_generic_args a_head;
249 struct vnode *a_dvp;
2d3e977e
MD
250 struct vnode *a_vp;
251 struct componentname *a_cnp;
252};
253
e62afb5f 254struct vop_old_symlink_args {
2d3e977e
MD
255 struct vop_generic_args a_head;
256 struct vnode *a_dvp;
2d3e977e
MD
257 struct vnode **a_vpp;
258 struct componentname *a_cnp;
259 struct vattr *a_vap;
260 char *a_target;
261};
262
263struct vop_readdir_args {
264 struct vop_generic_args a_head;
265 struct vnode *a_vp;
266 struct uio *a_uio;
267 struct ucred *a_cred;
268 int *a_eofflag;
269 int *a_ncookies;
84009d92 270 off_t **a_cookies;
2d3e977e
MD
271};
272
273struct vop_readlink_args {
274 struct vop_generic_args a_head;
275 struct vnode *a_vp;
276 struct uio *a_uio;
277 struct ucred *a_cred;
278};
279
280struct vop_inactive_args {
281 struct vop_generic_args a_head;
282 struct vnode *a_vp;
2d3e977e
MD
283};
284
285struct vop_reclaim_args {
286 struct vop_generic_args a_head;
287 struct vnode *a_vp;
2d3e977e
MD
288};
289
2d3e977e
MD
290struct vop_bmap_args {
291 struct vop_generic_args a_head;
292 struct vnode *a_vp;
54078292 293 off_t a_loffset;
54078292 294 off_t *a_doffsetp;
2d3e977e
MD
295 int *a_runp;
296 int *a_runb;
e92ca23a 297 buf_cmd_t a_cmd; /* BUF_CMD_READ, BUF_CMD_WRITE, etc */
2d3e977e
MD
298};
299
300struct vop_strategy_args {
301 struct vop_generic_args a_head;
302 struct vnode *a_vp;
81b5c339 303 struct bio *a_bio;
2d3e977e
MD
304};
305
306struct vop_print_args {
307 struct vop_generic_args a_head;
308 struct vnode *a_vp;
309};
310
311struct vop_pathconf_args {
312 struct vop_generic_args a_head;
313 struct vnode *a_vp;
314 int a_name;
315 register_t *a_retval;
316};
317
318struct vop_advlock_args {
319 struct vop_generic_args a_head;
320 struct vnode *a_vp;
321 caddr_t a_id;
322 int a_op;
323 struct flock *a_fl;
324 int a_flags;
325};
326
327struct vop_balloc_args {
328 struct vop_generic_args a_head;
329 struct vnode *a_vp;
330 off_t a_startoffset;
331 int a_size;
332 struct ucred *a_cred;
333 int a_flags;
334 struct buf **a_bpp;
335};
336
337struct vop_reallocblks_args {
338 struct vop_generic_args a_head;
339 struct vnode *a_vp;
340 struct cluster_save *a_buflist;
341};
342
343struct vop_getpages_args {
344 struct vop_generic_args a_head;
345 struct vnode *a_vp;
346 struct vm_page **a_m;
347 int a_count;
348 int a_reqpage;
349 vm_ooffset_t a_offset;
350};
351
352struct vop_putpages_args {
353 struct vop_generic_args a_head;
354 struct vnode *a_vp;
355 struct vm_page **a_m;
356 int a_count;
357 int a_sync;
358 int *a_rtvals;
359 vm_ooffset_t a_offset;
360};
361
362struct vop_freeblks_args {
363 struct vop_generic_args a_head;
364 struct vnode *a_vp;
54078292
MD
365 off_t a_offset;
366 int a_length;
2d3e977e
MD
367};
368
2d3e977e
MD
369struct vop_getacl_args {
370 struct vop_generic_args a_head;
371 struct vnode *a_vp;
372 acl_type_t a_type;
373 struct acl *a_aclp;
374 struct ucred *a_cred;
2d3e977e
MD
375};
376
377struct vop_setacl_args {
378 struct vop_generic_args a_head;
379 struct vnode *a_vp;
380 acl_type_t a_type;
381 struct acl *a_aclp;
382 struct ucred *a_cred;
2d3e977e
MD
383};
384
385struct vop_aclcheck_args {
386 struct vop_generic_args a_head;
387 struct vnode *a_vp;
388 acl_type_t a_type;
389 struct acl *a_aclp;
390 struct ucred *a_cred;
2d3e977e
MD
391};
392
393struct vop_getextattr_args {
394 struct vop_generic_args a_head;
395 struct vnode *a_vp;
396 char *a_name;
397 struct uio *a_uio;
398 struct ucred *a_cred;
2d3e977e
MD
399};
400
401struct vop_setextattr_args {
402 struct vop_generic_args a_head;
403 struct vnode *a_vp;
404 char *a_name;
405 struct uio *a_uio;
406 struct ucred *a_cred;
2d3e977e
MD
407};
408
949ecb9b 409struct vop_mountctl_args {
cbe54d63
MD
410 struct vop_generic_args a_head;
411 int a_op;
2281065e 412 struct file *a_fp;
949ecb9b
MD
413 const void *a_ctl;
414 int a_ctllen;
415 void *a_buf;
416 int a_buflen;
417 int *a_res;
cbe54d63
MD
418};
419
349433c9
MD
420struct vop_markatime_args {
421 struct vop_generic_args a_head;
422 int a_op;
423 struct vnode *a_vp;
424 struct ucred *a_cred;
425};
426
fad57d0e
MD
427/*
428 * NEW API
429 */
dff430ab
MD
430
431/*
432 * Warning: a_dvp is only held, not ref'd. The target must still vget()
433 * it.
434 */
fad57d0e
MD
435struct vop_nresolve_args {
436 struct vop_generic_args a_head;
28623bf9 437 struct nchandle *a_nch;
dff430ab 438 struct vnode *a_dvp;
fad57d0e
MD
439 struct ucred *a_cred;
440};
441
442struct vop_nlookupdotdot_args {
443 struct vop_generic_args a_head;
444 struct vnode *a_dvp;
445 struct vnode **a_vpp;
446 struct ucred *a_cred;
33387738 447 char **a_fakename;
fad57d0e
MD
448};
449
dff430ab
MD
450/*
451 * Warning: a_dvp is only held, not ref'd. The target must still vget()
452 * it.
453 */
fad57d0e
MD
454struct vop_ncreate_args {
455 struct vop_generic_args a_head;
28623bf9 456 struct nchandle *a_nch; /* locked namespace */
dff430ab
MD
457 struct vnode *a_dvp; /* held directory vnode */
458 struct vnode **a_vpp; /* returned refd & locked */
fad57d0e
MD
459 struct ucred *a_cred;
460 struct vattr *a_vap;
461};
462
dff430ab
MD
463/*
464 * Warning: a_dvp is only held, not ref'd. The target must still vget()
465 * it.
466 */
fad57d0e
MD
467struct vop_nmkdir_args {
468 struct vop_generic_args a_head;
28623bf9 469 struct nchandle *a_nch; /* locked namespace */
dff430ab 470 struct vnode *a_dvp;
fad57d0e
MD
471 struct vnode **a_vpp; /* returned refd & locked */
472 struct ucred *a_cred;
473 struct vattr *a_vap;
474};
475
dff430ab
MD
476/*
477 * Warning: a_dvp is only held, not ref'd. The target must still vget()
478 * it.
479 */
fad57d0e
MD
480struct vop_nmknod_args {
481 struct vop_generic_args a_head;
28623bf9 482 struct nchandle *a_nch;
dff430ab 483 struct vnode *a_dvp;
fad57d0e
MD
484 struct vnode **a_vpp;
485 struct ucred *a_cred;
486 struct vattr *a_vap;
487};
488
dff430ab
MD
489/*
490 * Warning: a_dvp is only held, not ref'd. The target must still vget()
491 * it.
492 */
fad57d0e
MD
493struct vop_nlink_args {
494 struct vop_generic_args a_head;
28623bf9 495 struct nchandle *a_nch;
dff430ab 496 struct vnode *a_dvp;
fad57d0e
MD
497 struct vnode *a_vp;
498 struct ucred *a_cred;
499};
500
dff430ab
MD
501/*
502 * Warning: a_dvp is only held, not ref'd. The target must still vget()
503 * it.
504 */
fad57d0e
MD
505struct vop_nsymlink_args {
506 struct vop_generic_args a_head;
28623bf9 507 struct nchandle *a_nch;
dff430ab 508 struct vnode *a_dvp;
fad57d0e
MD
509 struct vnode **a_vpp;
510 struct ucred *a_cred;
511 struct vattr *a_vap;
512 char *a_target;
513};
514
dff430ab
MD
515/*
516 * Warning: a_dvp is only held, not ref'd. The target must still vget()
517 * it.
518 */
fad57d0e
MD
519struct vop_nwhiteout_args {
520 struct vop_generic_args a_head;
28623bf9 521 struct nchandle *a_nch;
dff430ab 522 struct vnode *a_dvp;
fad57d0e
MD
523 struct ucred *a_cred;
524 int a_flags;
525};
526
dff430ab
MD
527/*
528 * Warning: a_dvp is only held, not ref'd. The target must still vget()
529 * it.
530 */
fad57d0e
MD
531struct vop_nremove_args {
532 struct vop_generic_args a_head;
28623bf9 533 struct nchandle *a_nch; /* locked namespace */
dff430ab 534 struct vnode *a_dvp;
fad57d0e
MD
535 struct ucred *a_cred;
536};
537
dff430ab
MD
538/*
539 * Warning: a_dvp is only held, not ref'd. The target must still vget()
540 * it.
541 */
fad57d0e
MD
542struct vop_nrmdir_args {
543 struct vop_generic_args a_head;
28623bf9 544 struct nchandle *a_nch; /* locked namespace */
dff430ab 545 struct vnode *a_dvp;
fad57d0e
MD
546 struct ucred *a_cred;
547};
548
dff430ab
MD
549/*
550 * Warning: a_fdvp and a_tdvp are only held, not ref'd. The target must
551 * still vget() it.
552 */
fad57d0e
MD
553struct vop_nrename_args {
554 struct vop_generic_args a_head;
28623bf9
MD
555 struct nchandle *a_fnch; /* locked namespace / from */
556 struct nchandle *a_tnch; /* locked namespace / to */
dff430ab
MD
557 struct vnode *a_fdvp;
558 struct vnode *a_tdvp;
fad57d0e
MD
559 struct ucred *a_cred;
560};
561
2d3e977e 562/*
0961aa92
MD
563 * This structure is the post-compiled VOP operations vector. vop_ops are
564 * typically per-mount entities. The first section is used by our vop_*()
565 * function wrappers to implement hooks for per-mount management functions
566 * such as journaling and cache coherency protocols. The second section is
567 * the function dispatch for the VFSs. The functions are supposed to run
568 * in the context of the VFS's thread (if it has one) and should not be
569 * directly called from random kernel code. Note that VOCALL()s are direct
570 * calls used for chaining vop_ops structures from a VFS context.
2d3e977e
MD
571 */
572struct vop_ops {
66a1ddf5
MD
573 struct {
574 struct mount *vv_mount;
575 } head;
0961aa92 576
2d3e977e
MD
577#define vop_ops_first_field vop_default
578 int (*vop_default)(struct vop_generic_args *);
a11aaa81 579 int (*vop_unused11)(void *);
e62afb5f 580 int (*vop_old_lookup)(struct vop_old_lookup_args *);
fad57d0e 581 int (*vop_unused03)(void *);
e62afb5f
MD
582 int (*vop_old_create)(struct vop_old_create_args *);
583 int (*vop_old_whiteout)(struct vop_old_whiteout_args *);
584 int (*vop_old_mknod)(struct vop_old_mknod_args *);
2d3e977e
MD
585 int (*vop_open)(struct vop_open_args *);
586 int (*vop_close)(struct vop_close_args *);
587 int (*vop_access)(struct vop_access_args *);
588 int (*vop_getattr)(struct vop_getattr_args *);
589 int (*vop_setattr)(struct vop_setattr_args *);
590 int (*vop_read)(struct vop_read_args *);
591 int (*vop_write)(struct vop_write_args *);
e07fef60 592 int (*vop_unused04)(void *);
2d3e977e
MD
593 int (*vop_ioctl)(struct vop_ioctl_args *);
594 int (*vop_poll)(struct vop_poll_args *);
595 int (*vop_kqfilter)(struct vop_kqfilter_args *);
b8477cda 596 int (*vop_unused01)(void *); /* was vop_revoke */
2d3e977e
MD
597 int (*vop_mmap)(struct vop_mmap_args *);
598 int (*vop_fsync)(struct vop_fsync_args *);
e62afb5f
MD
599 int (*vop_old_remove)(struct vop_old_remove_args *);
600 int (*vop_old_link)(struct vop_old_link_args *);
601 int (*vop_old_rename)(struct vop_old_rename_args *);
602 int (*vop_old_mkdir)(struct vop_old_mkdir_args *);
603 int (*vop_old_rmdir)(struct vop_old_rmdir_args *);
604 int (*vop_old_symlink)(struct vop_old_symlink_args *);
2d3e977e
MD
605 int (*vop_readdir)(struct vop_readdir_args *);
606 int (*vop_readlink)(struct vop_readlink_args *);
607 int (*vop_inactive)(struct vop_inactive_args *);
608 int (*vop_reclaim)(struct vop_reclaim_args *);
a11aaa81
MD
609 int (*vop_unused09)(void *);
610 int (*vop_unused10)(void *);
2d3e977e
MD
611 int (*vop_bmap)(struct vop_bmap_args *);
612 int (*vop_strategy)(struct vop_strategy_args *);
613 int (*vop_print)(struct vop_print_args *);
614 int (*vop_pathconf)(struct vop_pathconf_args *);
615 int (*vop_advlock)(struct vop_advlock_args *);
616 int (*vop_balloc)(struct vop_balloc_args *);
617 int (*vop_reallocblks)(struct vop_reallocblks_args *);
618 int (*vop_getpages)(struct vop_getpages_args *);
619 int (*vop_putpages)(struct vop_putpages_args *);
620 int (*vop_freeblks)(struct vop_freeblks_args *);
62cfda27 621 int (*vop_unused05)(void *);
2d3e977e
MD
622 int (*vop_getacl)(struct vop_getacl_args *);
623 int (*vop_setacl)(struct vop_setacl_args *);
624 int (*vop_aclcheck)(struct vop_aclcheck_args *);
625 int (*vop_getextattr)(struct vop_getextattr_args *);
626 int (*vop_setextattr)(struct vop_setextattr_args *);
7540ab49
MD
627 int (*vop_unused06)(void *);
628 int (*vop_unused07)(void *);
62cfda27 629 int (*vop_unused08)(void *);
949ecb9b 630 int (*vop_mountctl)(struct vop_mountctl_args *);
349433c9 631 int (*vop_markatime)(struct vop_markatime_args *);
fad57d0e
MD
632
633 int (*vop_nresolve)(struct vop_nresolve_args *);
634 int (*vop_nlookupdotdot)(struct vop_nlookupdotdot_args *);
635 int (*vop_ncreate)(struct vop_ncreate_args *);
636 int (*vop_nmkdir)(struct vop_nmkdir_args *);
637 int (*vop_nmknod)(struct vop_nmknod_args *);
638 int (*vop_nlink)(struct vop_nlink_args *);
639 int (*vop_nsymlink)(struct vop_nsymlink_args *);
640 int (*vop_nwhiteout)(struct vop_nwhiteout_args *);
21739618 641 int (*vop_nremove)(struct vop_nremove_args *);
fad57d0e
MD
642 int (*vop_nrmdir)(struct vop_nrmdir_args *);
643 int (*vop_nrename)(struct vop_nrename_args *);
644#define vop_ops_last_field vop_nrename
2d3e977e
MD
645};
646
cbe54d63 647/*
949ecb9b 648 * vop_mountctl() operations
cbe54d63
MD
649 */
650#define VFSSET_DETACH 0
651#define VFSSET_ATTACH 1
0961aa92 652
2d3e977e
MD
653/*
654 * Kernel VOP arguments union, suitable for malloc / embedding in other
655 * structures. The vop_args_union can hold any VOP call argument structure.
656 * Note that vu_head is broken out.
657 */
658union vop_args_union {
659 struct vop_generic_args vu_head;
660 struct vop_generic_args vu_default;
e62afb5f
MD
661 struct vop_old_lookup_args vu_lookup;
662 struct vop_old_create_args vu_create;
663 struct vop_old_whiteout_args vu_whiteout;
664 struct vop_old_mknod_args vu_mknod;
2d3e977e
MD
665 struct vop_open_args vu_open;
666 struct vop_close_args vu_close;
667 struct vop_access_args vu_access;
668 struct vop_getattr_args vu_getattr;
669 struct vop_setattr_args vu_setattr;
670 struct vop_read_args vu_read;
671 struct vop_write_args vu_write;
2d3e977e
MD
672 struct vop_ioctl_args vu_ioctl;
673 struct vop_poll_args vu_poll;
674 struct vop_kqfilter_args vu_kqfilter;
2d3e977e
MD
675 struct vop_mmap_args vu_mmap;
676 struct vop_fsync_args vu_fsync;
e62afb5f
MD
677 struct vop_old_remove_args vu_remove;
678 struct vop_old_link_args vu_link;
679 struct vop_old_rename_args vu_rename;
680 struct vop_old_mkdir_args vu_mkdir;
681 struct vop_old_rmdir_args vu_rmdir;
682 struct vop_old_symlink_args vu_symlink;
2d3e977e
MD
683 struct vop_readdir_args vu_readdir;
684 struct vop_readlink_args vu_readlink;
685 struct vop_inactive_args vu_inactive;
686 struct vop_reclaim_args vu_reclaim;
2d3e977e
MD
687 struct vop_bmap_args vu_bmap;
688 struct vop_strategy_args vu_strategy;
689 struct vop_print_args vu_print;
690 struct vop_pathconf_args vu_pathconf;
691 struct vop_advlock_args vu_advlock;
692 struct vop_balloc_args vu_balloc;
693 struct vop_reallocblks_args vu_reallocblks;
694 struct vop_getpages_args vu_getpages;
695 struct vop_putpages_args vu_putpages;
696 struct vop_freeblks_args vu_freeblks;
2d3e977e
MD
697 struct vop_getacl_args vu_getacl;
698 struct vop_setacl_args vu_setacl;
699 struct vop_aclcheck_args vu_aclcheck;
700 struct vop_getextattr_args vu_getextattr;
701 struct vop_setextattr_args vu_setextattr;
949ecb9b 702 struct vop_mountctl_args vu_mountctl;
349433c9 703 struct vop_markatime_args vu_markatime;
fad57d0e
MD
704
705 struct vop_nresolve_args vu_nresolve;
706 struct vop_nlookupdotdot_args vu_nlookupdotdot;
707 struct vop_ncreate_args vu_ncreate;
708 struct vop_nmkdir_args vu_nmkdir;
709 struct vop_nmknod_args vu_nmknod;
710 struct vop_nlink_args vu_nlink;
711 struct vop_nsymlink_args vu_nsymlink;
712 struct vop_nwhiteout_args vu_nwhiteout;
713 struct vop_nremove_args vu_nremove;
714 struct vop_nrmdir_args vu_nrmdir;
715 struct vop_nrename_args vu_nrename;
2d3e977e
MD
716};
717
718#ifdef _KERNEL
719
720/*
721 * Kernel VOP call wrappers. These wrappers are responsible for wrapping
722 * the arguments in the appropriate VOP arguments structure, sending the
723 * message, and waiting for a reply. All kernel and VFS code should generally
724 * call these wrappers rather then attempt to call the operations vector
725 * routine directly in order to allow DragonFly to properly wrap the operation
726 * in a message and dispatch it to the correct thread.
727 */
e62afb5f 728int vop_old_lookup(struct vop_ops *ops, struct vnode *dvp,
26b67a34 729 struct vnode **vpp, struct componentname *cnp);
e62afb5f 730int vop_old_create(struct vop_ops *ops, struct vnode *dvp,
2d3e977e
MD
731 struct vnode **vpp, struct componentname *cnp,
732 struct vattr *vap);
e62afb5f 733int vop_old_whiteout(struct vop_ops *ops, struct vnode *dvp,
2d3e977e 734 struct componentname *cnp, int flags);
e62afb5f 735int vop_old_mknod(struct vop_ops *ops, struct vnode *dvp,
2d3e977e
MD
736 struct vnode **vpp, struct componentname *cnp,
737 struct vattr *vap);
0961aa92 738int vop_open(struct vop_ops *ops, struct vnode *vp, int mode,
87de5057
MD
739 struct ucred *cred, struct file *file);
740int vop_close(struct vop_ops *ops, struct vnode *vp, int fflag);
b2aed953 741int vop_access(struct vop_ops *ops, struct vnode *vp, int mode, int flags,
87de5057
MD
742 struct ucred *cred);
743int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap);
0961aa92 744int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
87de5057 745 struct ucred *cred);
0961aa92
MD
746int vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
747 int ioflag, struct ucred *cred);
748int vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
749 int ioflag, struct ucred *cred);
0961aa92 750int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command,
87baaf0c
MD
751 caddr_t data, int fflag, struct ucred *cred,
752 struct sysmsg *msg);
0961aa92 753int vop_poll(struct vop_ops *ops, struct vnode *vp, int events,
87de5057 754 struct ucred *cred);
0961aa92 755int vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn);
0961aa92 756int vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags,
87de5057 757 struct ucred *cred);
52174f71 758int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, int flags);
e62afb5f 759int vop_old_remove(struct vop_ops *ops, struct vnode *dvp,
2d3e977e 760 struct vnode *vp, struct componentname *cnp);
e62afb5f 761int vop_old_link(struct vop_ops *ops, struct vnode *tdvp,
2d3e977e 762 struct vnode *vp, struct componentname *cnp);
e62afb5f 763int vop_old_rename(struct vop_ops *ops, struct vnode *fdvp,
2d3e977e 764 struct vnode *fvp, struct componentname *fcnp,
fad57d0e
MD
765 struct vnode *tdvp, struct vnode *tvp,
766 struct componentname *tcnp);
e62afb5f 767int vop_old_mkdir(struct vop_ops *ops, struct vnode *dvp,
2d3e977e
MD
768 struct vnode **vpp, struct componentname *cnp,
769 struct vattr *vap);
e62afb5f 770int vop_old_rmdir(struct vop_ops *ops, struct vnode *dvp,
2d3e977e 771 struct vnode *vp, struct componentname *cnp);
e62afb5f 772int vop_old_symlink(struct vop_ops *ops, struct vnode *dvp,
2d3e977e
MD
773 struct vnode **vpp, struct componentname *cnp,
774 struct vattr *vap, char *target);
0961aa92 775int vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
2d3e977e 776 struct ucred *cred, int *eofflag,
84009d92 777 int *ncookies, off_t **cookies);
0961aa92 778int vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
2d3e977e 779 struct ucred *cred);
87de5057
MD
780int vop_inactive(struct vop_ops *ops, struct vnode *vp);
781int vop_reclaim(struct vop_ops *ops, struct vnode *vp);
54078292 782int vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset,
e92ca23a 783 off_t *doffsetp, int *runp, int *runb, buf_cmd_t cmd);
81b5c339 784int vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio);
0961aa92
MD
785int vop_print(struct vop_ops *ops, struct vnode *vp);
786int vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
2d3e977e 787 register_t *retval);
0961aa92 788int vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
2d3e977e 789 struct flock *fl, int flags);
0961aa92 790int vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
2d3e977e
MD
791 int size, struct ucred *cred, int flags,
792 struct buf **bpp);
0961aa92 793int vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
2d3e977e 794 struct cluster_save *buflist);
0961aa92
MD
795int vop_getpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
796 int count, int reqpage, vm_ooffset_t offset);
797int vop_putpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
798 int count, int sync, int *rtvals, vm_ooffset_t offset);
799int vop_freeblks(struct vop_ops *ops, struct vnode *vp,
54078292 800 off_t offset, int length);
0961aa92 801int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 802 struct acl *aclp, struct ucred *cred);
0961aa92 803int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 804 struct acl *aclp, struct ucred *cred);
0961aa92 805int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 806 struct acl *aclp, struct ucred *cred);
0961aa92 807int vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 808 struct uio *uio, struct ucred *cred);
0961aa92 809int vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 810 struct uio *uio, struct ucred *cred);
2281065e
MD
811int vop_mountctl(struct vop_ops *ops, int op, struct file *fp,
812 const void *ctl, int ctllen, void *buf, int buflen, int *res);
349433c9 813int vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred);
28623bf9 814int vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
dff430ab 815 struct vnode *dvp, struct ucred *cred);
fad57d0e 816int vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
33387738 817 struct vnode **vpp, struct ucred *cred, char **fakename);
dff430ab 818int vop_ncreate(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e 819 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
dff430ab 820int vop_nmkdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e 821 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
dff430ab 822int vop_nmknod(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e 823 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
dff430ab
MD
824int vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
825 struct vnode *vp, struct ucred *cred);
826int vop_nsymlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
827 struct vnode **vpp, struct ucred *cred,
828 struct vattr *vap, char *target);
dff430ab 829int vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e 830 struct ucred *cred, int flags);
dff430ab
MD
831int vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
832 struct ucred *cred);
833int vop_nrmdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e 834 struct ucred *cred);
dff430ab
MD
835int vop_nrename(struct vop_ops *ops,
836 struct nchandle *fnch, struct nchandle *tnch,
837 struct vnode *fdvp, struct vnode *tdvp,
fad57d0e 838 struct ucred *cred);
21739618 839
0961aa92
MD
840/*
841 * Kernel VOP forwarding wrappers. These are called when a VFS such as
842 * nullfs or unionfs needs to push down into another VFS, changing the
843 * a_ops pointer and consequentially necessitating additional
844 * cache management.
845 *
846 * Note that this is different from vop_ops chaining within the same
847 * filesystem. When a filesystem chains a vop_ops it just uses VOCALLs.
848 */
849int vop_vnoperate_ap(struct vop_generic_args *ap);
6ddb7618
MD
850int vop_cache_operate_ap(struct vop_generic_args *ap);
851int vop_journal_operate_ap(struct vop_generic_args *ap);
e62afb5f
MD
852int vop_old_lookup_ap(struct vop_old_lookup_args *ap);
853int vop_old_create_ap(struct vop_old_create_args *ap);
854int vop_old_whiteout_ap(struct vop_old_whiteout_args *ap);
855int vop_old_mknod_ap(struct vop_old_mknod_args *ap);
0961aa92
MD
856int vop_open_ap(struct vop_open_args *ap);
857int vop_close_ap(struct vop_close_args *ap);
858int vop_access_ap(struct vop_access_args *ap);
859int vop_getattr_ap(struct vop_getattr_args *ap);
860int vop_setattr_ap(struct vop_setattr_args *ap);
861int vop_read_ap(struct vop_read_args *ap);
862int vop_write_ap(struct vop_write_args *ap);
0961aa92
MD
863int vop_ioctl_ap(struct vop_ioctl_args *ap);
864int vop_poll_ap(struct vop_poll_args *ap);
865int vop_kqfilter_ap(struct vop_kqfilter_args *ap);
0961aa92
MD
866int vop_mmap_ap(struct vop_mmap_args *ap);
867int vop_fsync_ap(struct vop_fsync_args *ap);
e62afb5f
MD
868int vop_old_remove_ap(struct vop_old_remove_args *ap);
869int vop_old_link_ap(struct vop_old_link_args *ap);
870int vop_old_rename_ap(struct vop_old_rename_args *ap);
871int vop_old_mkdir_ap(struct vop_old_mkdir_args *ap);
872int vop_old_rmdir_ap(struct vop_old_rmdir_args *ap);
873int vop_old_symlink_ap(struct vop_old_symlink_args *ap);
0961aa92
MD
874int vop_readdir_ap(struct vop_readdir_args *ap);
875int vop_readlink_ap(struct vop_readlink_args *ap);
876int vop_inactive_ap(struct vop_inactive_args *ap);
877int vop_reclaim_ap(struct vop_reclaim_args *ap);
0961aa92
MD
878int vop_bmap_ap(struct vop_bmap_args *ap);
879int vop_strategy_ap(struct vop_strategy_args *ap);
880int vop_print_ap(struct vop_print_args *ap);
881int vop_pathconf_ap(struct vop_pathconf_args *ap);
882int vop_advlock_ap(struct vop_advlock_args *ap);
883int vop_balloc_ap(struct vop_balloc_args *ap);
884int vop_reallocblks_ap(struct vop_reallocblks_args *ap);
885int vop_getpages_ap(struct vop_getpages_args *ap);
886int vop_putpages_ap(struct vop_putpages_args *ap);
887int vop_freeblks_ap(struct vop_freeblks_args *ap);
0961aa92
MD
888int vop_getacl_ap(struct vop_getacl_args *ap);
889int vop_setacl_ap(struct vop_setacl_args *ap);
890int vop_aclcheck_ap(struct vop_aclcheck_args *ap);
891int vop_getextattr_ap(struct vop_getextattr_args *ap);
892int vop_setextattr_ap(struct vop_setextattr_args *ap);
949ecb9b 893int vop_mountctl_ap(struct vop_mountctl_args *ap);
349433c9 894int vop_markatime_ap(struct vop_markatime_args *ap);
2d3e977e 895
fad57d0e
MD
896int vop_nresolve_ap(struct vop_nresolve_args *ap);
897int vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap);
898int vop_ncreate_ap(struct vop_ncreate_args *ap);
899int vop_nmkdir_ap(struct vop_nmkdir_args *ap);
900int vop_nmknod_ap(struct vop_nmknod_args *ap);
901int vop_nlink_ap(struct vop_nlink_args *ap);
902int vop_nsymlink_ap(struct vop_nsymlink_args *ap);
903int vop_nwhiteout_ap(struct vop_nwhiteout_args *ap);
904int vop_nremove_ap(struct vop_nremove_args *ap);
905int vop_nrmdir_ap(struct vop_nrmdir_args *ap);
906int vop_nrename_ap(struct vop_nrename_args *ap);
907
2d3e977e 908/*
0961aa92 909 * VOP operations descriptor. This is used by the vop_ops compiler
2d3e977e
MD
910 * to convert VFS vector arrays (typically in vfs/blah/blah_vnops.c)
911 * into a vop_ops operations vector.
912 */
31bd717a 913extern struct syslink_desc vop_default_desc;
31bd717a
MD
914extern struct syslink_desc vop_old_lookup_desc;
915extern struct syslink_desc vop_old_create_desc;
916extern struct syslink_desc vop_old_whiteout_desc;
917extern struct syslink_desc vop_old_mknod_desc;
918extern struct syslink_desc vop_open_desc;
919extern struct syslink_desc vop_close_desc;
920extern struct syslink_desc vop_access_desc;
921extern struct syslink_desc vop_getattr_desc;
922extern struct syslink_desc vop_setattr_desc;
923extern struct syslink_desc vop_read_desc;
924extern struct syslink_desc vop_write_desc;
925extern struct syslink_desc vop_ioctl_desc;
926extern struct syslink_desc vop_poll_desc;
927extern struct syslink_desc vop_kqfilter_desc;
31bd717a
MD
928extern struct syslink_desc vop_mmap_desc;
929extern struct syslink_desc vop_fsync_desc;
930extern struct syslink_desc vop_old_remove_desc;
931extern struct syslink_desc vop_old_link_desc;
932extern struct syslink_desc vop_old_rename_desc;
933extern struct syslink_desc vop_old_mkdir_desc;
934extern struct syslink_desc vop_old_rmdir_desc;
935extern struct syslink_desc vop_old_symlink_desc;
936extern struct syslink_desc vop_readdir_desc;
937extern struct syslink_desc vop_readlink_desc;
938extern struct syslink_desc vop_inactive_desc;
939extern struct syslink_desc vop_reclaim_desc;
31bd717a
MD
940extern struct syslink_desc vop_bmap_desc;
941extern struct syslink_desc vop_strategy_desc;
942extern struct syslink_desc vop_print_desc;
943extern struct syslink_desc vop_pathconf_desc;
944extern struct syslink_desc vop_advlock_desc;
945extern struct syslink_desc vop_balloc_desc;
946extern struct syslink_desc vop_reallocblks_desc;
947extern struct syslink_desc vop_getpages_desc;
948extern struct syslink_desc vop_putpages_desc;
949extern struct syslink_desc vop_freeblks_desc;
950extern struct syslink_desc vop_getacl_desc;
951extern struct syslink_desc vop_setacl_desc;
952extern struct syslink_desc vop_aclcheck_desc;
953extern struct syslink_desc vop_getextattr_desc;
954extern struct syslink_desc vop_setextattr_desc;
955extern struct syslink_desc vop_mountctl_desc;
349433c9 956extern struct syslink_desc vop_markatime_desc;
31bd717a
MD
957
958extern struct syslink_desc vop_nresolve_desc;
959extern struct syslink_desc vop_nlookupdotdot_desc;
960extern struct syslink_desc vop_ncreate_desc;
961extern struct syslink_desc vop_nmkdir_desc;
962extern struct syslink_desc vop_nmknod_desc;
963extern struct syslink_desc vop_nlink_desc;
964extern struct syslink_desc vop_nsymlink_desc;
965extern struct syslink_desc vop_nwhiteout_desc;
966extern struct syslink_desc vop_nremove_desc;
967extern struct syslink_desc vop_nrmdir_desc;
968extern struct syslink_desc vop_nrename_desc;
fad57d0e 969
2d3e977e
MD
970#endif
971
972/*
fad57d0e
MD
973 * VOP_*() convenience macros extract the operations vector and make the
974 * vop_*() call.
2d3e977e 975 */
87de5057
MD
976#define VOP_OPEN(vp, mode, cred, fp) \
977 vop_open(*(vp)->v_ops, vp, mode, cred, fp)
978#define VOP_CLOSE(vp, fflag) \
979 vop_close(*(vp)->v_ops, vp, fflag)
980#define VOP_ACCESS(vp, mode, cred) \
b2aed953 981 vop_access(*(vp)->v_ops, vp, mode, 0, cred)
cb66845a
MD
982#define VOP_EACCESS(vp, mode, cred) \
983 vop_access(*(vp)->v_ops, vp, mode, AT_EACCESS, cred)
b2aed953
NT
984#define VOP_ACCESS_FLAGS(vp, mode, flags, cred) \
985 vop_access(*(vp)->v_ops, vp, mode, flags, cred)
87de5057
MD
986#define VOP_GETATTR(vp, vap) \
987 vop_getattr(*(vp)->v_ops, vp, vap)
988#define VOP_SETATTR(vp, vap, cred) \
989 vop_setattr(*(vp)->v_ops, vp, vap, cred)
2d3e977e 990#define VOP_READ(vp, uio, ioflag, cred) \
6ddb7618 991 vop_read(*(vp)->v_ops, vp, uio, ioflag, cred)
2d3e977e 992#define VOP_WRITE(vp, uio, ioflag, cred) \
6ddb7618 993 vop_write(*(vp)->v_ops, vp, uio, ioflag, cred)
87baaf0c
MD
994#define VOP_IOCTL(vp, command, data, fflag, cred, msg) \
995 vop_ioctl(*(vp)->v_ops, vp, command, data, fflag, cred, msg)
87de5057
MD
996#define VOP_POLL(vp, events, cred) \
997 vop_poll(*(vp)->v_ops, vp, events, cred)
2d3e977e 998#define VOP_KQFILTER(vp, kn) \
6ddb7618 999 vop_kqfilter(*(vp)->v_ops, vp, kn)
87de5057
MD
1000#define VOP_MMAP(vp, fflags, cred) \
1001 vop_mmap(*(vp)->v_ops, vp, fflags, cred)
52174f71
MD
1002#define VOP_FSYNC(vp, waitfor, flags) \
1003 vop_fsync(*(vp)->v_ops, vp, waitfor, flags)
2d3e977e 1004#define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) \
6ddb7618 1005 vop_readdir(*(vp)->v_ops, vp, uio, cred, eofflag, ncookies, cookies)
2d3e977e 1006#define VOP_READLINK(vp, uio, cred) \
6ddb7618 1007 vop_readlink(*(vp)->v_ops, vp, uio, cred)
87de5057
MD
1008#define VOP_INACTIVE(vp) \
1009 vop_inactive(*(vp)->v_ops, vp)
1010#define VOP_RECLAIM(vp) \
1011 vop_reclaim(*(vp)->v_ops, vp)
e92ca23a
MD
1012#define VOP_BMAP(vp, loff, doffp, runp, runb, cmd) \
1013 vop_bmap(*(vp)->v_ops, vp, loff, doffp, runp, runb, cmd)
2d3e977e 1014#define VOP_PRINT(vp) \
6ddb7618 1015 vop_print(*(vp)->v_ops, vp)
2d3e977e 1016#define VOP_PATHCONF(vp, name, retval) \
6ddb7618 1017 vop_pathconf(*(vp)->v_ops, vp, name, retval)
2d3e977e 1018#define VOP_ADVLOCK(vp, id, op, fl, flags) \
6ddb7618 1019 vop_advlock(*(vp)->v_ops, vp, id, op, fl, flags)
2d3e977e 1020#define VOP_BALLOC(vp, offset, size, cred, flags, bpp) \
6ddb7618 1021 vop_balloc(*(vp)->v_ops, vp, offset, size, cred, flags, bpp)
2d3e977e 1022#define VOP_REALLOCBLKS(vp, buflist) \
6ddb7618 1023 vop_reallocblks(*(vp)->v_ops, vp, buflist)
2d3e977e 1024#define VOP_GETPAGES(vp, m, count, reqpage, off) \
6ddb7618 1025 vop_getpages(*(vp)->v_ops, vp, m, count, reqpage, off)
2d3e977e 1026#define VOP_PUTPAGES(vp, m, count, sync, rtvals, off) \
6ddb7618 1027 vop_putpages(*(vp)->v_ops, vp, m, count, sync, rtvals, off)
54078292
MD
1028#define VOP_FREEBLKS(vp, offset, length) \
1029 vop_freeblks(*(vp)->v_ops, vp, offset, length)
87de5057
MD
1030#define VOP_GETACL(vp, type, aclp, cred) \
1031 vop_getacl(*(vp)->v_ops, vp, type, aclp, cred)
1032#define VOP_SETACL(vp, type, aclp, cred) \
1033 vop_setacl(*(vp)->v_ops, vp, type, aclp, cred)
1034#define VOP_ACLCHECK(vp, type, aclp, cred) \
1035 vop_aclcheck(*(vp)->v_ops, vp, type, aclp, cred)
1036#define VOP_GETEXTATTR(vp, name, uio, cred) \
1037 vop_getextattr(*(vp)->v_ops, vp, name, uio, cred)
1038#define VOP_SETEXTATTR(vp, name, uio, cred) \
1039 vop_setextattr(*(vp)->v_ops, vp, name, uio, cred)
349433c9
MD
1040#define VOP_MARKATIME(vp, cred) \
1041 vop_markatime(*(vp)->v_ops, vp, cred)
cbe54d63 1042/* no VOP_VFSSET() */
81b5c339 1043/* VOP_STRATEGY - does not exist, use vn_strategy() */
2d3e977e 1044
fad57d0e
MD
1045/*
1046 * 'OLD' VOP calls. These calls may only be made by the new API
1047 * compatibility functions in kern/vfs_default.c. Attempting to
1048 * call these functions directly will confuse the namecache. These
1049 * calls are deprecated and being removed from the system and from
1050 * the VFS's.
1051 */
1052#define VOP_OLD_LOOKUP(dvp, vpp, cnp) \
e62afb5f 1053 vop_old_lookup(*(dvp)->v_ops, dvp, vpp, cnp)
fad57d0e 1054#define VOP_OLD_CREATE(dvp, vpp, cnp, vap) \
e62afb5f 1055 vop_old_create(*(dvp)->v_ops, dvp, vpp, cnp, vap)
fad57d0e 1056#define VOP_OLD_MKDIR(dvp, vpp, cnp, vap) \
e62afb5f 1057 vop_old_mkdir(*(dvp)->v_ops, dvp, vpp, cnp, vap)
fad57d0e 1058#define VOP_OLD_MKNOD(dvp, vpp, cnp, vap) \
e62afb5f 1059 vop_old_mknod(*(dvp)->v_ops, dvp, vpp, cnp, vap)
fad57d0e 1060#define VOP_OLD_LINK(tdvp, vp, cnp) \
e62afb5f 1061 vop_old_link(*(tdvp)->v_ops, tdvp, vp, cnp)
fad57d0e 1062#define VOP_OLD_SYMLINK(dvp, vpp, cnp, vap, target) \
e62afb5f 1063 vop_old_symlink(*(dvp)->v_ops, dvp, vpp, cnp, vap, target)
fad57d0e 1064#define VOP_OLD_WHITEOUT(dvp, cnp, flags) \
e62afb5f 1065 vop_old_whiteout(*(dvp)->v_ops, dvp, cnp, flags)
fad57d0e 1066#define VOP_OLD_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp) \
e62afb5f 1067 vop_old_rename(*(fdvp)->v_ops, fdvp, fvp, fcnp, tdvp, tvp, tcnp)
fad57d0e 1068#define VOP_OLD_RMDIR(dvp, vp, cnp) \
e62afb5f 1069 vop_old_rmdir(*(dvp)->v_ops, dvp, vp, cnp)
fad57d0e 1070#define VOP_OLD_REMOVE(dvp, vp, cnp) \
e62afb5f 1071 vop_old_remove(*(dvp)->v_ops, dvp, vp, cnp)
fad57d0e
MD
1072
1073/*
1074 * 'NEW' VOP calls. These calls use namespaces as an operational basis
1075 * rather then vnodes and replace the OLD calls. Eventually all VFS's
1076 * will support these calls. Those that do not fall through to compatibility
1077 * code in kern/vfs_default which does the magic required to call the old
1078 * routines.
1079 */
dff430ab
MD
1080#define VOP_NRESOLVE(nch, dvp, cred) \
1081 vop_nresolve((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
33387738
MD
1082#define VOP_NLOOKUPDOTDOT(dvp, vpp, cred, fakename) \
1083 vop_nlookupdotdot(*(dvp)->v_ops, dvp, vpp, cred, fakename)
dff430ab
MD
1084#define VOP_NCREATE(nch, dvp, vpp, cred, vap) \
1085 vop_ncreate((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1086#define VOP_NMKDIR(nch, dvp, vpp, cred, vap) \
1087 vop_nmkdir((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1088#define VOP_NMKNOD(nch, dvp, vpp, cred, vap) \
1089 vop_nmknod((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1090#define VOP_NLINK(nch, dvp, vp, cred) \
1091 vop_nlink((nch)->mount->mnt_vn_use_ops, nch, dvp, vp, cred)
1092#define VOP_NSYMLINK(nch, dvp, vpp, cred, vap, target) \
1093 vop_nsymlink((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap, target)
1094#define VOP_NWHITEOUT(nch, dvp, cred, flags) \
1095 vop_nwhiteout((nch)->mount->mnt_vn_use_ops, nch, dvp, cred, flags)
1096#define VOP_NRENAME(fnch, tnch, fdvp, tdvp, cred) \
1097 vop_nrename((fnch)->mount->mnt_vn_use_ops, fnch, tnch, fdvp, tdvp, cred)
1098#define VOP_NRMDIR(nch, dvp, cred) \
1099 vop_nrmdir((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
1100#define VOP_NREMOVE(nch, dvp, cred) \
1101 vop_nremove((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
fad57d0e 1102
2d3e977e
MD
1103#endif
1104