diskless: Miscellaneous fixes.
[dragonfly.git] / sys / kern / vfs_vopops.c
CommitLineData
2d3e977e 1/*
aac0aabd 2 * Copyright (c) 2004,2009 The DragonFly Project. All rights reserved.
2d3e977e
MD
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.
aac0aabd
MD
33 */
34/*
35 * Implement vnode ops wrappers. All vnode ops are wrapped through
36 * these functions.
37 *
38 * These wrappers are responsible for hanlding all MPSAFE issues related
39 * to a vnode operation.
2d3e977e
MD
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/buf.h>
45#include <sys/conf.h>
46#include <sys/dirent.h>
47#include <sys/domain.h>
48#include <sys/eventhandler.h>
49#include <sys/fcntl.h>
50#include <sys/kernel.h>
51#include <sys/kthread.h>
52#include <sys/malloc.h>
53#include <sys/mbuf.h>
54#include <sys/mount.h>
55#include <sys/proc.h>
56#include <sys/namei.h>
57#include <sys/reboot.h>
58#include <sys/socket.h>
59#include <sys/stat.h>
60#include <sys/sysctl.h>
61#include <sys/syslog.h>
62#include <sys/vmmeter.h>
63#include <sys/vnode.h>
0961aa92 64#include <sys/vfsops.h>
87baaf0c 65#include <sys/sysmsg.h>
2d3e977e
MD
66
67#include <machine/limits.h>
68
69#include <vm/vm.h>
70#include <vm/vm_object.h>
71#include <vm/vm_extern.h>
72#include <vm/vm_kern.h>
73#include <vm/pmap.h>
74#include <vm/vm_map.h>
75#include <vm/vm_page.h>
76#include <vm/vm_pager.h>
77#include <vm/vnode_pager.h>
78#include <vm/vm_zone.h>
79
80#include <sys/buf2.h>
81#include <sys/thread2.h>
aac0aabd 82#include <sys/mplock2.h>
2d3e977e 83
2d3e977e 84#define VDESCNAME(name) __CONCAT(__CONCAT(vop_,name),_desc)
2d3e977e 85
88e4088e 86#define VNODEOP_DESC_INIT(name) \
31bd717a 87 struct syslink_desc VDESCNAME(name) = { \
2d3e977e 88 __offsetof(struct vop_ops, __CONCAT(vop_, name)), \
88e4088e 89 #name }
2d3e977e 90
31bd717a 91VNODEOP_DESC_INIT(default);
31bd717a
MD
92VNODEOP_DESC_INIT(old_lookup);
93VNODEOP_DESC_INIT(old_create);
94VNODEOP_DESC_INIT(old_whiteout);
95VNODEOP_DESC_INIT(old_mknod);
96VNODEOP_DESC_INIT(open);
97VNODEOP_DESC_INIT(close);
98VNODEOP_DESC_INIT(access);
99VNODEOP_DESC_INIT(getattr);
100VNODEOP_DESC_INIT(setattr);
101VNODEOP_DESC_INIT(read);
102VNODEOP_DESC_INIT(write);
103VNODEOP_DESC_INIT(ioctl);
104VNODEOP_DESC_INIT(poll);
105VNODEOP_DESC_INIT(kqfilter);
31bd717a
MD
106VNODEOP_DESC_INIT(mmap);
107VNODEOP_DESC_INIT(fsync);
108VNODEOP_DESC_INIT(old_remove);
109VNODEOP_DESC_INIT(old_link);
110VNODEOP_DESC_INIT(old_rename);
2d3e977e 111
31bd717a
MD
112VNODEOP_DESC_INIT(old_mkdir);
113VNODEOP_DESC_INIT(old_rmdir);
114VNODEOP_DESC_INIT(old_symlink);
115VNODEOP_DESC_INIT(readdir);
116VNODEOP_DESC_INIT(readlink);
117VNODEOP_DESC_INIT(inactive);
118VNODEOP_DESC_INIT(reclaim);
31bd717a
MD
119VNODEOP_DESC_INIT(bmap);
120VNODEOP_DESC_INIT(strategy);
121VNODEOP_DESC_INIT(print);
122VNODEOP_DESC_INIT(pathconf);
123VNODEOP_DESC_INIT(advlock);
124VNODEOP_DESC_INIT(balloc);
125VNODEOP_DESC_INIT(reallocblks);
126VNODEOP_DESC_INIT(getpages);
127VNODEOP_DESC_INIT(putpages);
128VNODEOP_DESC_INIT(freeblks);
129VNODEOP_DESC_INIT(getacl);
130VNODEOP_DESC_INIT(setacl);
131VNODEOP_DESC_INIT(aclcheck);
132VNODEOP_DESC_INIT(getextattr);
133VNODEOP_DESC_INIT(setextattr);
134VNODEOP_DESC_INIT(mountctl);
349433c9 135VNODEOP_DESC_INIT(markatime);
88e4088e 136
31bd717a
MD
137VNODEOP_DESC_INIT(nresolve);
138VNODEOP_DESC_INIT(nlookupdotdot);
139VNODEOP_DESC_INIT(ncreate);
140VNODEOP_DESC_INIT(nmkdir);
141VNODEOP_DESC_INIT(nmknod);
142VNODEOP_DESC_INIT(nlink);
143VNODEOP_DESC_INIT(nsymlink);
144VNODEOP_DESC_INIT(nwhiteout);
145VNODEOP_DESC_INIT(nremove);
146VNODEOP_DESC_INIT(nrmdir);
147VNODEOP_DESC_INIT(nrename);
fad57d0e 148
6ddb7618
MD
149#define DO_OPS(ops, error, ap, vop_field) \
150 error = ops->vop_field(ap);
2d3e977e 151
0961aa92
MD
152/************************************************************************
153 * PRIMARY HIGH LEVEL VNODE OPERATIONS CALLS *
154 ************************************************************************
155 *
156 * These procedures are called directly from the kernel and/or fileops
157 * code to perform file/device operations on the system.
e62afb5f 158 *
aac0aabd
MD
159 * NOTE: The old namespace api functions such as vop_rename() are no
160 * longer available for general use and have been renamed to
161 * vop_old_*(). Only the code in vfs_default.c is allowed to call
162 * those ops.
163 *
164 * NOTE: The VFS_MPLOCK*() macros handle mounts which do not set
165 * MNTK_MPSAFE or MNTK_xx_MPSAFE.
166 *
167 * MPSAFE
0961aa92
MD
168 */
169
2d3e977e 170int
e62afb5f 171vop_old_lookup(struct vop_ops *ops, struct vnode *dvp,
26b67a34 172 struct vnode **vpp, struct componentname *cnp)
2d3e977e 173{
e62afb5f 174 struct vop_old_lookup_args ap;
aac0aabd 175 VFS_MPLOCK_DECLARE;
cbe54d63 176 int error;
2d3e977e 177
e62afb5f 178 ap.a_head.a_desc = &vop_old_lookup_desc;
0961aa92 179 ap.a_head.a_ops = ops;
2d3e977e 180 ap.a_dvp = dvp;
2d3e977e 181 ap.a_vpp = vpp;
2d3e977e 182 ap.a_cnp = cnp;
2247fe02 183 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 184 DO_OPS(ops, error, &ap, vop_old_lookup);
aac0aabd 185 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 186 return(error);
2d3e977e
MD
187}
188
aac0aabd
MD
189/*
190 * MPSAFE
191 */
2d3e977e 192int
e62afb5f 193vop_old_create(struct vop_ops *ops, struct vnode *dvp,
0961aa92 194 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e 195{
e62afb5f 196 struct vop_old_create_args ap;
aac0aabd 197 VFS_MPLOCK_DECLARE;
cbe54d63 198 int error;
2d3e977e 199
e62afb5f 200 ap.a_head.a_desc = &vop_old_create_desc;
0961aa92 201 ap.a_head.a_ops = ops;
2d3e977e 202 ap.a_dvp = dvp;
2d3e977e
MD
203 ap.a_vpp = vpp;
204 ap.a_cnp = cnp;
205 ap.a_vap = vap;
cbe54d63 206
2247fe02 207 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 208 DO_OPS(ops, error, &ap, vop_old_create);
aac0aabd 209 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 210 return(error);
2d3e977e
MD
211}
212
aac0aabd
MD
213/*
214 * MPSAFE
215 */
2d3e977e 216int
e62afb5f 217vop_old_whiteout(struct vop_ops *ops, struct vnode *dvp,
0961aa92 218 struct componentname *cnp, int flags)
2d3e977e 219{
e62afb5f 220 struct vop_old_whiteout_args ap;
aac0aabd 221 VFS_MPLOCK_DECLARE;
cbe54d63 222 int error;
2d3e977e 223
e62afb5f 224 ap.a_head.a_desc = &vop_old_whiteout_desc;
0961aa92 225 ap.a_head.a_ops = ops;
2d3e977e 226 ap.a_dvp = dvp;
2d3e977e
MD
227 ap.a_cnp = cnp;
228 ap.a_flags = flags;
cbe54d63 229
2247fe02 230 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 231 DO_OPS(ops, error, &ap, vop_old_whiteout);
aac0aabd 232 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 233 return(error);
2d3e977e
MD
234}
235
aac0aabd
MD
236/*
237 * MPSAFE
238 */
2d3e977e 239int
e62afb5f 240vop_old_mknod(struct vop_ops *ops, struct vnode *dvp,
0961aa92 241 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e 242{
e62afb5f 243 struct vop_old_mknod_args ap;
aac0aabd 244 VFS_MPLOCK_DECLARE;
cbe54d63 245 int error;
2d3e977e 246
e62afb5f 247 ap.a_head.a_desc = &vop_old_mknod_desc;
0961aa92 248 ap.a_head.a_ops = ops;
2d3e977e 249 ap.a_dvp = dvp;
2d3e977e
MD
250 ap.a_vpp = vpp;
251 ap.a_cnp = cnp;
252 ap.a_vap = vap;
cbe54d63 253
2247fe02 254 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 255 DO_OPS(ops, error, &ap, vop_old_mknod);
aac0aabd 256 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 257 return(error);
2d3e977e
MD
258}
259
0e8bd897
MD
260/*
261 * NOTE: VAGE is always cleared when calling VOP_OPEN().
262 */
2d3e977e 263int
0961aa92 264vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred,
87de5057 265 struct file *fp)
2d3e977e
MD
266{
267 struct vop_open_args ap;
aac0aabd 268 VFS_MPLOCK_DECLARE;
cbe54d63 269 int error;
2d3e977e 270
0e8bd897
MD
271 /*
272 * Decrement 3-2-1-0. Does not decrement beyond 0
273 */
274 if (vp->v_flag & VAGE0) {
2247fe02 275 vclrflags(vp, VAGE0);
0e8bd897 276 } else if (vp->v_flag & VAGE1) {
2247fe02
MD
277 vclrflags(vp, VAGE1);
278 vsetflags(vp, VAGE0);
0e8bd897
MD
279 }
280
2d3e977e 281 ap.a_head.a_desc = &vop_open_desc;
0961aa92 282 ap.a_head.a_ops = ops;
2d3e977e 283 ap.a_vp = vp;
fad57d0e 284 ap.a_fp = fp;
2d3e977e
MD
285 ap.a_mode = mode;
286 ap.a_cred = cred;
cbe54d63 287
2247fe02 288 VFS_MPLOCK1(vp->v_mount);
cbe54d63 289 DO_OPS(ops, error, &ap, vop_open);
aac0aabd 290 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 291 return(error);
2d3e977e
MD
292}
293
aac0aabd
MD
294/*
295 * MPSAFE
296 */
2d3e977e 297int
87de5057 298vop_close(struct vop_ops *ops, struct vnode *vp, int fflag)
2d3e977e
MD
299{
300 struct vop_close_args ap;
aac0aabd 301 VFS_MPLOCK_DECLARE;
cbe54d63 302 int error;
2d3e977e
MD
303
304 ap.a_head.a_desc = &vop_close_desc;
0961aa92 305 ap.a_head.a_ops = ops;
2d3e977e
MD
306 ap.a_vp = vp;
307 ap.a_fflag = fflag;
cbe54d63 308
2247fe02 309 VFS_MPLOCK1(vp->v_mount);
cbe54d63 310 DO_OPS(ops, error, &ap, vop_close);
aac0aabd 311 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 312 return(error);
2d3e977e
MD
313}
314
aac0aabd
MD
315/*
316 * MPSAFE
317 */
2d3e977e 318int
b2aed953 319vop_access(struct vop_ops *ops, struct vnode *vp, int mode, int flags,
aac0aabd 320 struct ucred *cred)
2d3e977e
MD
321{
322 struct vop_access_args ap;
aac0aabd 323 VFS_MPLOCK_DECLARE;
cbe54d63 324 int error;
2d3e977e
MD
325
326 ap.a_head.a_desc = &vop_access_desc;
0961aa92 327 ap.a_head.a_ops = ops;
2d3e977e
MD
328 ap.a_vp = vp;
329 ap.a_mode = mode;
b2aed953 330 ap.a_flags = flags;
2d3e977e 331 ap.a_cred = cred;
cbe54d63 332
2247fe02 333 VFS_MPLOCK1(vp->v_mount);
cbe54d63 334 DO_OPS(ops, error, &ap, vop_access);
aac0aabd 335 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 336 return(error);
2d3e977e
MD
337}
338
aac0aabd
MD
339/*
340 * MPSAFE
341 */
2d3e977e 342int
87de5057 343vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap)
2d3e977e
MD
344{
345 struct vop_getattr_args ap;
aac0aabd 346 VFS_MPLOCK_DECLARE;
cbe54d63 347 int error;
2d3e977e
MD
348
349 ap.a_head.a_desc = &vop_getattr_desc;
0961aa92 350 ap.a_head.a_ops = ops;
2d3e977e
MD
351 ap.a_vp = vp;
352 ap.a_vap = vap;
cbe54d63 353
aac0aabd 354 VFS_MPLOCK_FLAG(vp->v_mount, MNTK_GA_MPSAFE);
cbe54d63 355 DO_OPS(ops, error, &ap, vop_getattr);
aac0aabd 356 VFS_MPUNLOCK(vp->v_mount);
2d7cae25 357
cbe54d63 358 return(error);
2d3e977e
MD
359}
360
aac0aabd
MD
361/*
362 * MPSAFE
363 */
2d3e977e 364int
0961aa92 365vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
87de5057 366 struct ucred *cred)
2d3e977e
MD
367{
368 struct vop_setattr_args ap;
aac0aabd 369 VFS_MPLOCK_DECLARE;
cbe54d63 370 int error;
2d3e977e
MD
371
372 ap.a_head.a_desc = &vop_setattr_desc;
0961aa92 373 ap.a_head.a_ops = ops;
2d3e977e
MD
374 ap.a_vp = vp;
375 ap.a_vap = vap;
376 ap.a_cred = cred;
cbe54d63 377
2247fe02 378 VFS_MPLOCK1(vp->v_mount);
cbe54d63 379 DO_OPS(ops, error, &ap, vop_setattr);
aac0aabd 380 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 381 return(error);
2d3e977e
MD
382}
383
aac0aabd
MD
384/*
385 * MPSAFE
386 */
2d3e977e 387int
0961aa92
MD
388vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
389 struct ucred *cred)
2d3e977e
MD
390{
391 struct vop_read_args ap;
aac0aabd 392 VFS_MPLOCK_DECLARE;
cbe54d63 393 int error;
2d3e977e
MD
394
395 ap.a_head.a_desc = &vop_read_desc;
0961aa92 396 ap.a_head.a_ops = ops;
2d3e977e
MD
397 ap.a_vp = vp;
398 ap.a_uio = uio;
399 ap.a_ioflag = ioflag;
400 ap.a_cred = cred;
cbe54d63 401
aac0aabd 402 VFS_MPLOCK_FLAG(vp->v_mount, MNTK_RD_MPSAFE);
cbe54d63 403 DO_OPS(ops, error, &ap, vop_read);
aac0aabd 404 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 405 return(error);
2d3e977e
MD
406}
407
aac0aabd
MD
408/*
409 * MPSAFE
410 */
2d3e977e 411int
0961aa92
MD
412vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
413 struct ucred *cred)
2d3e977e
MD
414{
415 struct vop_write_args ap;
aac0aabd 416 VFS_MPLOCK_DECLARE;
cbe54d63 417 int error;
2d3e977e
MD
418
419 ap.a_head.a_desc = &vop_write_desc;
0961aa92 420 ap.a_head.a_ops = ops;
2d3e977e
MD
421 ap.a_vp = vp;
422 ap.a_uio = uio;
423 ap.a_ioflag = ioflag;
424 ap.a_cred = cred;
cbe54d63 425
aac0aabd 426 VFS_MPLOCK_FLAG(vp->v_mount, MNTK_WR_MPSAFE);
cbe54d63 427 DO_OPS(ops, error, &ap, vop_write);
aac0aabd 428 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 429 return(error);
2d3e977e
MD
430}
431
aac0aabd
MD
432/*
433 * MPSAFE
434 */
2d3e977e 435int
0961aa92 436vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data,
87baaf0c 437 int fflag, struct ucred *cred, struct sysmsg *msg)
2d3e977e
MD
438{
439 struct vop_ioctl_args ap;
aac0aabd 440 VFS_MPLOCK_DECLARE;
cbe54d63 441 int error;
2d3e977e
MD
442
443 ap.a_head.a_desc = &vop_ioctl_desc;
0961aa92 444 ap.a_head.a_ops = ops;
2d3e977e
MD
445 ap.a_vp = vp;
446 ap.a_command = command;
447 ap.a_data = data;
448 ap.a_fflag = fflag;
449 ap.a_cred = cred;
87baaf0c 450 ap.a_sysmsg = msg;
cbe54d63 451
2247fe02 452 VFS_MPLOCK1(vp->v_mount);
cbe54d63 453 DO_OPS(ops, error, &ap, vop_ioctl);
aac0aabd 454 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 455 return(error);
2d3e977e
MD
456}
457
aac0aabd
MD
458/*
459 * MPSAFE
460 */
2d3e977e 461int
87de5057 462vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred)
2d3e977e
MD
463{
464 struct vop_poll_args ap;
aac0aabd 465 VFS_MPLOCK_DECLARE;
cbe54d63 466 int error;
2d3e977e
MD
467
468 ap.a_head.a_desc = &vop_poll_desc;
0961aa92 469 ap.a_head.a_ops = ops;
2d3e977e
MD
470 ap.a_vp = vp;
471 ap.a_events = events;
472 ap.a_cred = cred;
cbe54d63 473
2247fe02 474 VFS_MPLOCK1(vp->v_mount);
cbe54d63 475 DO_OPS(ops, error, &ap, vop_poll);
aac0aabd 476 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 477 return(error);
2d3e977e
MD
478}
479
aac0aabd
MD
480/*
481 * MPSAFE
482 */
2d3e977e 483int
0961aa92 484vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn)
2d3e977e
MD
485{
486 struct vop_kqfilter_args ap;
aac0aabd 487 VFS_MPLOCK_DECLARE;
cbe54d63 488 int error;
2d3e977e
MD
489
490 ap.a_head.a_desc = &vop_kqfilter_desc;
0961aa92 491 ap.a_head.a_ops = ops;
2d3e977e
MD
492 ap.a_vp = vp;
493 ap.a_kn = kn;
cbe54d63 494
2247fe02 495 VFS_MPLOCK1(vp->v_mount);
cbe54d63 496 DO_OPS(ops, error, &ap, vop_kqfilter);
aac0aabd 497 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 498 return(error);
2d3e977e
MD
499}
500
aac0aabd
MD
501/*
502 * MPSAFE
503 */
2d3e977e 504int
87de5057 505vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred)
2d3e977e
MD
506{
507 struct vop_mmap_args ap;
aac0aabd 508 VFS_MPLOCK_DECLARE;
cbe54d63 509 int error;
2d3e977e
MD
510
511 ap.a_head.a_desc = &vop_mmap_desc;
0961aa92 512 ap.a_head.a_ops = ops;
2d3e977e
MD
513 ap.a_vp = vp;
514 ap.a_fflags = fflags;
515 ap.a_cred = cred;
cbe54d63 516
2247fe02 517 VFS_MPLOCK1(vp->v_mount);
cbe54d63 518 DO_OPS(ops, error, &ap, vop_mmap);
aac0aabd 519 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 520 return(error);
2d3e977e
MD
521}
522
aac0aabd
MD
523/*
524 * MPSAFE
525 */
2d3e977e 526int
52174f71 527vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, int flags)
2d3e977e
MD
528{
529 struct vop_fsync_args ap;
aac0aabd 530 VFS_MPLOCK_DECLARE;
cbe54d63 531 int error;
2d3e977e
MD
532
533 ap.a_head.a_desc = &vop_fsync_desc;
0961aa92 534 ap.a_head.a_ops = ops;
2d3e977e
MD
535 ap.a_vp = vp;
536 ap.a_waitfor = waitfor;
52174f71 537 ap.a_flags = flags;
cbe54d63 538
2247fe02 539 VFS_MPLOCK1(vp->v_mount);
cbe54d63 540 DO_OPS(ops, error, &ap, vop_fsync);
aac0aabd 541 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 542 return(error);
2d3e977e
MD
543}
544
aac0aabd
MD
545/*
546 * MPSAFE
547 */
2d3e977e 548int
e62afb5f 549vop_old_remove(struct vop_ops *ops, struct vnode *dvp,
0961aa92 550 struct vnode *vp, struct componentname *cnp)
2d3e977e 551{
e62afb5f 552 struct vop_old_remove_args ap;
aac0aabd 553 VFS_MPLOCK_DECLARE;
cbe54d63 554 int error;
2d3e977e 555
e62afb5f 556 ap.a_head.a_desc = &vop_old_remove_desc;
0961aa92 557 ap.a_head.a_ops = ops;
2d3e977e 558 ap.a_dvp = dvp;
2d3e977e
MD
559 ap.a_vp = vp;
560 ap.a_cnp = cnp;
cbe54d63 561
2247fe02 562 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 563 DO_OPS(ops, error, &ap, vop_old_remove);
aac0aabd 564 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 565 return(error);
2d3e977e
MD
566}
567
aac0aabd
MD
568/*
569 * MPSAFE
570 */
21739618 571int
e62afb5f 572vop_old_link(struct vop_ops *ops, struct vnode *tdvp,
0961aa92 573 struct vnode *vp, struct componentname *cnp)
2d3e977e 574{
e62afb5f 575 struct vop_old_link_args ap;
aac0aabd 576 VFS_MPLOCK_DECLARE;
cbe54d63 577 int error;
2d3e977e 578
e62afb5f 579 ap.a_head.a_desc = &vop_old_link_desc;
0961aa92 580 ap.a_head.a_ops = ops;
2d3e977e 581 ap.a_tdvp = tdvp;
2d3e977e
MD
582 ap.a_vp = vp;
583 ap.a_cnp = cnp;
cbe54d63 584
2247fe02 585 VFS_MPLOCK1(tdvp->v_mount);
e62afb5f 586 DO_OPS(ops, error, &ap, vop_old_link);
aac0aabd 587 VFS_MPUNLOCK(tdvp->v_mount);
cbe54d63 588 return(error);
2d3e977e
MD
589}
590
aac0aabd
MD
591/*
592 * MPSAFE
593 */
2d3e977e 594int
e62afb5f 595vop_old_rename(struct vop_ops *ops,
fad57d0e
MD
596 struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp,
597 struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp)
2d3e977e 598{
e62afb5f 599 struct vop_old_rename_args ap;
aac0aabd 600 VFS_MPLOCK_DECLARE;
cbe54d63 601 int error;
2d3e977e 602
e62afb5f 603 ap.a_head.a_desc = &vop_old_rename_desc;
0961aa92 604 ap.a_head.a_ops = ops;
2d3e977e 605 ap.a_fdvp = fdvp;
2d3e977e
MD
606 ap.a_fvp = fvp;
607 ap.a_fcnp = fcnp;
608 ap.a_tdvp = tdvp;
2d3e977e
MD
609 ap.a_tvp = tvp;
610 ap.a_tcnp = tcnp;
cbe54d63 611
2247fe02 612 VFS_MPLOCK1(tdvp->v_mount);
e62afb5f 613 DO_OPS(ops, error, &ap, vop_old_rename);
aac0aabd 614 VFS_MPUNLOCK(tdvp->v_mount);
cbe54d63 615 return(error);
2d3e977e
MD
616}
617
aac0aabd
MD
618/*
619 * MPSAFE
620 */
2d3e977e 621int
e62afb5f 622vop_old_mkdir(struct vop_ops *ops, struct vnode *dvp,
0961aa92 623 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e 624{
e62afb5f 625 struct vop_old_mkdir_args ap;
aac0aabd 626 VFS_MPLOCK_DECLARE;
cbe54d63 627 int error;
2d3e977e 628
e62afb5f 629 ap.a_head.a_desc = &vop_old_mkdir_desc;
0961aa92 630 ap.a_head.a_ops = ops;
2d3e977e 631 ap.a_dvp = dvp;
2d3e977e
MD
632 ap.a_vpp = vpp;
633 ap.a_cnp = cnp;
634 ap.a_vap = vap;
cbe54d63 635
2247fe02 636 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 637 DO_OPS(ops, error, &ap, vop_old_mkdir);
aac0aabd 638 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 639 return(error);
2d3e977e
MD
640}
641
aac0aabd
MD
642/*
643 * MPSAFE
644 */
2d3e977e 645int
e62afb5f 646vop_old_rmdir(struct vop_ops *ops, struct vnode *dvp,
0961aa92 647 struct vnode *vp, struct componentname *cnp)
2d3e977e 648{
e62afb5f 649 struct vop_old_rmdir_args ap;
aac0aabd 650 VFS_MPLOCK_DECLARE;
cbe54d63 651 int error;
2d3e977e 652
e62afb5f 653 ap.a_head.a_desc = &vop_old_rmdir_desc;
0961aa92 654 ap.a_head.a_ops = ops;
2d3e977e 655 ap.a_dvp = dvp;
2d3e977e
MD
656 ap.a_vp = vp;
657 ap.a_cnp = cnp;
cbe54d63 658
2247fe02 659 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 660 DO_OPS(ops, error, &ap, vop_old_rmdir);
aac0aabd 661 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 662 return(error);
2d3e977e
MD
663}
664
aac0aabd
MD
665/*
666 * MPSAFE
667 */
2d3e977e 668int
e62afb5f 669vop_old_symlink(struct vop_ops *ops, struct vnode *dvp,
0961aa92
MD
670 struct vnode **vpp, struct componentname *cnp,
671 struct vattr *vap, char *target)
2d3e977e 672{
e62afb5f 673 struct vop_old_symlink_args ap;
aac0aabd 674 VFS_MPLOCK_DECLARE;
cbe54d63 675 int error;
2d3e977e 676
e62afb5f 677 ap.a_head.a_desc = &vop_old_symlink_desc;
0961aa92 678 ap.a_head.a_ops = ops;
2d3e977e 679 ap.a_dvp = dvp;
2d3e977e
MD
680 ap.a_vpp = vpp;
681 ap.a_cnp = cnp;
682 ap.a_vap = vap;
683 ap.a_target = target;
cbe54d63 684
2247fe02 685 VFS_MPLOCK1(dvp->v_mount);
e62afb5f 686 DO_OPS(ops, error, &ap, vop_old_symlink);
aac0aabd 687 VFS_MPUNLOCK(dvp->v_mount);
cbe54d63 688 return(error);
2d3e977e
MD
689}
690
aac0aabd
MD
691/*
692 * MPSAFE
693 */
2d3e977e 694int
0961aa92 695vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
84009d92 696 struct ucred *cred, int *eofflag, int *ncookies, off_t **cookies)
2d3e977e
MD
697{
698 struct vop_readdir_args ap;
aac0aabd 699 VFS_MPLOCK_DECLARE;
cbe54d63 700 int error;
2d3e977e
MD
701
702 ap.a_head.a_desc = &vop_readdir_desc;
0961aa92 703 ap.a_head.a_ops = ops;
2d3e977e
MD
704 ap.a_vp = vp;
705 ap.a_uio = uio;
706 ap.a_cred = cred;
707 ap.a_eofflag = eofflag;
708 ap.a_ncookies = ncookies;
709 ap.a_cookies = cookies;
cbe54d63 710
2247fe02 711 VFS_MPLOCK1(vp->v_mount);
cbe54d63 712 DO_OPS(ops, error, &ap, vop_readdir);
aac0aabd 713 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 714 return(error);
2d3e977e
MD
715}
716
aac0aabd
MD
717/*
718 * MPSAFE
719 */
2d3e977e 720int
0961aa92
MD
721vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
722 struct ucred *cred)
2d3e977e
MD
723{
724 struct vop_readlink_args ap;
aac0aabd 725 VFS_MPLOCK_DECLARE;
cbe54d63 726 int error;
2d3e977e
MD
727
728 ap.a_head.a_desc = &vop_readlink_desc;
0961aa92 729 ap.a_head.a_ops = ops;
2d3e977e
MD
730 ap.a_vp = vp;
731 ap.a_uio = uio;
732 ap.a_cred = cred;
cbe54d63 733
2247fe02 734 VFS_MPLOCK1(vp->v_mount);
cbe54d63 735 DO_OPS(ops, error, &ap, vop_readlink);
aac0aabd 736 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 737 return(error);
2d3e977e
MD
738}
739
aac0aabd
MD
740/*
741 * MPSAFE
742 */
2d3e977e 743int
87de5057 744vop_inactive(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
745{
746 struct vop_inactive_args ap;
aac0aabd 747 VFS_MPLOCK_DECLARE;
cbe54d63 748 int error;
2d3e977e
MD
749
750 ap.a_head.a_desc = &vop_inactive_desc;
0961aa92 751 ap.a_head.a_ops = ops;
2d3e977e 752 ap.a_vp = vp;
cbe54d63 753
2247fe02 754 VFS_MPLOCK_FLAG(vp->v_mount, MNTK_IN_MPSAFE);
cbe54d63 755 DO_OPS(ops, error, &ap, vop_inactive);
aac0aabd 756 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 757 return(error);
2d3e977e
MD
758}
759
aac0aabd
MD
760/*
761 * MPSAFE
762 */
2d3e977e 763int
87de5057 764vop_reclaim(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
765{
766 struct vop_reclaim_args ap;
aac0aabd 767 VFS_MPLOCK_DECLARE;
cbe54d63 768 int error;
2d3e977e
MD
769
770 ap.a_head.a_desc = &vop_reclaim_desc;
0961aa92 771 ap.a_head.a_ops = ops;
2d3e977e 772 ap.a_vp = vp;
cbe54d63 773
2247fe02 774 VFS_MPLOCK1(vp->v_mount);
cbe54d63 775 DO_OPS(ops, error, &ap, vop_reclaim);
aac0aabd 776 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 777 return(error);
2d3e977e
MD
778}
779
aac0aabd
MD
780/*
781 * MPSAFE
782 */
2d3e977e 783int
54078292 784vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset,
e92ca23a 785 off_t *doffsetp, int *runp, int *runb, buf_cmd_t cmd)
2d3e977e
MD
786{
787 struct vop_bmap_args ap;
aac0aabd 788 VFS_MPLOCK_DECLARE;
cbe54d63 789 int error;
2d3e977e
MD
790
791 ap.a_head.a_desc = &vop_bmap_desc;
0961aa92 792 ap.a_head.a_ops = ops;
2d3e977e 793 ap.a_vp = vp;
54078292 794 ap.a_loffset = loffset;
54078292 795 ap.a_doffsetp = doffsetp;
2d3e977e
MD
796 ap.a_runp = runp;
797 ap.a_runb = runb;
e92ca23a 798 ap.a_cmd = cmd;
cbe54d63 799
2247fe02 800 VFS_MPLOCK1(vp->v_mount);
cbe54d63 801 DO_OPS(ops, error, &ap, vop_bmap);
aac0aabd 802 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 803 return(error);
2d3e977e
MD
804}
805
aac0aabd
MD
806/*
807 * MPSAFE
808 */
2d3e977e 809int
81b5c339 810vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio)
2d3e977e
MD
811{
812 struct vop_strategy_args ap;
aac0aabd 813 VFS_MPLOCK_DECLARE;
cbe54d63 814 int error;
2d3e977e
MD
815
816 ap.a_head.a_desc = &vop_strategy_desc;
0961aa92 817 ap.a_head.a_ops = ops;
2d3e977e 818 ap.a_vp = vp;
81b5c339 819 ap.a_bio = bio;
cbe54d63 820
7d3c0219 821 if (vp->v_mount) {
0a8aee15
MD
822
823 VFS_MPLOCK_FLAG(vp->v_mount, MNTK_SG_MPSAFE);
7d3c0219
MD
824 DO_OPS(ops, error, &ap, vop_strategy);
825 VFS_MPUNLOCK(vp->v_mount);
826 } else {
827 /* ugly hack for swap */
828 get_mplock();
829 DO_OPS(ops, error, &ap, vop_strategy);
830 rel_mplock();
831 }
cbe54d63 832 return(error);
2d3e977e
MD
833}
834
aac0aabd
MD
835/*
836 * MPSAFE
837 */
2d3e977e 838int
0961aa92 839vop_print(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
840{
841 struct vop_print_args ap;
aac0aabd 842 VFS_MPLOCK_DECLARE;
cbe54d63 843 int error;
2d3e977e
MD
844
845 ap.a_head.a_desc = &vop_print_desc;
0961aa92 846 ap.a_head.a_ops = ops;
2d3e977e 847 ap.a_vp = vp;
cbe54d63 848
2247fe02 849 VFS_MPLOCK1(vp->v_mount);
cbe54d63 850 DO_OPS(ops, error, &ap, vop_print);
aac0aabd 851 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 852 return(error);
2d3e977e
MD
853}
854
aac0aabd
MD
855/*
856 * MPSAFE
857 */
2d3e977e 858int
0961aa92
MD
859vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
860 register_t *retval)
2d3e977e
MD
861{
862 struct vop_pathconf_args ap;
aac0aabd 863 VFS_MPLOCK_DECLARE;
cbe54d63 864 int error;
2d3e977e
MD
865
866 ap.a_head.a_desc = &vop_pathconf_desc;
0961aa92 867 ap.a_head.a_ops = ops;
2d3e977e
MD
868 ap.a_vp = vp;
869 ap.a_name = name;
870 ap.a_retval = retval;
cbe54d63 871
2247fe02 872 VFS_MPLOCK1(vp->v_mount);
cbe54d63 873 DO_OPS(ops, error, &ap, vop_pathconf);
aac0aabd 874 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 875 return(error);
2d3e977e
MD
876}
877
aac0aabd
MD
878/*
879 * MPSAFE
880 */
2d3e977e 881int
0961aa92
MD
882vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
883 struct flock *fl, int flags)
2d3e977e
MD
884{
885 struct vop_advlock_args ap;
aac0aabd 886 VFS_MPLOCK_DECLARE;
cbe54d63 887 int error;
2d3e977e
MD
888
889 ap.a_head.a_desc = &vop_advlock_desc;
0961aa92 890 ap.a_head.a_ops = ops;
2d3e977e
MD
891 ap.a_vp = vp;
892 ap.a_id = id;
893 ap.a_op = op;
894 ap.a_fl = fl;
895 ap.a_flags = flags;
cbe54d63 896
2247fe02 897 VFS_MPLOCK1(vp->v_mount);
cbe54d63 898 DO_OPS(ops, error, &ap, vop_advlock);
aac0aabd 899 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 900 return(error);
2d3e977e
MD
901}
902
aac0aabd
MD
903/*
904 * MPSAFE
905 */
2d3e977e 906int
0961aa92
MD
907vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
908 int size, struct ucred *cred, int flags,
909 struct buf **bpp)
2d3e977e
MD
910{
911 struct vop_balloc_args ap;
aac0aabd 912 VFS_MPLOCK_DECLARE;
cbe54d63 913 int error;
2d3e977e
MD
914
915 ap.a_head.a_desc = &vop_balloc_desc;
0961aa92 916 ap.a_head.a_ops = ops;
2d3e977e
MD
917 ap.a_vp = vp;
918 ap.a_startoffset = startoffset;
919 ap.a_size = size;
920 ap.a_cred = cred;
921 ap.a_flags = flags;
922 ap.a_bpp = bpp;
cbe54d63 923
2247fe02 924 VFS_MPLOCK1(vp->v_mount);
cbe54d63 925 DO_OPS(ops, error, &ap, vop_balloc);
aac0aabd 926 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 927 return(error);
2d3e977e
MD
928}
929
aac0aabd
MD
930/*
931 * MPSAFE
932 */
2d3e977e 933int
0961aa92
MD
934vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
935 struct cluster_save *buflist)
2d3e977e
MD
936{
937 struct vop_reallocblks_args ap;
aac0aabd 938 VFS_MPLOCK_DECLARE;
cbe54d63 939 int error;
2d3e977e
MD
940
941 ap.a_head.a_desc = &vop_reallocblks_desc;
0961aa92 942 ap.a_head.a_ops = ops;
2d3e977e
MD
943 ap.a_vp = vp;
944 ap.a_buflist = buflist;
cbe54d63 945
2247fe02 946 VFS_MPLOCK1(vp->v_mount);
cbe54d63 947 DO_OPS(ops, error, &ap, vop_reallocblks);
aac0aabd 948 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 949 return(error);
2d3e977e
MD
950}
951
aac0aabd
MD
952/*
953 * MPSAFE
954 */
2d3e977e 955int
0961aa92 956vop_getpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
1c48c952 957 int reqpage, vm_ooffset_t offset, int seqaccess)
2d3e977e
MD
958{
959 struct vop_getpages_args ap;
aac0aabd 960 VFS_MPLOCK_DECLARE;
cbe54d63 961 int error;
2d3e977e
MD
962
963 ap.a_head.a_desc = &vop_getpages_desc;
0961aa92 964 ap.a_head.a_ops = ops;
2d3e977e
MD
965 ap.a_vp = vp;
966 ap.a_m = m;
967 ap.a_count = count;
968 ap.a_reqpage = reqpage;
969 ap.a_offset = offset;
1c48c952 970 ap.a_seqaccess = seqaccess;
cbe54d63 971
2247fe02 972 VFS_MPLOCK1(vp->v_mount);
cbe54d63 973 DO_OPS(ops, error, &ap, vop_getpages);
aac0aabd 974 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 975 return(error);
2d3e977e
MD
976}
977
aac0aabd
MD
978/*
979 * MPSAFE
980 */
2d3e977e 981int
0961aa92
MD
982vop_putpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
983 int sync, int *rtvals, vm_ooffset_t offset)
2d3e977e
MD
984{
985 struct vop_putpages_args ap;
aac0aabd 986 VFS_MPLOCK_DECLARE;
cbe54d63 987 int error;
2d3e977e
MD
988
989 ap.a_head.a_desc = &vop_putpages_desc;
0961aa92 990 ap.a_head.a_ops = ops;
2d3e977e
MD
991 ap.a_vp = vp;
992 ap.a_m = m;
993 ap.a_count = count;
994 ap.a_sync = sync;
995 ap.a_rtvals = rtvals;
996 ap.a_offset = offset;
cbe54d63 997
2247fe02 998 VFS_MPLOCK1(vp->v_mount);
cbe54d63 999 DO_OPS(ops, error, &ap, vop_putpages);
aac0aabd 1000 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1001 return(error);
2d3e977e
MD
1002}
1003
aac0aabd
MD
1004/*
1005 * MPSAFE
1006 */
2d3e977e 1007int
54078292 1008vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length)
2d3e977e
MD
1009{
1010 struct vop_freeblks_args ap;
aac0aabd 1011 VFS_MPLOCK_DECLARE;
cbe54d63 1012 int error;
2d3e977e
MD
1013
1014 ap.a_head.a_desc = &vop_freeblks_desc;
0961aa92 1015 ap.a_head.a_ops = ops;
2d3e977e 1016 ap.a_vp = vp;
54078292 1017 ap.a_offset = offset;
2d3e977e 1018 ap.a_length = length;
cbe54d63 1019
2247fe02 1020 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1021 DO_OPS(ops, error, &ap, vop_freeblks);
aac0aabd 1022 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1023 return(error);
2d3e977e
MD
1024}
1025
aac0aabd
MD
1026/*
1027 * MPSAFE
1028 */
2d3e977e 1029int
0961aa92 1030vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1031 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1032{
1033 struct vop_getacl_args ap;
aac0aabd 1034 VFS_MPLOCK_DECLARE;
cbe54d63 1035 int error;
2d3e977e
MD
1036
1037 ap.a_head.a_desc = &vop_getacl_desc;
0961aa92 1038 ap.a_head.a_ops = ops;
2d3e977e
MD
1039 ap.a_vp = vp;
1040 ap.a_type = type;
1041 ap.a_aclp = aclp;
1042 ap.a_cred = cred;
cbe54d63 1043
2247fe02 1044 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1045 DO_OPS(ops, error, &ap, vop_getacl);
aac0aabd 1046 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1047 return(error);
2d3e977e
MD
1048}
1049
aac0aabd
MD
1050/*
1051 * MPSAFE
1052 */
2d3e977e 1053int
0961aa92 1054vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1055 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1056{
1057 struct vop_setacl_args ap;
aac0aabd 1058 VFS_MPLOCK_DECLARE;
cbe54d63 1059 int error;
2d3e977e
MD
1060
1061 ap.a_head.a_desc = &vop_setacl_desc;
0961aa92 1062 ap.a_head.a_ops = ops;
2d3e977e
MD
1063 ap.a_vp = vp;
1064 ap.a_type = type;
1065 ap.a_aclp = aclp;
1066 ap.a_cred = cred;
cbe54d63 1067
2247fe02 1068 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1069 DO_OPS(ops, error, &ap, vop_setacl);
aac0aabd 1070 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1071 return(error);
2d3e977e
MD
1072}
1073
aac0aabd
MD
1074/*
1075 * MPSAFE
1076 */
2d3e977e 1077int
0961aa92 1078vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1079 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1080{
1081 struct vop_aclcheck_args ap;
aac0aabd 1082 VFS_MPLOCK_DECLARE;
cbe54d63 1083 int error;
2d3e977e
MD
1084
1085 ap.a_head.a_desc = &vop_aclcheck_desc;
0961aa92 1086 ap.a_head.a_ops = ops;
2d3e977e
MD
1087 ap.a_vp = vp;
1088 ap.a_type = type;
1089 ap.a_aclp = aclp;
1090 ap.a_cred = cred;
cbe54d63 1091
2247fe02 1092 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1093 DO_OPS(ops, error, &ap, vop_aclcheck);
aac0aabd 1094 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1095 return(error);
2d3e977e
MD
1096}
1097
aac0aabd
MD
1098/*
1099 * MPSAFE
1100 */
2d3e977e 1101int
0961aa92 1102vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 1103 struct uio *uio, struct ucred *cred)
2d3e977e
MD
1104{
1105 struct vop_getextattr_args ap;
aac0aabd 1106 VFS_MPLOCK_DECLARE;
cbe54d63 1107 int error;
2d3e977e
MD
1108
1109 ap.a_head.a_desc = &vop_getextattr_desc;
0961aa92 1110 ap.a_head.a_ops = ops;
2d3e977e
MD
1111 ap.a_vp = vp;
1112 ap.a_name = name;
1113 ap.a_uio = uio;
1114 ap.a_cred = cred;
cbe54d63 1115
2247fe02 1116 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1117 DO_OPS(ops, error, &ap, vop_getextattr);
aac0aabd 1118 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1119 return(error);
2d3e977e
MD
1120}
1121
aac0aabd
MD
1122/*
1123 * MPSAFE
1124 */
2d3e977e 1125int
0961aa92 1126vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 1127 struct uio *uio, struct ucred *cred)
2d3e977e
MD
1128{
1129 struct vop_setextattr_args ap;
aac0aabd 1130 VFS_MPLOCK_DECLARE;
cbe54d63 1131 int error;
2d3e977e
MD
1132
1133 ap.a_head.a_desc = &vop_setextattr_desc;
0961aa92 1134 ap.a_head.a_ops = ops;
2d3e977e
MD
1135 ap.a_vp = vp;
1136 ap.a_name = name;
1137 ap.a_uio = uio;
1138 ap.a_cred = cred;
cbe54d63 1139
2247fe02 1140 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1141 DO_OPS(ops, error, &ap, vop_setextattr);
aac0aabd 1142 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1143 return(error);
2d3e977e
MD
1144}
1145
aac0aabd
MD
1146/*
1147 * MPSAFE
1148 */
cbe54d63 1149int
aac0aabd
MD
1150vop_mountctl(struct vop_ops *ops, struct vnode *vp, int op, struct file *fp,
1151 const void *ctl, int ctllen, void *buf, int buflen, int *res)
cbe54d63 1152{
949ecb9b 1153 struct vop_mountctl_args ap;
aac0aabd 1154 VFS_MPLOCK_DECLARE;
cbe54d63
MD
1155 int error;
1156
949ecb9b 1157 ap.a_head.a_desc = &vop_mountctl_desc;
cbe54d63
MD
1158 ap.a_head.a_ops = ops;
1159 ap.a_op = op;
949ecb9b 1160 ap.a_ctl = ctl;
2281065e 1161 ap.a_fp = fp;
949ecb9b
MD
1162 ap.a_ctllen = ctllen;
1163 ap.a_buf = buf;
1164 ap.a_buflen = buflen;
1165 ap.a_res = res;
cbe54d63 1166
2247fe02 1167 VFS_MPLOCK1(vp->v_mount);
949ecb9b 1168 DO_OPS(ops, error, &ap, vop_mountctl);
aac0aabd 1169 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1170 return(error);
0961aa92
MD
1171}
1172
aac0aabd
MD
1173/*
1174 * MPSAFE
1175 */
349433c9
MD
1176int
1177vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred)
1178{
1179 struct vop_markatime_args ap;
aac0aabd 1180 VFS_MPLOCK_DECLARE;
349433c9
MD
1181 int error;
1182
1183 ap.a_head.a_desc = &vop_markatime_desc;
1184 ap.a_head.a_ops = ops;
1185 ap.a_vp = vp;
1186 ap.a_cred = cred;
1187
2247fe02 1188 VFS_MPLOCK1(vp->v_mount);
349433c9 1189 DO_OPS(ops, error, &ap, vop_markatime);
aac0aabd 1190 VFS_MPUNLOCK(vp->v_mount);
349433c9
MD
1191 return(error);
1192}
1193
fad57d0e
MD
1194/*
1195 * NEW API FUNCTIONS
1196 *
5312fa43
MD
1197 * nresolve takes a locked ncp, a referenced but unlocked dvp, and a cred,
1198 * and resolves the ncp into a positive or negative hit.
fad57d0e
MD
1199 *
1200 * The namecache is automatically adjusted by this function. The ncp
1201 * is left locked on return.
aac0aabd
MD
1202 *
1203 * MPSAFE
fad57d0e
MD
1204 */
1205int
dff430ab
MD
1206vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
1207 struct vnode *dvp, struct ucred *cred)
fad57d0e
MD
1208{
1209 struct vop_nresolve_args ap;
aac0aabd 1210 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1211 int error;
1212
1213 ap.a_head.a_desc = &vop_nresolve_desc;
1214 ap.a_head.a_ops = ops;
28623bf9 1215 ap.a_nch = nch;
dff430ab 1216 ap.a_dvp = dvp;
fad57d0e
MD
1217 ap.a_cred = cred;
1218
2247fe02 1219 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1220 DO_OPS(ops, error, &ap, vop_nresolve);
aac0aabd 1221 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1222 return(error);
1223}
1224
1225/*
5312fa43
MD
1226 * nlookupdotdot takes an unlocked directory, referenced dvp, and looks
1227 * up "..", returning a locked parent directory in *vpp. If an error
1228 * occurs *vpp will be NULL.
aac0aabd
MD
1229 *
1230 * MPSAFE
fad57d0e
MD
1231 */
1232int
1233vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
33387738 1234 struct vnode **vpp, struct ucred *cred, char **fakename)
fad57d0e
MD
1235{
1236 struct vop_nlookupdotdot_args ap;
aac0aabd 1237 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1238 int error;
1239
1240 ap.a_head.a_desc = &vop_nlookupdotdot_desc;
1241 ap.a_head.a_ops = ops;
1242 ap.a_dvp = dvp;
1243 ap.a_vpp = vpp;
1244 ap.a_cred = cred;
33387738 1245 ap.a_fakename = fakename;
fad57d0e 1246
2247fe02 1247 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1248 DO_OPS(ops, error, &ap, vop_nlookupdotdot);
aac0aabd 1249 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1250 return(error);
1251}
1252
1253/*
1254 * ncreate takes a locked, resolved ncp that typically represents a negative
1255 * cache hit and creates the file or node specified by the ncp, cred, and
1256 * vattr. If no error occurs a locked vnode is returned in *vpp.
1257 *
5312fa43
MD
1258 * The dvp passed in is referenced but unlocked.
1259 *
fad57d0e
MD
1260 * The namecache is automatically adjusted by this function. The ncp
1261 * is left locked on return.
aac0aabd
MD
1262 *
1263 * MPSAFE
fad57d0e
MD
1264 */
1265int
dff430ab 1266vop_ncreate(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1267 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1268{
1269 struct vop_ncreate_args ap;
aac0aabd 1270 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1271 int error;
1272
1273 ap.a_head.a_desc = &vop_ncreate_desc;
1274 ap.a_head.a_ops = ops;
28623bf9 1275 ap.a_nch = nch;
dff430ab 1276 ap.a_dvp = dvp;
fad57d0e
MD
1277 ap.a_vpp = vpp;
1278 ap.a_cred = cred;
1279 ap.a_vap = vap;
1280
2247fe02 1281 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1282 DO_OPS(ops, error, &ap, vop_ncreate);
aac0aabd 1283 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1284 return(error);
1285}
1286
1287/*
1288 * nmkdir takes a locked, resolved ncp that typically represents a negative
1289 * cache hit and creates the directory specified by the ncp, cred, and
1290 * vattr. If no error occurs a locked vnode is returned in *vpp.
1291 *
5312fa43
MD
1292 * The dvp passed in is referenced but unlocked.
1293 *
fad57d0e
MD
1294 * The namecache is automatically adjusted by this function. The ncp
1295 * is left locked on return.
aac0aabd
MD
1296 *
1297 * MPSAFE
fad57d0e
MD
1298 */
1299int
dff430ab 1300vop_nmkdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1301 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1302{
1303 struct vop_nmkdir_args ap;
aac0aabd 1304 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1305 int error;
1306
1307 ap.a_head.a_desc = &vop_nmkdir_desc;
1308 ap.a_head.a_ops = ops;
28623bf9 1309 ap.a_nch = nch;
dff430ab 1310 ap.a_dvp = dvp;
fad57d0e
MD
1311 ap.a_vpp = vpp;
1312 ap.a_cred = cred;
1313 ap.a_vap = vap;
1314
2247fe02 1315 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1316 DO_OPS(ops, error, &ap, vop_nmkdir);
aac0aabd 1317 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1318 return(error);
1319}
1320
1321/*
1322 * nmknod takes a locked, resolved ncp that typically represents a negative
1323 * cache hit and creates the node specified by the ncp, cred, and
1324 * vattr. If no error occurs a locked vnode is returned in *vpp.
1325 *
5312fa43
MD
1326 * The dvp passed in is referenced but unlocked.
1327 *
fad57d0e
MD
1328 * The namecache is automatically adjusted by this function. The ncp
1329 * is left locked on return.
aac0aabd
MD
1330 *
1331 * MPSAFE
fad57d0e
MD
1332 */
1333int
dff430ab 1334vop_nmknod(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1335 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1336{
1337 struct vop_nmknod_args ap;
aac0aabd 1338 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1339 int error;
1340
1341 ap.a_head.a_desc = &vop_nmknod_desc;
1342 ap.a_head.a_ops = ops;
28623bf9 1343 ap.a_nch = nch;
dff430ab 1344 ap.a_dvp = dvp;
fad57d0e
MD
1345 ap.a_vpp = vpp;
1346 ap.a_cred = cred;
1347 ap.a_vap = vap;
1348
2247fe02 1349 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1350 DO_OPS(ops, error, &ap, vop_nmknod);
aac0aabd 1351 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1352 return(error);
1353}
1354
1355/*
1356 * nlink takes a locked, resolved ncp that typically represents a negative
1357 * cache hit and creates the node specified by the ncp, cred, and
1358 * existing vnode. The passed vp must be locked and will remain locked
1359 * on return, as does the ncp, whether an error occurs or not.
1360 *
5312fa43
MD
1361 * The dvp passed in is referenced but unlocked.
1362 *
fad57d0e
MD
1363 * The namecache is automatically adjusted by this function. The ncp
1364 * is left locked on return.
aac0aabd
MD
1365 *
1366 * MPSAFE
fad57d0e
MD
1367 */
1368int
dff430ab
MD
1369vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1370 struct vnode *vp, struct ucred *cred)
fad57d0e
MD
1371{
1372 struct vop_nlink_args ap;
aac0aabd 1373 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1374 int error;
1375
1376 ap.a_head.a_desc = &vop_nlink_desc;
1377 ap.a_head.a_ops = ops;
28623bf9 1378 ap.a_nch = nch;
dff430ab 1379 ap.a_dvp = dvp;
fad57d0e
MD
1380 ap.a_vp = vp;
1381 ap.a_cred = cred;
1382
2247fe02 1383 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1384 DO_OPS(ops, error, &ap, vop_nlink);
aac0aabd 1385 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1386 return(error);
1387}
1388
1389/*
1390 * nsymlink takes a locked, resolved ncp that typically represents a negative
1391 * cache hit and creates a symbolic link based on cred, vap, and target (the
1392 * contents of the link). If no error occurs a locked vnode is returned in
1393 * *vpp.
1394 *
5312fa43
MD
1395 * The dvp passed in is referenced but unlocked.
1396 *
fad57d0e
MD
1397 * The namecache is automatically adjusted by this function. The ncp
1398 * is left locked on return.
aac0aabd
MD
1399 *
1400 * MPSAFE
fad57d0e
MD
1401 */
1402int
dff430ab 1403vop_nsymlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1404 struct vnode **vpp, struct ucred *cred,
1405 struct vattr *vap, char *target)
1406{
1407 struct vop_nsymlink_args ap;
aac0aabd 1408 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1409 int error;
1410
1411 ap.a_head.a_desc = &vop_nsymlink_desc;
1412 ap.a_head.a_ops = ops;
28623bf9 1413 ap.a_nch = nch;
dff430ab 1414 ap.a_dvp = dvp;
fad57d0e
MD
1415 ap.a_vpp = vpp;
1416 ap.a_cred = cred;
1417 ap.a_vap = vap;
1418 ap.a_target = target;
1419
2247fe02 1420 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1421 DO_OPS(ops, error, &ap, vop_nsymlink);
aac0aabd 1422 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1423 return(error);
1424}
1425
1426/*
1427 * nwhiteout takes a locked, resolved ncp that can represent a positive or
1428 * negative hit and executes the whiteout function specified in flags.
1429 *
5312fa43
MD
1430 * The dvp passed in is referenced but unlocked.
1431 *
fad57d0e
MD
1432 * The namecache is automatically adjusted by this function. The ncp
1433 * is left locked on return.
aac0aabd
MD
1434 *
1435 * MPSAFE
fad57d0e
MD
1436 */
1437int
dff430ab 1438vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1439 struct ucred *cred, int flags)
1440{
1441 struct vop_nwhiteout_args ap;
aac0aabd 1442 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1443 int error;
1444
1445 ap.a_head.a_desc = &vop_nwhiteout_desc;
1446 ap.a_head.a_ops = ops;
28623bf9 1447 ap.a_nch = nch;
dff430ab 1448 ap.a_dvp = dvp;
fad57d0e
MD
1449 ap.a_cred = cred;
1450 ap.a_flags = flags;
1451
2247fe02 1452 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1453 DO_OPS(ops, error, &ap, vop_nwhiteout);
aac0aabd 1454 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1455 return(error);
1456}
1457
1458/*
1459 * nremove takes a locked, resolved ncp that generally represents a
1460 * positive hit and removes the file.
1461 *
5312fa43
MD
1462 * The dvp passed in is referenced but unlocked.
1463 *
fad57d0e
MD
1464 * The namecache is automatically adjusted by this function. The ncp
1465 * is left locked on return.
aac0aabd
MD
1466 *
1467 * MPSAFE
fad57d0e
MD
1468 */
1469int
dff430ab
MD
1470vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1471 struct ucred *cred)
fad57d0e
MD
1472{
1473 struct vop_nremove_args ap;
aac0aabd 1474 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1475 int error;
1476
1477 ap.a_head.a_desc = &vop_nremove_desc;
1478 ap.a_head.a_ops = ops;
28623bf9 1479 ap.a_nch = nch;
dff430ab 1480 ap.a_dvp = dvp;
fad57d0e
MD
1481 ap.a_cred = cred;
1482
2247fe02 1483 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1484 DO_OPS(ops, error, &ap, vop_nremove);
aac0aabd 1485 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1486 return(error);
1487}
1488
1489/*
1490 * nrmdir takes a locked, resolved ncp that generally represents a
1491 * directory and removes the directory.
1492 *
5312fa43
MD
1493 * The dvp passed in is referenced but unlocked.
1494 *
fad57d0e
MD
1495 * The namecache is automatically adjusted by this function. The ncp
1496 * is left locked on return.
aac0aabd
MD
1497 *
1498 * MPSAFE
fad57d0e
MD
1499 */
1500int
dff430ab
MD
1501vop_nrmdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1502 struct ucred *cred)
fad57d0e
MD
1503{
1504 struct vop_nrmdir_args ap;
aac0aabd 1505 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1506 int error;
1507
1508 ap.a_head.a_desc = &vop_nrmdir_desc;
1509 ap.a_head.a_ops = ops;
28623bf9 1510 ap.a_nch = nch;
dff430ab 1511 ap.a_dvp = dvp;
fad57d0e
MD
1512 ap.a_cred = cred;
1513
2247fe02 1514 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1515 DO_OPS(ops, error, &ap, vop_nrmdir);
aac0aabd 1516 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1517 return(error);
1518}
1519
1520/*
1521 * nrename takes TWO locked, resolved ncp's and the cred of the caller
1522 * and renames the source ncp to the target ncp. The target ncp may
1523 * represent a positive or negative hit.
1524 *
5312fa43
MD
1525 * The fdvp and tdvp passed in are referenced but unlocked.
1526 *
fad57d0e
MD
1527 * The namecache is automatically adjusted by this function. The ncp
1528 * is left locked on return. The source ncp is typically changed to
1529 * a negative cache hit and the target ncp typically takes on the
1530 * source ncp's underlying file.
aac0aabd
MD
1531 *
1532 * MPSAFE
fad57d0e
MD
1533 */
1534int
dff430ab
MD
1535vop_nrename(struct vop_ops *ops,
1536 struct nchandle *fnch, struct nchandle *tnch,
1537 struct vnode *fdvp, struct vnode *tdvp,
1538 struct ucred *cred)
fad57d0e
MD
1539{
1540 struct vop_nrename_args ap;
aac0aabd 1541 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1542 int error;
1543
1544 ap.a_head.a_desc = &vop_nrename_desc;
1545 ap.a_head.a_ops = ops;
28623bf9
MD
1546 ap.a_fnch = fnch;
1547 ap.a_tnch = tnch;
dff430ab
MD
1548 ap.a_fdvp = fdvp;
1549 ap.a_tdvp = tdvp;
fad57d0e
MD
1550 ap.a_cred = cred;
1551
2247fe02 1552 VFS_MPLOCK1(fdvp->v_mount);
fad57d0e 1553 DO_OPS(ops, error, &ap, vop_nrename);
aac0aabd 1554 VFS_MPUNLOCK(fdvp->v_mount);
fad57d0e
MD
1555 return(error);
1556}
1557
0961aa92
MD
1558/************************************************************************
1559 * PRIMARY VNODE OPERATIONS FORWARDING CALLS *
1560 ************************************************************************
1561 *
1562 * These procedures are called from VFSs such as unionfs and nullfs
1563 * when they wish to forward an operation on one VFS to another. The
1564 * argument structure/message is modified and then directly passed to the
1565 * appropriate routine. This routines may also be called by initiators
1566 * who have an argument structure in hand rather then discreet arguments.
aac0aabd
MD
1567 *
1568 * MPSAFE - Caller expected to already hold the appropriate vfs lock.
0961aa92
MD
1569 */
1570int
1571vop_vnoperate_ap(struct vop_generic_args *ap)
1572{
cbe54d63
MD
1573 struct vop_ops *ops;
1574 int error;
1575
1576 ops = ap->a_ops;
6ddb7618
MD
1577 error = VOCALL(ops, ap);
1578
1579 return (error);
1580}
1581
1582/*
1583 * This routine is called by the cache coherency layer to execute the actual
1584 * VFS operation. If a journaling layer is present we call though it, else
1585 * we call the native VOP functions.
1586 */
1587int
1588vop_cache_operate_ap(struct vop_generic_args *ap)
1589{
1590 struct vop_ops *ops;
1591 int error;
1592
1593 ops = ap->a_ops;
66a1ddf5
MD
1594 if (ops->head.vv_mount->mnt_vn_journal_ops)
1595 error = VOCALL(ops->head.vv_mount->mnt_vn_journal_ops, ap);
6ddb7618 1596 else
66a1ddf5 1597 error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
6ddb7618
MD
1598 return (error);
1599}
1600
1601
1602/*
1603 * This routine is called by the journaling layer to execute the actual
1604 * VFS operation.
1605 */
1606int
1607vop_journal_operate_ap(struct vop_generic_args *ap)
1608{
1609 struct vop_ops *ops;
1610 int error;
1611
1612 ops = ap->a_ops;
66a1ddf5 1613 error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
6ddb7618 1614
cbe54d63 1615 return (error);
0961aa92
MD
1616}
1617
0961aa92
MD
1618int
1619vop_open_ap(struct vop_open_args *ap)
1620{
cbe54d63
MD
1621 int error;
1622
1623 DO_OPS(ap->a_head.a_ops, error, ap, vop_open);
1624 return(error);
0961aa92
MD
1625}
1626
1627int
1628vop_close_ap(struct vop_close_args *ap)
1629{
cbe54d63
MD
1630 int error;
1631
1632 DO_OPS(ap->a_head.a_ops, error, ap, vop_close);
1633 return(error);
0961aa92
MD
1634}
1635
1636int
1637vop_access_ap(struct vop_access_args *ap)
1638{
cbe54d63
MD
1639 int error;
1640
1641 DO_OPS(ap->a_head.a_ops, error, ap, vop_access);
1642 return(error);
0961aa92
MD
1643}
1644
1645int
1646vop_getattr_ap(struct vop_getattr_args *ap)
1647{
cbe54d63
MD
1648 int error;
1649
1650 DO_OPS(ap->a_head.a_ops, error, ap, vop_getattr);
1651 return(error);
0961aa92
MD
1652}
1653
1654int
1655vop_setattr_ap(struct vop_setattr_args *ap)
1656{
cbe54d63
MD
1657 int error;
1658
1659 DO_OPS(ap->a_head.a_ops, error, ap, vop_setattr);
1660 return(error);
0961aa92
MD
1661}
1662
1663int
1664vop_read_ap(struct vop_read_args *ap)
1665{
cbe54d63
MD
1666 int error;
1667
1668 DO_OPS(ap->a_head.a_ops, error, ap, vop_read);
1669 return(error);
0961aa92
MD
1670}
1671
1672int
1673vop_write_ap(struct vop_write_args *ap)
1674{
cbe54d63
MD
1675 int error;
1676
1677 DO_OPS(ap->a_head.a_ops, error, ap, vop_write);
1678 return(error);
0961aa92
MD
1679}
1680
0961aa92
MD
1681int
1682vop_ioctl_ap(struct vop_ioctl_args *ap)
1683{
cbe54d63
MD
1684 int error;
1685
1686 DO_OPS(ap->a_head.a_ops, error, ap, vop_ioctl);
1687 return(error);
0961aa92
MD
1688}
1689
1690int
1691vop_poll_ap(struct vop_poll_args *ap)
1692{
cbe54d63
MD
1693 int error;
1694
1695 DO_OPS(ap->a_head.a_ops, error, ap, vop_poll);
1696 return(error);
0961aa92
MD
1697}
1698
1699int
1700vop_kqfilter_ap(struct vop_kqfilter_args *ap)
1701{
cbe54d63
MD
1702 int error;
1703
1704 DO_OPS(ap->a_head.a_ops, error, ap, vop_kqfilter);
1705 return(error);
0961aa92
MD
1706}
1707
0961aa92
MD
1708int
1709vop_mmap_ap(struct vop_mmap_args *ap)
1710{
cbe54d63
MD
1711 int error;
1712
1713 DO_OPS(ap->a_head.a_ops, error, ap, vop_mmap);
1714 return(error);
0961aa92
MD
1715}
1716
1717int
1718vop_fsync_ap(struct vop_fsync_args *ap)
1719{
cbe54d63
MD
1720 int error;
1721
1722 DO_OPS(ap->a_head.a_ops, error, ap, vop_fsync);
1723 return(error);
0961aa92
MD
1724}
1725
0961aa92
MD
1726int
1727vop_readdir_ap(struct vop_readdir_args *ap)
1728{
cbe54d63
MD
1729 int error;
1730
1731 DO_OPS(ap->a_head.a_ops, error, ap, vop_readdir);
1732 return(error);
0961aa92
MD
1733}
1734
1735int
1736vop_readlink_ap(struct vop_readlink_args *ap)
1737{
cbe54d63
MD
1738 int error;
1739
1740 DO_OPS(ap->a_head.a_ops, error, ap, vop_readlink);
1741 return(error);
0961aa92
MD
1742}
1743
1744int
1745vop_inactive_ap(struct vop_inactive_args *ap)
1746{
cbe54d63
MD
1747 int error;
1748
1749 DO_OPS(ap->a_head.a_ops, error, ap, vop_inactive);
1750 return(error);
0961aa92
MD
1751}
1752
1753int
1754vop_reclaim_ap(struct vop_reclaim_args *ap)
1755{
cbe54d63
MD
1756 int error;
1757
1758 DO_OPS(ap->a_head.a_ops, error, ap, vop_reclaim);
1759 return(error);
0961aa92
MD
1760}
1761
0961aa92
MD
1762int
1763vop_bmap_ap(struct vop_bmap_args *ap)
1764{
cbe54d63
MD
1765 int error;
1766
1767 DO_OPS(ap->a_head.a_ops, error, ap, vop_bmap);
1768 return(error);
0961aa92
MD
1769}
1770
1771int
1772vop_strategy_ap(struct vop_strategy_args *ap)
1773{
cbe54d63
MD
1774 int error;
1775
1776 DO_OPS(ap->a_head.a_ops, error, ap, vop_strategy);
1777 return(error);
0961aa92
MD
1778}
1779
1780int
1781vop_print_ap(struct vop_print_args *ap)
1782{
cbe54d63
MD
1783 int error;
1784
1785 DO_OPS(ap->a_head.a_ops, error, ap, vop_print);
1786 return(error);
0961aa92
MD
1787}
1788
1789int
1790vop_pathconf_ap(struct vop_pathconf_args *ap)
1791{
cbe54d63
MD
1792 int error;
1793
1794 DO_OPS(ap->a_head.a_ops, error, ap, vop_pathconf);
1795 return(error);
0961aa92
MD
1796}
1797
1798int
1799vop_advlock_ap(struct vop_advlock_args *ap)
1800{
cbe54d63
MD
1801 int error;
1802
1803 DO_OPS(ap->a_head.a_ops, error, ap, vop_advlock);
1804 return(error);
0961aa92
MD
1805}
1806
1807int
1808vop_balloc_ap(struct vop_balloc_args *ap)
1809{
cbe54d63
MD
1810 int error;
1811
1812 DO_OPS(ap->a_head.a_ops, error, ap, vop_balloc);
1813 return(error);
0961aa92
MD
1814}
1815
1816int
1817vop_reallocblks_ap(struct vop_reallocblks_args *ap)
1818{
cbe54d63
MD
1819 int error;
1820
1821 DO_OPS(ap->a_head.a_ops, error, ap, vop_reallocblks);
1822 return(error);
0961aa92
MD
1823}
1824
1825int
1826vop_getpages_ap(struct vop_getpages_args *ap)
1827{
cbe54d63
MD
1828 int error;
1829
1830 DO_OPS(ap->a_head.a_ops, error, ap, vop_getpages);
1831 return(error);
0961aa92
MD
1832}
1833
1834int
1835vop_putpages_ap(struct vop_putpages_args *ap)
1836{
cbe54d63
MD
1837 int error;
1838
1839 DO_OPS(ap->a_head.a_ops, error, ap, vop_putpages);
1840 return(error);
0961aa92
MD
1841}
1842
1843int
1844vop_freeblks_ap(struct vop_freeblks_args *ap)
1845{
cbe54d63
MD
1846 int error;
1847
1848 DO_OPS(ap->a_head.a_ops, error, ap, vop_freeblks);
1849 return(error);
0961aa92
MD
1850}
1851
0961aa92
MD
1852int
1853vop_getacl_ap(struct vop_getacl_args *ap)
1854{
cbe54d63
MD
1855 int error;
1856
1857 DO_OPS(ap->a_head.a_ops, error, ap, vop_getacl);
1858 return(error);
0961aa92
MD
1859}
1860
1861int
1862vop_setacl_ap(struct vop_setacl_args *ap)
1863{
cbe54d63
MD
1864 int error;
1865
1866 DO_OPS(ap->a_head.a_ops, error, ap, vop_setacl);
1867 return(error);
0961aa92
MD
1868}
1869
1870int
1871vop_aclcheck_ap(struct vop_aclcheck_args *ap)
1872{
cbe54d63
MD
1873 int error;
1874
1875 DO_OPS(ap->a_head.a_ops, error, ap, vop_aclcheck);
1876 return(error);
0961aa92
MD
1877}
1878
1879int
1880vop_getextattr_ap(struct vop_getextattr_args *ap)
1881{
cbe54d63
MD
1882 int error;
1883
1884 DO_OPS(ap->a_head.a_ops, error, ap, vop_getextattr);
1885 return(error);
0961aa92
MD
1886}
1887
1888int
1889vop_setextattr_ap(struct vop_setextattr_args *ap)
1890{
cbe54d63
MD
1891 int error;
1892
1893 DO_OPS(ap->a_head.a_ops, error, ap, vop_setextattr);
1894 return(error);
0961aa92
MD
1895}
1896
cbe54d63 1897int
949ecb9b 1898vop_mountctl_ap(struct vop_mountctl_args *ap)
cbe54d63
MD
1899{
1900 int error;
1901
949ecb9b 1902 DO_OPS(ap->a_head.a_ops, error, ap, vop_mountctl);
cbe54d63 1903 return(error);
2d3e977e
MD
1904}
1905
349433c9
MD
1906int
1907vop_markatime_ap(struct vop_markatime_args *ap)
1908{
1909 int error;
1910
1911 DO_OPS(ap->a_head.a_ops, error, ap, vop_markatime);
1912 return(error);
1913}
1914
fad57d0e
MD
1915int
1916vop_nresolve_ap(struct vop_nresolve_args *ap)
1917{
1918 int error;
1919
1920 DO_OPS(ap->a_head.a_ops, error, ap, vop_nresolve);
1921 return(error);
1922}
1923
1924int
1925vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap)
1926{
1927 int error;
1928
1929 DO_OPS(ap->a_head.a_ops, error, ap, vop_nlookupdotdot);
1930 return(error);
1931}
1932
1933int
1934vop_ncreate_ap(struct vop_ncreate_args *ap)
1935{
1936 int error;
1937
1938 DO_OPS(ap->a_head.a_ops, error, ap, vop_ncreate);
1939 return(error);
1940}
1941
1942int
1943vop_nmkdir_ap(struct vop_nmkdir_args *ap)
1944{
1945 int error;
1946
1947 DO_OPS(ap->a_head.a_ops, error, ap, vop_nmkdir);
1948 return(error);
1949}
1950
1951int
1952vop_nmknod_ap(struct vop_nmknod_args *ap)
1953{
1954 int error;
1955
1956 DO_OPS(ap->a_head.a_ops, error, ap, vop_nmknod);
1957 return(error);
1958}
1959
1960int
1961vop_nlink_ap(struct vop_nlink_args *ap)
1962{
1963 int error;
1964
1965 DO_OPS(ap->a_head.a_ops, error, ap, vop_nlink);
1966 return(error);
1967}
1968
1969int
1970vop_nsymlink_ap(struct vop_nsymlink_args *ap)
1971{
1972 int error;
1973
1974 DO_OPS(ap->a_head.a_ops, error, ap, vop_nsymlink);
1975 return(error);
1976}
1977
1978int
1979vop_nwhiteout_ap(struct vop_nwhiteout_args *ap)
1980{
1981 int error;
1982
1983 DO_OPS(ap->a_head.a_ops, error, ap, vop_nwhiteout);
1984 return(error);
1985}
1986
1987int
1988vop_nremove_ap(struct vop_nremove_args *ap)
1989{
1990 int error;
1991
1992 DO_OPS(ap->a_head.a_ops, error, ap, vop_nremove);
1993 return(error);
1994}
1995
1996int
1997vop_nrmdir_ap(struct vop_nrmdir_args *ap)
1998{
1999 int error;
2000
2001 DO_OPS(ap->a_head.a_ops, error, ap, vop_nrmdir);
2002 return(error);
2003}
2004
2005int
2006vop_nrename_ap(struct vop_nrename_args *ap)
2007{
2008 int error;
2009
2010 DO_OPS(ap->a_head.a_ops, error, ap, vop_nrename);
2011 return(error);
2012}
2013