kernel - SWAP CACHE part 8/many - Add the swap cache read intercept, rate ctl
[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
2247fe02 821 VFS_MPLOCK1(vp->v_mount);
cbe54d63 822 DO_OPS(ops, error, &ap, vop_strategy);
aac0aabd 823 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 824 return(error);
2d3e977e
MD
825}
826
aac0aabd
MD
827/*
828 * MPSAFE
829 */
2d3e977e 830int
0961aa92 831vop_print(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
832{
833 struct vop_print_args ap;
aac0aabd 834 VFS_MPLOCK_DECLARE;
cbe54d63 835 int error;
2d3e977e
MD
836
837 ap.a_head.a_desc = &vop_print_desc;
0961aa92 838 ap.a_head.a_ops = ops;
2d3e977e 839 ap.a_vp = vp;
cbe54d63 840
2247fe02 841 VFS_MPLOCK1(vp->v_mount);
cbe54d63 842 DO_OPS(ops, error, &ap, vop_print);
aac0aabd 843 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 844 return(error);
2d3e977e
MD
845}
846
aac0aabd
MD
847/*
848 * MPSAFE
849 */
2d3e977e 850int
0961aa92
MD
851vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
852 register_t *retval)
2d3e977e
MD
853{
854 struct vop_pathconf_args ap;
aac0aabd 855 VFS_MPLOCK_DECLARE;
cbe54d63 856 int error;
2d3e977e
MD
857
858 ap.a_head.a_desc = &vop_pathconf_desc;
0961aa92 859 ap.a_head.a_ops = ops;
2d3e977e
MD
860 ap.a_vp = vp;
861 ap.a_name = name;
862 ap.a_retval = retval;
cbe54d63 863
2247fe02 864 VFS_MPLOCK1(vp->v_mount);
cbe54d63 865 DO_OPS(ops, error, &ap, vop_pathconf);
aac0aabd 866 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 867 return(error);
2d3e977e
MD
868}
869
aac0aabd
MD
870/*
871 * MPSAFE
872 */
2d3e977e 873int
0961aa92
MD
874vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
875 struct flock *fl, int flags)
2d3e977e
MD
876{
877 struct vop_advlock_args ap;
aac0aabd 878 VFS_MPLOCK_DECLARE;
cbe54d63 879 int error;
2d3e977e
MD
880
881 ap.a_head.a_desc = &vop_advlock_desc;
0961aa92 882 ap.a_head.a_ops = ops;
2d3e977e
MD
883 ap.a_vp = vp;
884 ap.a_id = id;
885 ap.a_op = op;
886 ap.a_fl = fl;
887 ap.a_flags = flags;
cbe54d63 888
2247fe02 889 VFS_MPLOCK1(vp->v_mount);
cbe54d63 890 DO_OPS(ops, error, &ap, vop_advlock);
aac0aabd 891 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 892 return(error);
2d3e977e
MD
893}
894
aac0aabd
MD
895/*
896 * MPSAFE
897 */
2d3e977e 898int
0961aa92
MD
899vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
900 int size, struct ucred *cred, int flags,
901 struct buf **bpp)
2d3e977e
MD
902{
903 struct vop_balloc_args ap;
aac0aabd 904 VFS_MPLOCK_DECLARE;
cbe54d63 905 int error;
2d3e977e
MD
906
907 ap.a_head.a_desc = &vop_balloc_desc;
0961aa92 908 ap.a_head.a_ops = ops;
2d3e977e
MD
909 ap.a_vp = vp;
910 ap.a_startoffset = startoffset;
911 ap.a_size = size;
912 ap.a_cred = cred;
913 ap.a_flags = flags;
914 ap.a_bpp = bpp;
cbe54d63 915
2247fe02 916 VFS_MPLOCK1(vp->v_mount);
cbe54d63 917 DO_OPS(ops, error, &ap, vop_balloc);
aac0aabd 918 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 919 return(error);
2d3e977e
MD
920}
921
aac0aabd
MD
922/*
923 * MPSAFE
924 */
2d3e977e 925int
0961aa92
MD
926vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
927 struct cluster_save *buflist)
2d3e977e
MD
928{
929 struct vop_reallocblks_args ap;
aac0aabd 930 VFS_MPLOCK_DECLARE;
cbe54d63 931 int error;
2d3e977e
MD
932
933 ap.a_head.a_desc = &vop_reallocblks_desc;
0961aa92 934 ap.a_head.a_ops = ops;
2d3e977e
MD
935 ap.a_vp = vp;
936 ap.a_buflist = buflist;
cbe54d63 937
2247fe02 938 VFS_MPLOCK1(vp->v_mount);
cbe54d63 939 DO_OPS(ops, error, &ap, vop_reallocblks);
aac0aabd 940 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 941 return(error);
2d3e977e
MD
942}
943
aac0aabd
MD
944/*
945 * MPSAFE
946 */
2d3e977e 947int
0961aa92 948vop_getpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
1c48c952 949 int reqpage, vm_ooffset_t offset, int seqaccess)
2d3e977e
MD
950{
951 struct vop_getpages_args ap;
aac0aabd 952 VFS_MPLOCK_DECLARE;
cbe54d63 953 int error;
2d3e977e
MD
954
955 ap.a_head.a_desc = &vop_getpages_desc;
0961aa92 956 ap.a_head.a_ops = ops;
2d3e977e
MD
957 ap.a_vp = vp;
958 ap.a_m = m;
959 ap.a_count = count;
960 ap.a_reqpage = reqpage;
961 ap.a_offset = offset;
1c48c952 962 ap.a_seqaccess = seqaccess;
cbe54d63 963
2247fe02 964 VFS_MPLOCK1(vp->v_mount);
cbe54d63 965 DO_OPS(ops, error, &ap, vop_getpages);
aac0aabd 966 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 967 return(error);
2d3e977e
MD
968}
969
aac0aabd
MD
970/*
971 * MPSAFE
972 */
2d3e977e 973int
0961aa92
MD
974vop_putpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
975 int sync, int *rtvals, vm_ooffset_t offset)
2d3e977e
MD
976{
977 struct vop_putpages_args ap;
aac0aabd 978 VFS_MPLOCK_DECLARE;
cbe54d63 979 int error;
2d3e977e
MD
980
981 ap.a_head.a_desc = &vop_putpages_desc;
0961aa92 982 ap.a_head.a_ops = ops;
2d3e977e
MD
983 ap.a_vp = vp;
984 ap.a_m = m;
985 ap.a_count = count;
986 ap.a_sync = sync;
987 ap.a_rtvals = rtvals;
988 ap.a_offset = offset;
cbe54d63 989
2247fe02 990 VFS_MPLOCK1(vp->v_mount);
cbe54d63 991 DO_OPS(ops, error, &ap, vop_putpages);
aac0aabd 992 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 993 return(error);
2d3e977e
MD
994}
995
aac0aabd
MD
996/*
997 * MPSAFE
998 */
2d3e977e 999int
54078292 1000vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length)
2d3e977e
MD
1001{
1002 struct vop_freeblks_args ap;
aac0aabd 1003 VFS_MPLOCK_DECLARE;
cbe54d63 1004 int error;
2d3e977e
MD
1005
1006 ap.a_head.a_desc = &vop_freeblks_desc;
0961aa92 1007 ap.a_head.a_ops = ops;
2d3e977e 1008 ap.a_vp = vp;
54078292 1009 ap.a_offset = offset;
2d3e977e 1010 ap.a_length = length;
cbe54d63 1011
2247fe02 1012 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1013 DO_OPS(ops, error, &ap, vop_freeblks);
aac0aabd 1014 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1015 return(error);
2d3e977e
MD
1016}
1017
aac0aabd
MD
1018/*
1019 * MPSAFE
1020 */
2d3e977e 1021int
0961aa92 1022vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1023 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1024{
1025 struct vop_getacl_args ap;
aac0aabd 1026 VFS_MPLOCK_DECLARE;
cbe54d63 1027 int error;
2d3e977e
MD
1028
1029 ap.a_head.a_desc = &vop_getacl_desc;
0961aa92 1030 ap.a_head.a_ops = ops;
2d3e977e
MD
1031 ap.a_vp = vp;
1032 ap.a_type = type;
1033 ap.a_aclp = aclp;
1034 ap.a_cred = cred;
cbe54d63 1035
2247fe02 1036 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1037 DO_OPS(ops, error, &ap, vop_getacl);
aac0aabd 1038 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1039 return(error);
2d3e977e
MD
1040}
1041
aac0aabd
MD
1042/*
1043 * MPSAFE
1044 */
2d3e977e 1045int
0961aa92 1046vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1047 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1048{
1049 struct vop_setacl_args ap;
aac0aabd 1050 VFS_MPLOCK_DECLARE;
cbe54d63 1051 int error;
2d3e977e
MD
1052
1053 ap.a_head.a_desc = &vop_setacl_desc;
0961aa92 1054 ap.a_head.a_ops = ops;
2d3e977e
MD
1055 ap.a_vp = vp;
1056 ap.a_type = type;
1057 ap.a_aclp = aclp;
1058 ap.a_cred = cred;
cbe54d63 1059
2247fe02 1060 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1061 DO_OPS(ops, error, &ap, vop_setacl);
aac0aabd 1062 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1063 return(error);
2d3e977e
MD
1064}
1065
aac0aabd
MD
1066/*
1067 * MPSAFE
1068 */
2d3e977e 1069int
0961aa92 1070vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
87de5057 1071 struct acl *aclp, struct ucred *cred)
2d3e977e
MD
1072{
1073 struct vop_aclcheck_args ap;
aac0aabd 1074 VFS_MPLOCK_DECLARE;
cbe54d63 1075 int error;
2d3e977e
MD
1076
1077 ap.a_head.a_desc = &vop_aclcheck_desc;
0961aa92 1078 ap.a_head.a_ops = ops;
2d3e977e
MD
1079 ap.a_vp = vp;
1080 ap.a_type = type;
1081 ap.a_aclp = aclp;
1082 ap.a_cred = cred;
cbe54d63 1083
2247fe02 1084 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1085 DO_OPS(ops, error, &ap, vop_aclcheck);
aac0aabd 1086 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1087 return(error);
2d3e977e
MD
1088}
1089
aac0aabd
MD
1090/*
1091 * MPSAFE
1092 */
2d3e977e 1093int
0961aa92 1094vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 1095 struct uio *uio, struct ucred *cred)
2d3e977e
MD
1096{
1097 struct vop_getextattr_args ap;
aac0aabd 1098 VFS_MPLOCK_DECLARE;
cbe54d63 1099 int error;
2d3e977e
MD
1100
1101 ap.a_head.a_desc = &vop_getextattr_desc;
0961aa92 1102 ap.a_head.a_ops = ops;
2d3e977e
MD
1103 ap.a_vp = vp;
1104 ap.a_name = name;
1105 ap.a_uio = uio;
1106 ap.a_cred = cred;
cbe54d63 1107
2247fe02 1108 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1109 DO_OPS(ops, error, &ap, vop_getextattr);
aac0aabd 1110 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1111 return(error);
2d3e977e
MD
1112}
1113
aac0aabd
MD
1114/*
1115 * MPSAFE
1116 */
2d3e977e 1117int
0961aa92 1118vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
87de5057 1119 struct uio *uio, struct ucred *cred)
2d3e977e
MD
1120{
1121 struct vop_setextattr_args ap;
aac0aabd 1122 VFS_MPLOCK_DECLARE;
cbe54d63 1123 int error;
2d3e977e
MD
1124
1125 ap.a_head.a_desc = &vop_setextattr_desc;
0961aa92 1126 ap.a_head.a_ops = ops;
2d3e977e
MD
1127 ap.a_vp = vp;
1128 ap.a_name = name;
1129 ap.a_uio = uio;
1130 ap.a_cred = cred;
cbe54d63 1131
2247fe02 1132 VFS_MPLOCK1(vp->v_mount);
cbe54d63 1133 DO_OPS(ops, error, &ap, vop_setextattr);
aac0aabd 1134 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1135 return(error);
2d3e977e
MD
1136}
1137
aac0aabd
MD
1138/*
1139 * MPSAFE
1140 */
cbe54d63 1141int
aac0aabd
MD
1142vop_mountctl(struct vop_ops *ops, struct vnode *vp, int op, struct file *fp,
1143 const void *ctl, int ctllen, void *buf, int buflen, int *res)
cbe54d63 1144{
949ecb9b 1145 struct vop_mountctl_args ap;
aac0aabd 1146 VFS_MPLOCK_DECLARE;
cbe54d63
MD
1147 int error;
1148
949ecb9b 1149 ap.a_head.a_desc = &vop_mountctl_desc;
cbe54d63
MD
1150 ap.a_head.a_ops = ops;
1151 ap.a_op = op;
949ecb9b 1152 ap.a_ctl = ctl;
2281065e 1153 ap.a_fp = fp;
949ecb9b
MD
1154 ap.a_ctllen = ctllen;
1155 ap.a_buf = buf;
1156 ap.a_buflen = buflen;
1157 ap.a_res = res;
cbe54d63 1158
2247fe02 1159 VFS_MPLOCK1(vp->v_mount);
949ecb9b 1160 DO_OPS(ops, error, &ap, vop_mountctl);
aac0aabd 1161 VFS_MPUNLOCK(vp->v_mount);
cbe54d63 1162 return(error);
0961aa92
MD
1163}
1164
aac0aabd
MD
1165/*
1166 * MPSAFE
1167 */
349433c9
MD
1168int
1169vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred)
1170{
1171 struct vop_markatime_args ap;
aac0aabd 1172 VFS_MPLOCK_DECLARE;
349433c9
MD
1173 int error;
1174
1175 ap.a_head.a_desc = &vop_markatime_desc;
1176 ap.a_head.a_ops = ops;
1177 ap.a_vp = vp;
1178 ap.a_cred = cred;
1179
2247fe02 1180 VFS_MPLOCK1(vp->v_mount);
349433c9 1181 DO_OPS(ops, error, &ap, vop_markatime);
aac0aabd 1182 VFS_MPUNLOCK(vp->v_mount);
349433c9
MD
1183 return(error);
1184}
1185
fad57d0e
MD
1186/*
1187 * NEW API FUNCTIONS
1188 *
5312fa43
MD
1189 * nresolve takes a locked ncp, a referenced but unlocked dvp, and a cred,
1190 * and resolves the ncp into a positive or negative hit.
fad57d0e
MD
1191 *
1192 * The namecache is automatically adjusted by this function. The ncp
1193 * is left locked on return.
aac0aabd
MD
1194 *
1195 * MPSAFE
fad57d0e
MD
1196 */
1197int
dff430ab
MD
1198vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
1199 struct vnode *dvp, struct ucred *cred)
fad57d0e
MD
1200{
1201 struct vop_nresolve_args ap;
aac0aabd 1202 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1203 int error;
1204
1205 ap.a_head.a_desc = &vop_nresolve_desc;
1206 ap.a_head.a_ops = ops;
28623bf9 1207 ap.a_nch = nch;
dff430ab 1208 ap.a_dvp = dvp;
fad57d0e
MD
1209 ap.a_cred = cred;
1210
2247fe02 1211 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1212 DO_OPS(ops, error, &ap, vop_nresolve);
aac0aabd 1213 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1214 return(error);
1215}
1216
1217/*
5312fa43
MD
1218 * nlookupdotdot takes an unlocked directory, referenced dvp, and looks
1219 * up "..", returning a locked parent directory in *vpp. If an error
1220 * occurs *vpp will be NULL.
aac0aabd
MD
1221 *
1222 * MPSAFE
fad57d0e
MD
1223 */
1224int
1225vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
33387738 1226 struct vnode **vpp, struct ucred *cred, char **fakename)
fad57d0e
MD
1227{
1228 struct vop_nlookupdotdot_args ap;
aac0aabd 1229 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1230 int error;
1231
1232 ap.a_head.a_desc = &vop_nlookupdotdot_desc;
1233 ap.a_head.a_ops = ops;
1234 ap.a_dvp = dvp;
1235 ap.a_vpp = vpp;
1236 ap.a_cred = cred;
33387738 1237 ap.a_fakename = fakename;
fad57d0e 1238
2247fe02 1239 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1240 DO_OPS(ops, error, &ap, vop_nlookupdotdot);
aac0aabd 1241 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1242 return(error);
1243}
1244
1245/*
1246 * ncreate takes a locked, resolved ncp that typically represents a negative
1247 * cache hit and creates the file or node specified by the ncp, cred, and
1248 * vattr. If no error occurs a locked vnode is returned in *vpp.
1249 *
5312fa43
MD
1250 * The dvp passed in is referenced but unlocked.
1251 *
fad57d0e
MD
1252 * The namecache is automatically adjusted by this function. The ncp
1253 * is left locked on return.
aac0aabd
MD
1254 *
1255 * MPSAFE
fad57d0e
MD
1256 */
1257int
dff430ab 1258vop_ncreate(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1259 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1260{
1261 struct vop_ncreate_args ap;
aac0aabd 1262 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1263 int error;
1264
1265 ap.a_head.a_desc = &vop_ncreate_desc;
1266 ap.a_head.a_ops = ops;
28623bf9 1267 ap.a_nch = nch;
dff430ab 1268 ap.a_dvp = dvp;
fad57d0e
MD
1269 ap.a_vpp = vpp;
1270 ap.a_cred = cred;
1271 ap.a_vap = vap;
1272
2247fe02 1273 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1274 DO_OPS(ops, error, &ap, vop_ncreate);
aac0aabd 1275 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1276 return(error);
1277}
1278
1279/*
1280 * nmkdir takes a locked, resolved ncp that typically represents a negative
1281 * cache hit and creates the directory specified by the ncp, cred, and
1282 * vattr. If no error occurs a locked vnode is returned in *vpp.
1283 *
5312fa43
MD
1284 * The dvp passed in is referenced but unlocked.
1285 *
fad57d0e
MD
1286 * The namecache is automatically adjusted by this function. The ncp
1287 * is left locked on return.
aac0aabd
MD
1288 *
1289 * MPSAFE
fad57d0e
MD
1290 */
1291int
dff430ab 1292vop_nmkdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1293 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1294{
1295 struct vop_nmkdir_args ap;
aac0aabd 1296 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1297 int error;
1298
1299 ap.a_head.a_desc = &vop_nmkdir_desc;
1300 ap.a_head.a_ops = ops;
28623bf9 1301 ap.a_nch = nch;
dff430ab 1302 ap.a_dvp = dvp;
fad57d0e
MD
1303 ap.a_vpp = vpp;
1304 ap.a_cred = cred;
1305 ap.a_vap = vap;
1306
2247fe02 1307 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1308 DO_OPS(ops, error, &ap, vop_nmkdir);
aac0aabd 1309 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1310 return(error);
1311}
1312
1313/*
1314 * nmknod takes a locked, resolved ncp that typically represents a negative
1315 * cache hit and creates the node specified by the ncp, cred, and
1316 * vattr. If no error occurs a locked vnode is returned in *vpp.
1317 *
5312fa43
MD
1318 * The dvp passed in is referenced but unlocked.
1319 *
fad57d0e
MD
1320 * The namecache is automatically adjusted by this function. The ncp
1321 * is left locked on return.
aac0aabd
MD
1322 *
1323 * MPSAFE
fad57d0e
MD
1324 */
1325int
dff430ab 1326vop_nmknod(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1327 struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1328{
1329 struct vop_nmknod_args ap;
aac0aabd 1330 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1331 int error;
1332
1333 ap.a_head.a_desc = &vop_nmknod_desc;
1334 ap.a_head.a_ops = ops;
28623bf9 1335 ap.a_nch = nch;
dff430ab 1336 ap.a_dvp = dvp;
fad57d0e
MD
1337 ap.a_vpp = vpp;
1338 ap.a_cred = cred;
1339 ap.a_vap = vap;
1340
2247fe02 1341 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1342 DO_OPS(ops, error, &ap, vop_nmknod);
aac0aabd 1343 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1344 return(error);
1345}
1346
1347/*
1348 * nlink takes a locked, resolved ncp that typically represents a negative
1349 * cache hit and creates the node specified by the ncp, cred, and
1350 * existing vnode. The passed vp must be locked and will remain locked
1351 * on return, as does the ncp, whether an error occurs or not.
1352 *
5312fa43
MD
1353 * The dvp passed in is referenced but unlocked.
1354 *
fad57d0e
MD
1355 * The namecache is automatically adjusted by this function. The ncp
1356 * is left locked on return.
aac0aabd
MD
1357 *
1358 * MPSAFE
fad57d0e
MD
1359 */
1360int
dff430ab
MD
1361vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1362 struct vnode *vp, struct ucred *cred)
fad57d0e
MD
1363{
1364 struct vop_nlink_args ap;
aac0aabd 1365 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1366 int error;
1367
1368 ap.a_head.a_desc = &vop_nlink_desc;
1369 ap.a_head.a_ops = ops;
28623bf9 1370 ap.a_nch = nch;
dff430ab 1371 ap.a_dvp = dvp;
fad57d0e
MD
1372 ap.a_vp = vp;
1373 ap.a_cred = cred;
1374
2247fe02 1375 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1376 DO_OPS(ops, error, &ap, vop_nlink);
aac0aabd 1377 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1378 return(error);
1379}
1380
1381/*
1382 * nsymlink takes a locked, resolved ncp that typically represents a negative
1383 * cache hit and creates a symbolic link based on cred, vap, and target (the
1384 * contents of the link). If no error occurs a locked vnode is returned in
1385 * *vpp.
1386 *
5312fa43
MD
1387 * The dvp passed in is referenced but unlocked.
1388 *
fad57d0e
MD
1389 * The namecache is automatically adjusted by this function. The ncp
1390 * is left locked on return.
aac0aabd
MD
1391 *
1392 * MPSAFE
fad57d0e
MD
1393 */
1394int
dff430ab 1395vop_nsymlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1396 struct vnode **vpp, struct ucred *cred,
1397 struct vattr *vap, char *target)
1398{
1399 struct vop_nsymlink_args ap;
aac0aabd 1400 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1401 int error;
1402
1403 ap.a_head.a_desc = &vop_nsymlink_desc;
1404 ap.a_head.a_ops = ops;
28623bf9 1405 ap.a_nch = nch;
dff430ab 1406 ap.a_dvp = dvp;
fad57d0e
MD
1407 ap.a_vpp = vpp;
1408 ap.a_cred = cred;
1409 ap.a_vap = vap;
1410 ap.a_target = target;
1411
2247fe02 1412 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1413 DO_OPS(ops, error, &ap, vop_nsymlink);
aac0aabd 1414 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1415 return(error);
1416}
1417
1418/*
1419 * nwhiteout takes a locked, resolved ncp that can represent a positive or
1420 * negative hit and executes the whiteout function specified in flags.
1421 *
5312fa43
MD
1422 * The dvp passed in is referenced but unlocked.
1423 *
fad57d0e
MD
1424 * The namecache is automatically adjusted by this function. The ncp
1425 * is left locked on return.
aac0aabd
MD
1426 *
1427 * MPSAFE
fad57d0e
MD
1428 */
1429int
dff430ab 1430vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
fad57d0e
MD
1431 struct ucred *cred, int flags)
1432{
1433 struct vop_nwhiteout_args ap;
aac0aabd 1434 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1435 int error;
1436
1437 ap.a_head.a_desc = &vop_nwhiteout_desc;
1438 ap.a_head.a_ops = ops;
28623bf9 1439 ap.a_nch = nch;
dff430ab 1440 ap.a_dvp = dvp;
fad57d0e
MD
1441 ap.a_cred = cred;
1442 ap.a_flags = flags;
1443
2247fe02 1444 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1445 DO_OPS(ops, error, &ap, vop_nwhiteout);
aac0aabd 1446 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1447 return(error);
1448}
1449
1450/*
1451 * nremove takes a locked, resolved ncp that generally represents a
1452 * positive hit and removes the file.
1453 *
5312fa43
MD
1454 * The dvp passed in is referenced but unlocked.
1455 *
fad57d0e
MD
1456 * The namecache is automatically adjusted by this function. The ncp
1457 * is left locked on return.
aac0aabd
MD
1458 *
1459 * MPSAFE
fad57d0e
MD
1460 */
1461int
dff430ab
MD
1462vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1463 struct ucred *cred)
fad57d0e
MD
1464{
1465 struct vop_nremove_args ap;
aac0aabd 1466 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1467 int error;
1468
1469 ap.a_head.a_desc = &vop_nremove_desc;
1470 ap.a_head.a_ops = ops;
28623bf9 1471 ap.a_nch = nch;
dff430ab 1472 ap.a_dvp = dvp;
fad57d0e
MD
1473 ap.a_cred = cred;
1474
2247fe02 1475 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1476 DO_OPS(ops, error, &ap, vop_nremove);
aac0aabd 1477 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1478 return(error);
1479}
1480
1481/*
1482 * nrmdir takes a locked, resolved ncp that generally represents a
1483 * directory and removes the directory.
1484 *
5312fa43
MD
1485 * The dvp passed in is referenced but unlocked.
1486 *
fad57d0e
MD
1487 * The namecache is automatically adjusted by this function. The ncp
1488 * is left locked on return.
aac0aabd
MD
1489 *
1490 * MPSAFE
fad57d0e
MD
1491 */
1492int
dff430ab
MD
1493vop_nrmdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1494 struct ucred *cred)
fad57d0e
MD
1495{
1496 struct vop_nrmdir_args ap;
aac0aabd 1497 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1498 int error;
1499
1500 ap.a_head.a_desc = &vop_nrmdir_desc;
1501 ap.a_head.a_ops = ops;
28623bf9 1502 ap.a_nch = nch;
dff430ab 1503 ap.a_dvp = dvp;
fad57d0e
MD
1504 ap.a_cred = cred;
1505
2247fe02 1506 VFS_MPLOCK1(dvp->v_mount);
fad57d0e 1507 DO_OPS(ops, error, &ap, vop_nrmdir);
aac0aabd 1508 VFS_MPUNLOCK(dvp->v_mount);
fad57d0e
MD
1509 return(error);
1510}
1511
1512/*
1513 * nrename takes TWO locked, resolved ncp's and the cred of the caller
1514 * and renames the source ncp to the target ncp. The target ncp may
1515 * represent a positive or negative hit.
1516 *
5312fa43
MD
1517 * The fdvp and tdvp passed in are referenced but unlocked.
1518 *
fad57d0e
MD
1519 * The namecache is automatically adjusted by this function. The ncp
1520 * is left locked on return. The source ncp is typically changed to
1521 * a negative cache hit and the target ncp typically takes on the
1522 * source ncp's underlying file.
aac0aabd
MD
1523 *
1524 * MPSAFE
fad57d0e
MD
1525 */
1526int
dff430ab
MD
1527vop_nrename(struct vop_ops *ops,
1528 struct nchandle *fnch, struct nchandle *tnch,
1529 struct vnode *fdvp, struct vnode *tdvp,
1530 struct ucred *cred)
fad57d0e
MD
1531{
1532 struct vop_nrename_args ap;
aac0aabd 1533 VFS_MPLOCK_DECLARE;
fad57d0e
MD
1534 int error;
1535
1536 ap.a_head.a_desc = &vop_nrename_desc;
1537 ap.a_head.a_ops = ops;
28623bf9
MD
1538 ap.a_fnch = fnch;
1539 ap.a_tnch = tnch;
dff430ab
MD
1540 ap.a_fdvp = fdvp;
1541 ap.a_tdvp = tdvp;
fad57d0e
MD
1542 ap.a_cred = cred;
1543
2247fe02 1544 VFS_MPLOCK1(fdvp->v_mount);
fad57d0e 1545 DO_OPS(ops, error, &ap, vop_nrename);
aac0aabd 1546 VFS_MPUNLOCK(fdvp->v_mount);
fad57d0e
MD
1547 return(error);
1548}
1549
0961aa92
MD
1550/************************************************************************
1551 * PRIMARY VNODE OPERATIONS FORWARDING CALLS *
1552 ************************************************************************
1553 *
1554 * These procedures are called from VFSs such as unionfs and nullfs
1555 * when they wish to forward an operation on one VFS to another. The
1556 * argument structure/message is modified and then directly passed to the
1557 * appropriate routine. This routines may also be called by initiators
1558 * who have an argument structure in hand rather then discreet arguments.
aac0aabd
MD
1559 *
1560 * MPSAFE - Caller expected to already hold the appropriate vfs lock.
0961aa92
MD
1561 */
1562int
1563vop_vnoperate_ap(struct vop_generic_args *ap)
1564{
cbe54d63
MD
1565 struct vop_ops *ops;
1566 int error;
1567
1568 ops = ap->a_ops;
6ddb7618
MD
1569 error = VOCALL(ops, ap);
1570
1571 return (error);
1572}
1573
1574/*
1575 * This routine is called by the cache coherency layer to execute the actual
1576 * VFS operation. If a journaling layer is present we call though it, else
1577 * we call the native VOP functions.
1578 */
1579int
1580vop_cache_operate_ap(struct vop_generic_args *ap)
1581{
1582 struct vop_ops *ops;
1583 int error;
1584
1585 ops = ap->a_ops;
66a1ddf5
MD
1586 if (ops->head.vv_mount->mnt_vn_journal_ops)
1587 error = VOCALL(ops->head.vv_mount->mnt_vn_journal_ops, ap);
6ddb7618 1588 else
66a1ddf5 1589 error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
6ddb7618
MD
1590 return (error);
1591}
1592
1593
1594/*
1595 * This routine is called by the journaling layer to execute the actual
1596 * VFS operation.
1597 */
1598int
1599vop_journal_operate_ap(struct vop_generic_args *ap)
1600{
1601 struct vop_ops *ops;
1602 int error;
1603
1604 ops = ap->a_ops;
66a1ddf5 1605 error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
6ddb7618 1606
cbe54d63 1607 return (error);
0961aa92
MD
1608}
1609
0961aa92
MD
1610int
1611vop_open_ap(struct vop_open_args *ap)
1612{
cbe54d63
MD
1613 int error;
1614
1615 DO_OPS(ap->a_head.a_ops, error, ap, vop_open);
1616 return(error);
0961aa92
MD
1617}
1618
1619int
1620vop_close_ap(struct vop_close_args *ap)
1621{
cbe54d63
MD
1622 int error;
1623
1624 DO_OPS(ap->a_head.a_ops, error, ap, vop_close);
1625 return(error);
0961aa92
MD
1626}
1627
1628int
1629vop_access_ap(struct vop_access_args *ap)
1630{
cbe54d63
MD
1631 int error;
1632
1633 DO_OPS(ap->a_head.a_ops, error, ap, vop_access);
1634 return(error);
0961aa92
MD
1635}
1636
1637int
1638vop_getattr_ap(struct vop_getattr_args *ap)
1639{
cbe54d63
MD
1640 int error;
1641
1642 DO_OPS(ap->a_head.a_ops, error, ap, vop_getattr);
1643 return(error);
0961aa92
MD
1644}
1645
1646int
1647vop_setattr_ap(struct vop_setattr_args *ap)
1648{
cbe54d63
MD
1649 int error;
1650
1651 DO_OPS(ap->a_head.a_ops, error, ap, vop_setattr);
1652 return(error);
0961aa92
MD
1653}
1654
1655int
1656vop_read_ap(struct vop_read_args *ap)
1657{
cbe54d63
MD
1658 int error;
1659
1660 DO_OPS(ap->a_head.a_ops, error, ap, vop_read);
1661 return(error);
0961aa92
MD
1662}
1663
1664int
1665vop_write_ap(struct vop_write_args *ap)
1666{
cbe54d63
MD
1667 int error;
1668
1669 DO_OPS(ap->a_head.a_ops, error, ap, vop_write);
1670 return(error);
0961aa92
MD
1671}
1672
0961aa92
MD
1673int
1674vop_ioctl_ap(struct vop_ioctl_args *ap)
1675{
cbe54d63
MD
1676 int error;
1677
1678 DO_OPS(ap->a_head.a_ops, error, ap, vop_ioctl);
1679 return(error);
0961aa92
MD
1680}
1681
1682int
1683vop_poll_ap(struct vop_poll_args *ap)
1684{
cbe54d63
MD
1685 int error;
1686
1687 DO_OPS(ap->a_head.a_ops, error, ap, vop_poll);
1688 return(error);
0961aa92
MD
1689}
1690
1691int
1692vop_kqfilter_ap(struct vop_kqfilter_args *ap)
1693{
cbe54d63
MD
1694 int error;
1695
1696 DO_OPS(ap->a_head.a_ops, error, ap, vop_kqfilter);
1697 return(error);
0961aa92
MD
1698}
1699
0961aa92
MD
1700int
1701vop_mmap_ap(struct vop_mmap_args *ap)
1702{
cbe54d63
MD
1703 int error;
1704
1705 DO_OPS(ap->a_head.a_ops, error, ap, vop_mmap);
1706 return(error);
0961aa92
MD
1707}
1708
1709int
1710vop_fsync_ap(struct vop_fsync_args *ap)
1711{
cbe54d63
MD
1712 int error;
1713
1714 DO_OPS(ap->a_head.a_ops, error, ap, vop_fsync);
1715 return(error);
0961aa92
MD
1716}
1717
0961aa92
MD
1718int
1719vop_readdir_ap(struct vop_readdir_args *ap)
1720{
cbe54d63
MD
1721 int error;
1722
1723 DO_OPS(ap->a_head.a_ops, error, ap, vop_readdir);
1724 return(error);
0961aa92
MD
1725}
1726
1727int
1728vop_readlink_ap(struct vop_readlink_args *ap)
1729{
cbe54d63
MD
1730 int error;
1731
1732 DO_OPS(ap->a_head.a_ops, error, ap, vop_readlink);
1733 return(error);
0961aa92
MD
1734}
1735
1736int
1737vop_inactive_ap(struct vop_inactive_args *ap)
1738{
cbe54d63
MD
1739 int error;
1740
1741 DO_OPS(ap->a_head.a_ops, error, ap, vop_inactive);
1742 return(error);
0961aa92
MD
1743}
1744
1745int
1746vop_reclaim_ap(struct vop_reclaim_args *ap)
1747{
cbe54d63
MD
1748 int error;
1749
1750 DO_OPS(ap->a_head.a_ops, error, ap, vop_reclaim);
1751 return(error);
0961aa92
MD
1752}
1753
0961aa92
MD
1754int
1755vop_bmap_ap(struct vop_bmap_args *ap)
1756{
cbe54d63
MD
1757 int error;
1758
1759 DO_OPS(ap->a_head.a_ops, error, ap, vop_bmap);
1760 return(error);
0961aa92
MD
1761}
1762
1763int
1764vop_strategy_ap(struct vop_strategy_args *ap)
1765{
cbe54d63
MD
1766 int error;
1767
1768 DO_OPS(ap->a_head.a_ops, error, ap, vop_strategy);
1769 return(error);
0961aa92
MD
1770}
1771
1772int
1773vop_print_ap(struct vop_print_args *ap)
1774{
cbe54d63
MD
1775 int error;
1776
1777 DO_OPS(ap->a_head.a_ops, error, ap, vop_print);
1778 return(error);
0961aa92
MD
1779}
1780
1781int
1782vop_pathconf_ap(struct vop_pathconf_args *ap)
1783{
cbe54d63
MD
1784 int error;
1785
1786 DO_OPS(ap->a_head.a_ops, error, ap, vop_pathconf);
1787 return(error);
0961aa92
MD
1788}
1789
1790int
1791vop_advlock_ap(struct vop_advlock_args *ap)
1792{
cbe54d63
MD
1793 int error;
1794
1795 DO_OPS(ap->a_head.a_ops, error, ap, vop_advlock);
1796 return(error);
0961aa92
MD
1797}
1798
1799int
1800vop_balloc_ap(struct vop_balloc_args *ap)
1801{
cbe54d63
MD
1802 int error;
1803
1804 DO_OPS(ap->a_head.a_ops, error, ap, vop_balloc);
1805 return(error);
0961aa92
MD
1806}
1807
1808int
1809vop_reallocblks_ap(struct vop_reallocblks_args *ap)
1810{
cbe54d63
MD
1811 int error;
1812
1813 DO_OPS(ap->a_head.a_ops, error, ap, vop_reallocblks);
1814 return(error);
0961aa92
MD
1815}
1816
1817int
1818vop_getpages_ap(struct vop_getpages_args *ap)
1819{
cbe54d63
MD
1820 int error;
1821
1822 DO_OPS(ap->a_head.a_ops, error, ap, vop_getpages);
1823 return(error);
0961aa92
MD
1824}
1825
1826int
1827vop_putpages_ap(struct vop_putpages_args *ap)
1828{
cbe54d63
MD
1829 int error;
1830
1831 DO_OPS(ap->a_head.a_ops, error, ap, vop_putpages);
1832 return(error);
0961aa92
MD
1833}
1834
1835int
1836vop_freeblks_ap(struct vop_freeblks_args *ap)
1837{
cbe54d63
MD
1838 int error;
1839
1840 DO_OPS(ap->a_head.a_ops, error, ap, vop_freeblks);
1841 return(error);
0961aa92
MD
1842}
1843
0961aa92
MD
1844int
1845vop_getacl_ap(struct vop_getacl_args *ap)
1846{
cbe54d63
MD
1847 int error;
1848
1849 DO_OPS(ap->a_head.a_ops, error, ap, vop_getacl);
1850 return(error);
0961aa92
MD
1851}
1852
1853int
1854vop_setacl_ap(struct vop_setacl_args *ap)
1855{
cbe54d63
MD
1856 int error;
1857
1858 DO_OPS(ap->a_head.a_ops, error, ap, vop_setacl);
1859 return(error);
0961aa92
MD
1860}
1861
1862int
1863vop_aclcheck_ap(struct vop_aclcheck_args *ap)
1864{
cbe54d63
MD
1865 int error;
1866
1867 DO_OPS(ap->a_head.a_ops, error, ap, vop_aclcheck);
1868 return(error);
0961aa92
MD
1869}
1870
1871int
1872vop_getextattr_ap(struct vop_getextattr_args *ap)
1873{
cbe54d63
MD
1874 int error;
1875
1876 DO_OPS(ap->a_head.a_ops, error, ap, vop_getextattr);
1877 return(error);
0961aa92
MD
1878}
1879
1880int
1881vop_setextattr_ap(struct vop_setextattr_args *ap)
1882{
cbe54d63
MD
1883 int error;
1884
1885 DO_OPS(ap->a_head.a_ops, error, ap, vop_setextattr);
1886 return(error);
0961aa92
MD
1887}
1888
cbe54d63 1889int
949ecb9b 1890vop_mountctl_ap(struct vop_mountctl_args *ap)
cbe54d63
MD
1891{
1892 int error;
1893
949ecb9b 1894 DO_OPS(ap->a_head.a_ops, error, ap, vop_mountctl);
cbe54d63 1895 return(error);
2d3e977e
MD
1896}
1897
349433c9
MD
1898int
1899vop_markatime_ap(struct vop_markatime_args *ap)
1900{
1901 int error;
1902
1903 DO_OPS(ap->a_head.a_ops, error, ap, vop_markatime);
1904 return(error);
1905}
1906
fad57d0e
MD
1907int
1908vop_nresolve_ap(struct vop_nresolve_args *ap)
1909{
1910 int error;
1911
1912 DO_OPS(ap->a_head.a_ops, error, ap, vop_nresolve);
1913 return(error);
1914}
1915
1916int
1917vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap)
1918{
1919 int error;
1920
1921 DO_OPS(ap->a_head.a_ops, error, ap, vop_nlookupdotdot);
1922 return(error);
1923}
1924
1925int
1926vop_ncreate_ap(struct vop_ncreate_args *ap)
1927{
1928 int error;
1929
1930 DO_OPS(ap->a_head.a_ops, error, ap, vop_ncreate);
1931 return(error);
1932}
1933
1934int
1935vop_nmkdir_ap(struct vop_nmkdir_args *ap)
1936{
1937 int error;
1938
1939 DO_OPS(ap->a_head.a_ops, error, ap, vop_nmkdir);
1940 return(error);
1941}
1942
1943int
1944vop_nmknod_ap(struct vop_nmknod_args *ap)
1945{
1946 int error;
1947
1948 DO_OPS(ap->a_head.a_ops, error, ap, vop_nmknod);
1949 return(error);
1950}
1951
1952int
1953vop_nlink_ap(struct vop_nlink_args *ap)
1954{
1955 int error;
1956
1957 DO_OPS(ap->a_head.a_ops, error, ap, vop_nlink);
1958 return(error);
1959}
1960
1961int
1962vop_nsymlink_ap(struct vop_nsymlink_args *ap)
1963{
1964 int error;
1965
1966 DO_OPS(ap->a_head.a_ops, error, ap, vop_nsymlink);
1967 return(error);
1968}
1969
1970int
1971vop_nwhiteout_ap(struct vop_nwhiteout_args *ap)
1972{
1973 int error;
1974
1975 DO_OPS(ap->a_head.a_ops, error, ap, vop_nwhiteout);
1976 return(error);
1977}
1978
1979int
1980vop_nremove_ap(struct vop_nremove_args *ap)
1981{
1982 int error;
1983
1984 DO_OPS(ap->a_head.a_ops, error, ap, vop_nremove);
1985 return(error);
1986}
1987
1988int
1989vop_nrmdir_ap(struct vop_nrmdir_args *ap)
1990{
1991 int error;
1992
1993 DO_OPS(ap->a_head.a_ops, error, ap, vop_nrmdir);
1994 return(error);
1995}
1996
1997int
1998vop_nrename_ap(struct vop_nrename_args *ap)
1999{
2000 int error;
2001
2002 DO_OPS(ap->a_head.a_ops, error, ap, vop_nrename);
2003 return(error);
2004}
2005