Style(9):
[dragonfly.git] / sys / kern / vfs_vopops.c
CommitLineData
2d3e977e
MD
1/*
2 *
3 * Copyright (c) 2004 The DragonFly Project. All rights reserved.
4 *
5 * This code is derived from software contributed to The DragonFly Project
6 * by Matthew Dillon <dillon@backplane.com>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * 3. Neither the name of The DragonFly Project nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific, prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
5fd012e0 35 * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.9 2004/10/12 19:20:46 dillon Exp $
2d3e977e
MD
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/buf.h>
41#include <sys/conf.h>
42#include <sys/dirent.h>
43#include <sys/domain.h>
44#include <sys/eventhandler.h>
45#include <sys/fcntl.h>
46#include <sys/kernel.h>
47#include <sys/kthread.h>
48#include <sys/malloc.h>
49#include <sys/mbuf.h>
50#include <sys/mount.h>
51#include <sys/proc.h>
52#include <sys/namei.h>
53#include <sys/reboot.h>
54#include <sys/socket.h>
55#include <sys/stat.h>
56#include <sys/sysctl.h>
57#include <sys/syslog.h>
58#include <sys/vmmeter.h>
59#include <sys/vnode.h>
0961aa92 60#include <sys/vfsops.h>
2d3e977e
MD
61
62#include <machine/limits.h>
63
64#include <vm/vm.h>
65#include <vm/vm_object.h>
66#include <vm/vm_extern.h>
67#include <vm/vm_kern.h>
68#include <vm/pmap.h>
69#include <vm/vm_map.h>
70#include <vm/vm_page.h>
71#include <vm/vm_pager.h>
72#include <vm/vnode_pager.h>
73#include <vm/vm_zone.h>
74
75#include <sys/buf2.h>
76#include <sys/thread2.h>
77
78#define VOFFNAME(name) __CONCAT(__CONCAT(vop_,name),_vp_offsets)
79#define VDESCNAME(name) __CONCAT(__CONCAT(vop_,name),_desc)
80#define VARGSSTRUCT(name) struct __CONCAT(__CONCAT(vop_,name),_args)
81
82#define VNODEOP_DESC_INIT(name, flags, vpoffs, vpp, cred, proc, comp) \
83 struct vnodeop_desc VDESCNAME(name) = { \
84 __offsetof(struct vop_ops, __CONCAT(vop_, name)), \
85 #name, flags, vpoffs, vpp, cred, proc, comp }
86
87#define VNODEOP_DESC_INIT_SIMPLE(name) \
88 VNODEOP_DESC_INIT(name, 0, NULL, \
89 VDESC_NO_OFFSET, \
90 VDESC_NO_OFFSET, \
91 VDESC_NO_OFFSET, \
92 VDESC_NO_OFFSET)
93
94#define VNODEOP_DESC_INIT_VP(name) \
95 static int VOFFNAME(name)[] = { \
96 __offsetof(VARGSSTRUCT(name), a_vp), \
97 VDESC_NO_OFFSET }; \
98 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
99 VDESC_NO_OFFSET, \
100 VDESC_NO_OFFSET, \
101 VDESC_NO_OFFSET, \
102 VDESC_NO_OFFSET)
103
104#define VNODEOP_DESC_INIT_VP_VPP(name) \
105 static int VOFFNAME(name)[] = { \
106 __offsetof(VARGSSTRUCT(name), a_vp), \
107 VDESC_NO_OFFSET }; \
108 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
109 __offsetof(VARGSSTRUCT(name), a_vpp), \
110 VDESC_NO_OFFSET, \
111 VDESC_NO_OFFSET, \
112 VDESC_NO_OFFSET)
113
114#define VNODEOP_DESC_INIT_VP_CRED(name) \
115 static int VOFFNAME(name)[] = { \
116 __offsetof(VARGSSTRUCT(name), a_vp), \
117 VDESC_NO_OFFSET }; \
118 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
119 VDESC_NO_OFFSET, \
120 __offsetof(VARGSSTRUCT(name), a_cred), \
121 VDESC_NO_OFFSET, \
122 VDESC_NO_OFFSET)
123
690a3127
MD
124#define VNODEOP_DESC_INIT_NCP(name) \
125 VNODEOP_DESC_INIT(name, 0, NULL, \
126 VDESC_NO_OFFSET, \
127 VDESC_NO_OFFSET, \
128 VDESC_NO_OFFSET, \
129 VDESC_NO_OFFSET)
130
21739618
MD
131#define VNODEOP_DESC_INIT_NCP_CRED(name) \
132 VNODEOP_DESC_INIT(name, 0, NULL, \
133 VDESC_NO_OFFSET, \
134 __offsetof(VARGSSTRUCT(name), a_cred), \
135 VDESC_NO_OFFSET, \
136 VDESC_NO_OFFSET)
137
2d3e977e
MD
138#define VNODEOP_DESC_INIT_DVP_VPP_CNP(name) \
139 static int VOFFNAME(name)[] = { \
140 __offsetof(VARGSSTRUCT(name), a_dvp), \
141 VDESC_NO_OFFSET }; \
142 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
143 __offsetof(VARGSSTRUCT(name), a_vpp), \
144 VDESC_NO_OFFSET, \
145 VDESC_NO_OFFSET, \
146 __offsetof(VARGSSTRUCT(name), a_cnp))
147
148#define VNODEOP_DESC_INIT_DVP_CNP(name) \
149 static int VOFFNAME(name)[] = { \
150 __offsetof(VARGSSTRUCT(name), a_dvp), \
151 VDESC_NO_OFFSET }; \
152 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
153 VDESC_NO_OFFSET, \
154 VDESC_NO_OFFSET, \
155 VDESC_NO_OFFSET, \
156 __offsetof(VARGSSTRUCT(name), a_cnp))
157
158#define VNODEOP_DESC_INIT_DVP_VP_CNP(name) \
159 static int VOFFNAME(name)[] = { \
160 __offsetof(VARGSSTRUCT(name), a_dvp), \
161 __offsetof(VARGSSTRUCT(name), a_vp), \
162 VDESC_NO_OFFSET }; \
163 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
164 VDESC_NO_OFFSET, \
165 VDESC_NO_OFFSET, \
166 VDESC_NO_OFFSET, \
167 __offsetof(VARGSSTRUCT(name), a_cnp))
168
169#define VNODEOP_DESC_INIT_TDVP_VP_CNP(name) \
170 static int VOFFNAME(name)[] = { \
171 __offsetof(VARGSSTRUCT(name), a_tdvp), \
172 __offsetof(VARGSSTRUCT(name), a_vp), \
173 VDESC_NO_OFFSET }; \
174 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
175 VDESC_NO_OFFSET, \
176 VDESC_NO_OFFSET, \
177 VDESC_NO_OFFSET, \
178 __offsetof(VARGSSTRUCT(name), a_cnp))
179
180VNODEOP_DESC_INIT_SIMPLE(default);
181VNODEOP_DESC_INIT_VP(islocked);
21739618 182VNODEOP_DESC_INIT_NCP_CRED(resolve);
2d3e977e
MD
183VNODEOP_DESC_INIT_DVP_VPP_CNP(lookup);
184VNODEOP_DESC_INIT_DVP_VPP_CNP(cachedlookup);
185VNODEOP_DESC_INIT_DVP_VPP_CNP(create);
186VNODEOP_DESC_INIT_DVP_CNP(whiteout);
187VNODEOP_DESC_INIT_DVP_VPP_CNP(mknod);
188VNODEOP_DESC_INIT_VP_CRED(open);
189VNODEOP_DESC_INIT_VP(close);
190VNODEOP_DESC_INIT_VP_CRED(access);
191VNODEOP_DESC_INIT_VP(getattr);
192VNODEOP_DESC_INIT_VP_CRED(setattr);
193VNODEOP_DESC_INIT_VP_CRED(read);
194VNODEOP_DESC_INIT_VP_CRED(write);
195VNODEOP_DESC_INIT_VP_CRED(lease);
196VNODEOP_DESC_INIT_VP_CRED(ioctl);
197VNODEOP_DESC_INIT_VP_CRED(poll);
198VNODEOP_DESC_INIT_VP(kqfilter);
199VNODEOP_DESC_INIT_VP(revoke);
200VNODEOP_DESC_INIT_VP_CRED(mmap);
201VNODEOP_DESC_INIT_VP(fsync);
202VNODEOP_DESC_INIT_DVP_VP_CNP(remove);
21739618 203VNODEOP_DESC_INIT_NCP_CRED(nremove);
2d3e977e
MD
204VNODEOP_DESC_INIT_TDVP_VP_CNP(link);
205
206static int VOFFNAME(rename)[] = {
207 __offsetof(VARGSSTRUCT(rename), a_fdvp),
208 __offsetof(VARGSSTRUCT(rename), a_fvp),
209 __offsetof(VARGSSTRUCT(rename), a_tdvp),
210 __offsetof(VARGSSTRUCT(rename), a_tvp),
211 VDESC_NO_OFFSET
212};
213VNODEOP_DESC_INIT(rename,
214 VDESC_VP0_WILLRELE|VDESC_VP1_WILLRELE|
3446c007
MD
215 VDESC_VP2_WILLRELE|VDESC_VP3_WILLRELE|
216 VDESC_VP2_WILLUNLOCK|VDESC_VP3_WILLUNLOCK, /* tdvp and tvp */
2d3e977e
MD
217 VOFFNAME(rename),
218 VDESC_NO_OFFSET,
219 VDESC_NO_OFFSET,
220 VDESC_NO_OFFSET,
221 __offsetof(VARGSSTRUCT(rename), a_fcnp));
222VNODEOP_DESC_INIT_DVP_VPP_CNP(mkdir);
223VNODEOP_DESC_INIT_DVP_VP_CNP(rmdir);
224VNODEOP_DESC_INIT_DVP_VPP_CNP(symlink);
225VNODEOP_DESC_INIT_VP_CRED(readdir);
226VNODEOP_DESC_INIT_VP_CRED(readlink);
227VNODEOP_DESC_INIT_VP(inactive);
228VNODEOP_DESC_INIT_VP(reclaim);
229VNODEOP_DESC_INIT_VP(lock);
230VNODEOP_DESC_INIT_VP(unlock);
231VNODEOP_DESC_INIT_VP_VPP(bmap);
232VNODEOP_DESC_INIT_VP(strategy);
233VNODEOP_DESC_INIT_VP(print);
234VNODEOP_DESC_INIT_VP(pathconf);
235VNODEOP_DESC_INIT_VP(advlock);
236VNODEOP_DESC_INIT_VP_CRED(balloc);
237VNODEOP_DESC_INIT_VP(reallocblks);
238VNODEOP_DESC_INIT_VP(getpages);
239VNODEOP_DESC_INIT_VP(putpages);
240VNODEOP_DESC_INIT_VP(freeblks);
241VNODEOP_DESC_INIT_VP(bwrite);
242VNODEOP_DESC_INIT_VP_CRED(getacl);
243VNODEOP_DESC_INIT_VP_CRED(setacl);
244VNODEOP_DESC_INIT_VP_CRED(aclcheck);
245VNODEOP_DESC_INIT_VP_CRED(getextattr);
246VNODEOP_DESC_INIT_VP_CRED(setextattr);
247VNODEOP_DESC_INIT_VP(createvobject);
248VNODEOP_DESC_INIT_VP(destroyvobject);
249VNODEOP_DESC_INIT_VP(getvobject);
cbe54d63
MD
250VNODEOP_DESC_INIT_SIMPLE(vfsset);
251
252/*
253 * The DO_OPS macro basicallys calls ops->blah(&ap) but is also responsible
254 * for checking vv_flags and executing additional hook functions.
255 *
256 * NOTE: vop_vnoperate_ap() rolls its own DO_OPS equivalent.
257 */
258#define DO_OPS(ops, error, ap, vop_field) \
259 if (ops->vv_flags & VVF_HOOK_MASK) { \
260 if (ops->vv_flags & VVF_JOURNAL_HOOK) \
261 error = ops->vv_jops->vop_field(ap); \
262 else \
263 error = 0; \
264 if (error == 0) \
265 error = ops->vop_field(ap); \
266 } else { \
267 error = ops->vop_field(ap); \
268 } \
269
2d3e977e 270
0961aa92
MD
271/************************************************************************
272 * PRIMARY HIGH LEVEL VNODE OPERATIONS CALLS *
273 ************************************************************************
274 *
275 * These procedures are called directly from the kernel and/or fileops
276 * code to perform file/device operations on the system.
277 */
278
2d3e977e 279int
0961aa92 280vop_islocked(struct vop_ops *ops, struct vnode *vp, struct thread *td)
2d3e977e
MD
281{
282 struct vop_islocked_args ap;
cbe54d63 283 int error;
2d3e977e
MD
284
285 ap.a_head.a_desc = &vop_islocked_desc;
0961aa92 286 ap.a_head.a_ops = ops;
2d3e977e
MD
287 ap.a_vp = vp;
288 ap.a_td = td;
cbe54d63
MD
289
290 DO_OPS(ops, error, &ap, vop_islocked);
291 return(error);
2d3e977e
MD
292}
293
690a3127 294int
21739618 295vop_resolve(struct vop_ops *ops, struct namecache *ncp, struct ucred *cred)
690a3127
MD
296{
297 struct vop_resolve_args ap;
298 int error;
299
300 ap.a_head.a_desc = &vop_resolve_desc;
301 ap.a_head.a_ops = ops;
302 ap.a_ncp = ncp;
21739618 303 ap.a_cred = cred;
690a3127
MD
304
305 DO_OPS(ops, error, &ap, vop_resolve);
306 return(error);
307}
308
2d3e977e 309int
0961aa92 310vop_lookup(struct vop_ops *ops, struct vnode *dvp,
26b67a34 311 struct vnode **vpp, struct componentname *cnp)
2d3e977e
MD
312{
313 struct vop_lookup_args ap;
cbe54d63 314 int error;
2d3e977e
MD
315
316 ap.a_head.a_desc = &vop_lookup_desc;
0961aa92 317 ap.a_head.a_ops = ops;
2d3e977e 318 ap.a_dvp = dvp;
2d3e977e 319 ap.a_vpp = vpp;
2d3e977e 320 ap.a_cnp = cnp;
cbe54d63
MD
321
322 DO_OPS(ops, error, &ap, vop_lookup);
323 return(error);
2d3e977e
MD
324}
325
326int
0961aa92 327vop_cachedlookup(struct vop_ops *ops, struct vnode *dvp,
14c92d03 328 struct vnode **vpp, struct componentname *cnp)
2d3e977e
MD
329{
330 struct vop_cachedlookup_args ap;
cbe54d63 331 int error;
2d3e977e
MD
332
333 ap.a_head.a_desc = &vop_cachedlookup_desc;
0961aa92 334 ap.a_head.a_ops = ops;
2d3e977e 335 ap.a_dvp = dvp;
2d3e977e 336 ap.a_vpp = vpp;
2d3e977e 337 ap.a_cnp = cnp;
cbe54d63
MD
338
339 DO_OPS(ops, error, &ap, vop_cachedlookup);
340 return(error);
2d3e977e
MD
341}
342
343int
0961aa92
MD
344vop_create(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
345 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e
MD
346{
347 struct vop_create_args ap;
cbe54d63 348 int error;
2d3e977e
MD
349
350 ap.a_head.a_desc = &vop_create_desc;
0961aa92 351 ap.a_head.a_ops = ops;
2d3e977e
MD
352 ap.a_dvp = dvp;
353 ap.a_par = par;
354 ap.a_vpp = vpp;
355 ap.a_cnp = cnp;
356 ap.a_vap = vap;
cbe54d63
MD
357
358 DO_OPS(ops, error, &ap, vop_create);
359 return(error);
2d3e977e
MD
360}
361
362int
0961aa92
MD
363vop_whiteout(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
364 struct componentname *cnp, int flags)
2d3e977e
MD
365{
366 struct vop_whiteout_args ap;
cbe54d63 367 int error;
2d3e977e
MD
368
369 ap.a_head.a_desc = &vop_whiteout_desc;
0961aa92 370 ap.a_head.a_ops = ops;
2d3e977e
MD
371 ap.a_dvp = dvp;
372 ap.a_par = par;
373 ap.a_cnp = cnp;
374 ap.a_flags = flags;
cbe54d63
MD
375
376 DO_OPS(ops, error, &ap, vop_whiteout);
377 return(error);
2d3e977e
MD
378}
379
380int
0961aa92
MD
381vop_mknod(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
382 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e
MD
383{
384 struct vop_mknod_args ap;
cbe54d63 385 int error;
2d3e977e
MD
386
387 ap.a_head.a_desc = &vop_mknod_desc;
0961aa92 388 ap.a_head.a_ops = ops;
2d3e977e
MD
389 ap.a_dvp = dvp;
390 ap.a_par = par;
391 ap.a_vpp = vpp;
392 ap.a_cnp = cnp;
393 ap.a_vap = vap;
cbe54d63
MD
394
395 DO_OPS(ops, error, &ap, vop_mknod);
396 return(error);
2d3e977e
MD
397}
398
399int
0961aa92
MD
400vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred,
401 struct thread *td)
2d3e977e
MD
402{
403 struct vop_open_args ap;
cbe54d63 404 int error;
2d3e977e
MD
405
406 ap.a_head.a_desc = &vop_open_desc;
0961aa92 407 ap.a_head.a_ops = ops;
2d3e977e
MD
408 ap.a_vp = vp;
409 ap.a_mode = mode;
410 ap.a_cred = cred;
411 ap.a_td = td;
cbe54d63
MD
412
413 DO_OPS(ops, error, &ap, vop_open);
414 return(error);
2d3e977e
MD
415}
416
417int
0961aa92 418vop_close(struct vop_ops *ops, struct vnode *vp, int fflag, struct thread *td)
2d3e977e
MD
419{
420 struct vop_close_args ap;
cbe54d63 421 int error;
2d3e977e
MD
422
423 ap.a_head.a_desc = &vop_close_desc;
0961aa92 424 ap.a_head.a_ops = ops;
2d3e977e
MD
425 ap.a_vp = vp;
426 ap.a_fflag = fflag;
427 ap.a_td = td;
cbe54d63
MD
428
429 DO_OPS(ops, error, &ap, vop_close);
430 return(error);
2d3e977e
MD
431}
432
433int
0961aa92
MD
434vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred,
435 struct thread *td)
2d3e977e
MD
436{
437 struct vop_access_args ap;
cbe54d63 438 int error;
2d3e977e
MD
439
440 ap.a_head.a_desc = &vop_access_desc;
0961aa92 441 ap.a_head.a_ops = ops;
2d3e977e
MD
442 ap.a_vp = vp;
443 ap.a_mode = mode;
444 ap.a_cred = cred;
445 ap.a_td = td;
cbe54d63
MD
446
447 DO_OPS(ops, error, &ap, vop_access);
448 return(error);
2d3e977e
MD
449}
450
451int
0961aa92
MD
452vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
453 struct thread *td)
2d3e977e
MD
454{
455 struct vop_getattr_args ap;
cbe54d63 456 int error;
2d3e977e
MD
457
458 ap.a_head.a_desc = &vop_getattr_desc;
0961aa92 459 ap.a_head.a_ops = ops;
2d3e977e
MD
460 ap.a_vp = vp;
461 ap.a_vap = vap;
462 ap.a_td = td;
cbe54d63
MD
463
464 DO_OPS(ops, error, &ap, vop_getattr);
465 return(error);
2d3e977e
MD
466}
467
468int
0961aa92
MD
469vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
470 struct ucred *cred, struct thread *td)
2d3e977e
MD
471{
472 struct vop_setattr_args ap;
cbe54d63 473 int error;
2d3e977e
MD
474
475 ap.a_head.a_desc = &vop_setattr_desc;
0961aa92 476 ap.a_head.a_ops = ops;
2d3e977e
MD
477 ap.a_vp = vp;
478 ap.a_vap = vap;
479 ap.a_cred = cred;
480 ap.a_td = td;
cbe54d63
MD
481
482 DO_OPS(ops, error, &ap, vop_setattr);
483 return(error);
2d3e977e
MD
484}
485
486int
0961aa92
MD
487vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
488 struct ucred *cred)
2d3e977e
MD
489{
490 struct vop_read_args ap;
cbe54d63 491 int error;
2d3e977e
MD
492
493 ap.a_head.a_desc = &vop_read_desc;
0961aa92 494 ap.a_head.a_ops = ops;
2d3e977e
MD
495 ap.a_vp = vp;
496 ap.a_uio = uio;
497 ap.a_ioflag = ioflag;
498 ap.a_cred = cred;
cbe54d63
MD
499
500 DO_OPS(ops, error, &ap, vop_read);
501 return(error);
2d3e977e
MD
502}
503
504int
0961aa92
MD
505vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
506 struct ucred *cred)
2d3e977e
MD
507{
508 struct vop_write_args ap;
cbe54d63 509 int error;
2d3e977e
MD
510
511 ap.a_head.a_desc = &vop_write_desc;
0961aa92 512 ap.a_head.a_ops = ops;
2d3e977e
MD
513 ap.a_vp = vp;
514 ap.a_uio = uio;
515 ap.a_ioflag = ioflag;
516 ap.a_cred = cred;
cbe54d63
MD
517
518 DO_OPS(ops, error, &ap, vop_write);
519 return(error);
2d3e977e
MD
520}
521
522int
0961aa92
MD
523vop_lease(struct vop_ops *ops, struct vnode *vp, struct thread *td,
524 struct ucred *cred, int flag)
2d3e977e
MD
525{
526 struct vop_lease_args ap;
cbe54d63 527 int error;
2d3e977e
MD
528
529 ap.a_head.a_desc = &vop_lease_desc;
0961aa92 530 ap.a_head.a_ops = ops;
2d3e977e
MD
531 ap.a_vp = vp;
532 ap.a_td = td;
533 ap.a_cred = cred;
534 ap.a_flag = flag;
cbe54d63
MD
535
536 DO_OPS(ops, error, &ap, vop_lease);
537 return(error);
2d3e977e
MD
538}
539
540int
0961aa92
MD
541vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data,
542 int fflag, struct ucred *cred,
543 struct thread *td)
2d3e977e
MD
544{
545 struct vop_ioctl_args ap;
cbe54d63 546 int error;
2d3e977e
MD
547
548 ap.a_head.a_desc = &vop_ioctl_desc;
0961aa92 549 ap.a_head.a_ops = ops;
2d3e977e
MD
550 ap.a_vp = vp;
551 ap.a_command = command;
552 ap.a_data = data;
553 ap.a_fflag = fflag;
554 ap.a_cred = cred;
555 ap.a_td = td;
cbe54d63
MD
556
557 DO_OPS(ops, error, &ap, vop_ioctl);
558 return(error);
2d3e977e
MD
559}
560
561int
0961aa92
MD
562vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred,
563 struct thread *td)
2d3e977e
MD
564{
565 struct vop_poll_args ap;
cbe54d63 566 int error;
2d3e977e
MD
567
568 ap.a_head.a_desc = &vop_poll_desc;
0961aa92 569 ap.a_head.a_ops = ops;
2d3e977e
MD
570 ap.a_vp = vp;
571 ap.a_events = events;
572 ap.a_cred = cred;
573 ap.a_td = td;
cbe54d63
MD
574
575 DO_OPS(ops, error, &ap, vop_poll);
576 return(error);
2d3e977e
MD
577}
578
579int
0961aa92 580vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn)
2d3e977e
MD
581{
582 struct vop_kqfilter_args ap;
cbe54d63 583 int error;
2d3e977e
MD
584
585 ap.a_head.a_desc = &vop_kqfilter_desc;
0961aa92 586 ap.a_head.a_ops = ops;
2d3e977e
MD
587 ap.a_vp = vp;
588 ap.a_kn = kn;
cbe54d63
MD
589
590 DO_OPS(ops, error, &ap, vop_kqfilter);
591 return(error);
2d3e977e
MD
592}
593
594int
0961aa92 595vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags)
2d3e977e
MD
596{
597 struct vop_revoke_args ap;
cbe54d63 598 int error;
2d3e977e
MD
599
600 ap.a_head.a_desc = &vop_revoke_desc;
0961aa92 601 ap.a_head.a_ops = ops;
2d3e977e
MD
602 ap.a_vp = vp;
603 ap.a_flags = flags;
cbe54d63
MD
604
605 DO_OPS(ops, error, &ap, vop_revoke);
606 return(error);
2d3e977e
MD
607}
608
609int
0961aa92
MD
610vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred,
611 struct thread *td)
2d3e977e
MD
612{
613 struct vop_mmap_args ap;
cbe54d63 614 int error;
2d3e977e
MD
615
616 ap.a_head.a_desc = &vop_mmap_desc;
0961aa92 617 ap.a_head.a_ops = ops;
2d3e977e
MD
618 ap.a_vp = vp;
619 ap.a_fflags = fflags;
620 ap.a_cred = cred;
621 ap.a_td = td;
cbe54d63
MD
622
623 DO_OPS(ops, error, &ap, vop_mmap);
624 return(error);
2d3e977e
MD
625}
626
627int
0961aa92 628vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, struct thread *td)
2d3e977e
MD
629{
630 struct vop_fsync_args ap;
cbe54d63 631 int error;
2d3e977e
MD
632
633 ap.a_head.a_desc = &vop_fsync_desc;
0961aa92 634 ap.a_head.a_ops = ops;
2d3e977e
MD
635 ap.a_vp = vp;
636 ap.a_waitfor = waitfor;
637 ap.a_td = td;
cbe54d63
MD
638
639 DO_OPS(ops, error, &ap, vop_fsync);
640 return(error);
2d3e977e
MD
641}
642
643int
0961aa92
MD
644vop_remove(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
645 struct vnode *vp, struct componentname *cnp)
2d3e977e
MD
646{
647 struct vop_remove_args ap;
cbe54d63 648 int error;
2d3e977e
MD
649
650 ap.a_head.a_desc = &vop_remove_desc;
0961aa92 651 ap.a_head.a_ops = ops;
2d3e977e
MD
652 ap.a_dvp = dvp;
653 ap.a_par = par;
654 ap.a_vp = vp;
655 ap.a_cnp = cnp;
cbe54d63
MD
656
657 DO_OPS(ops, error, &ap, vop_remove);
658 return(error);
2d3e977e
MD
659}
660
21739618
MD
661int
662vop_nremove(struct vop_ops *ops, struct namecache *ncp, struct ucred *cred)
663{
664 struct vop_nremove_args ap;
665 int error;
666
667 ap.a_head.a_desc = &vop_nremove_desc;
668 ap.a_head.a_ops = ops;
669 ap.a_ncp = ncp;
670 ap.a_cred = cred;
671
672 DO_OPS(ops, error, &ap, vop_nremove);
673 return(error);
674}
675
2d3e977e 676int
0961aa92
MD
677vop_link(struct vop_ops *ops, struct vnode *tdvp, struct namecache *par,
678 struct vnode *vp, struct componentname *cnp)
2d3e977e
MD
679{
680 struct vop_link_args ap;
cbe54d63 681 int error;
2d3e977e
MD
682
683 ap.a_head.a_desc = &vop_link_desc;
0961aa92 684 ap.a_head.a_ops = ops;
2d3e977e
MD
685 ap.a_tdvp = tdvp;
686 ap.a_par = par;
687 ap.a_vp = vp;
688 ap.a_cnp = cnp;
cbe54d63
MD
689
690 DO_OPS(ops, error, &ap, vop_link);
691 return(error);
2d3e977e
MD
692}
693
694int
0961aa92
MD
695vop_rename(struct vop_ops *ops, struct vnode *fdvp, struct namecache *fpar,
696 struct vnode *fvp, struct componentname *fcnp,
697 struct vnode *tdvp, struct namecache *tpar,
698 struct vnode *tvp, struct componentname *tcnp)
2d3e977e
MD
699{
700 struct vop_rename_args ap;
cbe54d63 701 int error;
2d3e977e
MD
702
703 ap.a_head.a_desc = &vop_rename_desc;
0961aa92 704 ap.a_head.a_ops = ops;
2d3e977e
MD
705 ap.a_fdvp = fdvp;
706 ap.a_fpar = fpar;
707 ap.a_fvp = fvp;
708 ap.a_fcnp = fcnp;
709 ap.a_tdvp = tdvp;
710 ap.a_tpar = tpar;
711 ap.a_tvp = tvp;
712 ap.a_tcnp = tcnp;
cbe54d63
MD
713
714 DO_OPS(ops, error, &ap, vop_rename);
715 return(error);
2d3e977e
MD
716}
717
718int
0961aa92
MD
719vop_mkdir(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
720 struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
2d3e977e
MD
721{
722 struct vop_mkdir_args ap;
cbe54d63 723 int error;
2d3e977e
MD
724
725 ap.a_head.a_desc = &vop_mkdir_desc;
0961aa92 726 ap.a_head.a_ops = ops;
2d3e977e
MD
727 ap.a_dvp = dvp;
728 ap.a_par = par;
729 ap.a_vpp = vpp;
730 ap.a_cnp = cnp;
731 ap.a_vap = vap;
cbe54d63
MD
732
733 DO_OPS(ops, error, &ap, vop_mkdir);
734 return(error);
2d3e977e
MD
735}
736
737int
0961aa92
MD
738vop_rmdir(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
739 struct vnode *vp, struct componentname *cnp)
2d3e977e
MD
740{
741 struct vop_rmdir_args ap;
cbe54d63 742 int error;
2d3e977e
MD
743
744 ap.a_head.a_desc = &vop_rmdir_desc;
0961aa92 745 ap.a_head.a_ops = ops;
2d3e977e
MD
746 ap.a_dvp = dvp;
747 ap.a_par = par;
748 ap.a_vp = vp;
749 ap.a_cnp = cnp;
cbe54d63
MD
750
751 DO_OPS(ops, error, &ap, vop_rmdir);
752 return(error);
2d3e977e
MD
753}
754
755int
0961aa92
MD
756vop_symlink(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
757 struct vnode **vpp, struct componentname *cnp,
758 struct vattr *vap, char *target)
2d3e977e
MD
759{
760 struct vop_symlink_args ap;
cbe54d63 761 int error;
2d3e977e
MD
762
763 ap.a_head.a_desc = &vop_symlink_desc;
0961aa92 764 ap.a_head.a_ops = ops;
2d3e977e
MD
765 ap.a_dvp = dvp;
766 ap.a_par = par;
767 ap.a_vpp = vpp;
768 ap.a_cnp = cnp;
769 ap.a_vap = vap;
770 ap.a_target = target;
cbe54d63
MD
771
772 DO_OPS(ops, error, &ap, vop_symlink);
773 return(error);
2d3e977e
MD
774}
775
776int
0961aa92
MD
777vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
778 struct ucred *cred, int *eofflag, int *ncookies, u_long **cookies)
2d3e977e
MD
779{
780 struct vop_readdir_args ap;
cbe54d63 781 int error;
2d3e977e
MD
782
783 ap.a_head.a_desc = &vop_readdir_desc;
0961aa92 784 ap.a_head.a_ops = ops;
2d3e977e
MD
785 ap.a_vp = vp;
786 ap.a_uio = uio;
787 ap.a_cred = cred;
788 ap.a_eofflag = eofflag;
789 ap.a_ncookies = ncookies;
790 ap.a_cookies = cookies;
cbe54d63
MD
791
792 DO_OPS(ops, error, &ap, vop_readdir);
793 return(error);
2d3e977e
MD
794}
795
796int
0961aa92
MD
797vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
798 struct ucred *cred)
2d3e977e
MD
799{
800 struct vop_readlink_args ap;
cbe54d63 801 int error;
2d3e977e
MD
802
803 ap.a_head.a_desc = &vop_readlink_desc;
0961aa92 804 ap.a_head.a_ops = ops;
2d3e977e
MD
805 ap.a_vp = vp;
806 ap.a_uio = uio;
807 ap.a_cred = cred;
cbe54d63
MD
808
809 DO_OPS(ops, error, &ap, vop_readlink);
810 return(error);
2d3e977e
MD
811}
812
813int
0961aa92 814vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td)
2d3e977e
MD
815{
816 struct vop_inactive_args ap;
cbe54d63 817 int error;
2d3e977e
MD
818
819 ap.a_head.a_desc = &vop_inactive_desc;
0961aa92 820 ap.a_head.a_ops = ops;
2d3e977e
MD
821 ap.a_vp = vp;
822 ap.a_td = td;
cbe54d63
MD
823
824 DO_OPS(ops, error, &ap, vop_inactive);
825 return(error);
2d3e977e
MD
826}
827
828int
0961aa92 829vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td)
2d3e977e
MD
830{
831 struct vop_reclaim_args ap;
cbe54d63 832 int error;
2d3e977e
MD
833
834 ap.a_head.a_desc = &vop_reclaim_desc;
0961aa92 835 ap.a_head.a_ops = ops;
2d3e977e
MD
836 ap.a_vp = vp;
837 ap.a_td = td;
cbe54d63
MD
838
839 DO_OPS(ops, error, &ap, vop_reclaim);
840 return(error);
2d3e977e
MD
841}
842
843int
5fd012e0 844vop_lock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td)
2d3e977e
MD
845{
846 struct vop_lock_args ap;
cbe54d63 847 int error;
2d3e977e
MD
848
849 ap.a_head.a_desc = &vop_lock_desc;
0961aa92 850 ap.a_head.a_ops = ops;
2d3e977e 851 ap.a_vp = vp;
2d3e977e
MD
852 ap.a_flags = flags;
853 ap.a_td = td;
cbe54d63
MD
854
855 DO_OPS(ops, error, &ap, vop_lock);
856 return(error);
2d3e977e
MD
857}
858
859int
5fd012e0 860vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td)
2d3e977e
MD
861{
862 struct vop_unlock_args ap;
cbe54d63 863 int error;
2d3e977e
MD
864
865 ap.a_head.a_desc = &vop_unlock_desc;
0961aa92 866 ap.a_head.a_ops = ops;
2d3e977e 867 ap.a_vp = vp;
2d3e977e
MD
868 ap.a_flags = flags;
869 ap.a_td = td;
cbe54d63
MD
870
871 DO_OPS(ops, error, &ap, vop_unlock);
872 return(error);
2d3e977e
MD
873}
874
875int
0961aa92
MD
876vop_bmap(struct vop_ops *ops, struct vnode *vp, daddr_t bn, struct vnode **vpp,
877 daddr_t *bnp, int *runp, int *runb)
2d3e977e
MD
878{
879 struct vop_bmap_args ap;
cbe54d63 880 int error;
2d3e977e
MD
881
882 ap.a_head.a_desc = &vop_bmap_desc;
0961aa92 883 ap.a_head.a_ops = ops;
2d3e977e
MD
884 ap.a_vp = vp;
885 ap.a_bn = bn;
886 ap.a_vpp = vpp;
887 ap.a_bnp = bnp;
888 ap.a_runp = runp;
889 ap.a_runb = runb;
cbe54d63
MD
890
891 DO_OPS(ops, error, &ap, vop_bmap);
892 return(error);
2d3e977e
MD
893}
894
895int
0961aa92 896vop_strategy(struct vop_ops *ops, struct vnode *vp, struct buf *bp)
2d3e977e
MD
897{
898 struct vop_strategy_args ap;
cbe54d63 899 int error;
2d3e977e
MD
900
901 ap.a_head.a_desc = &vop_strategy_desc;
0961aa92 902 ap.a_head.a_ops = ops;
2d3e977e
MD
903 ap.a_vp = vp;
904 ap.a_bp = bp;
cbe54d63
MD
905
906 DO_OPS(ops, error, &ap, vop_strategy);
907 return(error);
2d3e977e
MD
908}
909
910int
0961aa92 911vop_print(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
912{
913 struct vop_print_args ap;
cbe54d63 914 int error;
2d3e977e
MD
915
916 ap.a_head.a_desc = &vop_print_desc;
0961aa92 917 ap.a_head.a_ops = ops;
2d3e977e 918 ap.a_vp = vp;
cbe54d63
MD
919
920 DO_OPS(ops, error, &ap, vop_print);
921 return(error);
2d3e977e
MD
922}
923
924int
0961aa92
MD
925vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
926 register_t *retval)
2d3e977e
MD
927{
928 struct vop_pathconf_args ap;
cbe54d63 929 int error;
2d3e977e
MD
930
931 ap.a_head.a_desc = &vop_pathconf_desc;
0961aa92 932 ap.a_head.a_ops = ops;
2d3e977e
MD
933 ap.a_vp = vp;
934 ap.a_name = name;
935 ap.a_retval = retval;
cbe54d63
MD
936
937 DO_OPS(ops, error, &ap, vop_pathconf);
938 return(error);
2d3e977e
MD
939}
940
941int
0961aa92
MD
942vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
943 struct flock *fl, int flags)
2d3e977e
MD
944{
945 struct vop_advlock_args ap;
cbe54d63 946 int error;
2d3e977e
MD
947
948 ap.a_head.a_desc = &vop_advlock_desc;
0961aa92 949 ap.a_head.a_ops = ops;
2d3e977e
MD
950 ap.a_vp = vp;
951 ap.a_id = id;
952 ap.a_op = op;
953 ap.a_fl = fl;
954 ap.a_flags = flags;
cbe54d63
MD
955
956 DO_OPS(ops, error, &ap, vop_advlock);
957 return(error);
2d3e977e
MD
958}
959
960int
0961aa92
MD
961vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
962 int size, struct ucred *cred, int flags,
963 struct buf **bpp)
2d3e977e
MD
964{
965 struct vop_balloc_args ap;
cbe54d63 966 int error;
2d3e977e
MD
967
968 ap.a_head.a_desc = &vop_balloc_desc;
0961aa92 969 ap.a_head.a_ops = ops;
2d3e977e
MD
970 ap.a_vp = vp;
971 ap.a_startoffset = startoffset;
972 ap.a_size = size;
973 ap.a_cred = cred;
974 ap.a_flags = flags;
975 ap.a_bpp = bpp;
cbe54d63
MD
976
977 DO_OPS(ops, error, &ap, vop_balloc);
978 return(error);
2d3e977e
MD
979}
980
981int
0961aa92
MD
982vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
983 struct cluster_save *buflist)
2d3e977e
MD
984{
985 struct vop_reallocblks_args ap;
cbe54d63 986 int error;
2d3e977e
MD
987
988 ap.a_head.a_desc = &vop_reallocblks_desc;
0961aa92 989 ap.a_head.a_ops = ops;
2d3e977e
MD
990 ap.a_vp = vp;
991 ap.a_buflist = buflist;
cbe54d63
MD
992
993 DO_OPS(ops, error, &ap, vop_reallocblks);
994 return(error);
2d3e977e
MD
995}
996
997int
0961aa92
MD
998vop_getpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
999 int reqpage, vm_ooffset_t offset)
2d3e977e
MD
1000{
1001 struct vop_getpages_args ap;
cbe54d63 1002 int error;
2d3e977e
MD
1003
1004 ap.a_head.a_desc = &vop_getpages_desc;
0961aa92 1005 ap.a_head.a_ops = ops;
2d3e977e
MD
1006 ap.a_vp = vp;
1007 ap.a_m = m;
1008 ap.a_count = count;
1009 ap.a_reqpage = reqpage;
1010 ap.a_offset = offset;
cbe54d63
MD
1011
1012 DO_OPS(ops, error, &ap, vop_getpages);
1013 return(error);
2d3e977e
MD
1014}
1015
1016int
0961aa92
MD
1017vop_putpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
1018 int sync, int *rtvals, vm_ooffset_t offset)
2d3e977e
MD
1019{
1020 struct vop_putpages_args ap;
cbe54d63 1021 int error;
2d3e977e
MD
1022
1023 ap.a_head.a_desc = &vop_putpages_desc;
0961aa92 1024 ap.a_head.a_ops = ops;
2d3e977e
MD
1025 ap.a_vp = vp;
1026 ap.a_m = m;
1027 ap.a_count = count;
1028 ap.a_sync = sync;
1029 ap.a_rtvals = rtvals;
1030 ap.a_offset = offset;
cbe54d63
MD
1031
1032 DO_OPS(ops, error, &ap, vop_putpages);
1033 return(error);
2d3e977e
MD
1034}
1035
1036int
0961aa92
MD
1037vop_freeblks(struct vop_ops *ops, struct vnode *vp,
1038 daddr_t addr, daddr_t length)
2d3e977e
MD
1039{
1040 struct vop_freeblks_args ap;
cbe54d63 1041 int error;
2d3e977e
MD
1042
1043 ap.a_head.a_desc = &vop_freeblks_desc;
0961aa92 1044 ap.a_head.a_ops = ops;
2d3e977e
MD
1045 ap.a_vp = vp;
1046 ap.a_addr = addr;
1047 ap.a_length = length;
cbe54d63
MD
1048
1049 DO_OPS(ops, error, &ap, vop_freeblks);
1050 return(error);
2d3e977e
MD
1051}
1052
1053int
0961aa92 1054vop_bwrite(struct vop_ops *ops, struct vnode *vp, struct buf *bp)
2d3e977e
MD
1055{
1056 struct vop_bwrite_args ap;
cbe54d63 1057 int error;
2d3e977e
MD
1058
1059 ap.a_head.a_desc = &vop_bwrite_desc;
0961aa92 1060 ap.a_head.a_ops = ops;
2d3e977e
MD
1061 ap.a_vp = vp;
1062 ap.a_bp = bp;
cbe54d63
MD
1063
1064 DO_OPS(ops, error, &ap, vop_bwrite);
1065 return(error);
2d3e977e
MD
1066}
1067
1068int
0961aa92
MD
1069vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
1070 struct acl *aclp, struct ucred *cred, struct thread *td)
2d3e977e
MD
1071{
1072 struct vop_getacl_args ap;
cbe54d63 1073 int error;
2d3e977e
MD
1074
1075 ap.a_head.a_desc = &vop_getacl_desc;
0961aa92 1076 ap.a_head.a_ops = ops;
2d3e977e
MD
1077 ap.a_vp = vp;
1078 ap.a_type = type;
1079 ap.a_aclp = aclp;
1080 ap.a_cred = cred;
1081 ap.a_td = td;
cbe54d63
MD
1082
1083 DO_OPS(ops, error, &ap, vop_getacl);
1084 return(error);
2d3e977e
MD
1085}
1086
1087int
0961aa92
MD
1088vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
1089 struct acl *aclp, struct ucred *cred, struct thread *td)
2d3e977e
MD
1090{
1091 struct vop_setacl_args ap;
cbe54d63 1092 int error;
2d3e977e
MD
1093
1094 ap.a_head.a_desc = &vop_setacl_desc;
0961aa92 1095 ap.a_head.a_ops = ops;
2d3e977e
MD
1096 ap.a_vp = vp;
1097 ap.a_type = type;
1098 ap.a_aclp = aclp;
1099 ap.a_cred = cred;
1100 ap.a_td = td;
cbe54d63
MD
1101
1102 DO_OPS(ops, error, &ap, vop_setacl);
1103 return(error);
2d3e977e
MD
1104}
1105
1106int
0961aa92
MD
1107vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
1108 struct acl *aclp, struct ucred *cred, struct thread *td)
2d3e977e
MD
1109{
1110 struct vop_aclcheck_args ap;
cbe54d63 1111 int error;
2d3e977e
MD
1112
1113 ap.a_head.a_desc = &vop_aclcheck_desc;
0961aa92 1114 ap.a_head.a_ops = ops;
2d3e977e
MD
1115 ap.a_vp = vp;
1116 ap.a_type = type;
1117 ap.a_aclp = aclp;
1118 ap.a_cred = cred;
1119 ap.a_td = td;
cbe54d63
MD
1120
1121 DO_OPS(ops, error, &ap, vop_aclcheck);
1122 return(error);
2d3e977e
MD
1123}
1124
1125int
0961aa92
MD
1126vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
1127 struct uio *uio, struct ucred *cred, struct thread *td)
2d3e977e
MD
1128{
1129 struct vop_getextattr_args ap;
cbe54d63 1130 int error;
2d3e977e
MD
1131
1132 ap.a_head.a_desc = &vop_getextattr_desc;
0961aa92 1133 ap.a_head.a_ops = ops;
2d3e977e
MD
1134 ap.a_vp = vp;
1135 ap.a_name = name;
1136 ap.a_uio = uio;
1137 ap.a_cred = cred;
1138 ap.a_td = td;
cbe54d63
MD
1139
1140 DO_OPS(ops, error, &ap, vop_getextattr);
1141 return(error);
2d3e977e
MD
1142}
1143
1144int
0961aa92
MD
1145vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
1146 struct uio *uio, struct ucred *cred, struct thread *td)
2d3e977e
MD
1147{
1148 struct vop_setextattr_args ap;
cbe54d63 1149 int error;
2d3e977e
MD
1150
1151 ap.a_head.a_desc = &vop_setextattr_desc;
0961aa92 1152 ap.a_head.a_ops = ops;
2d3e977e
MD
1153 ap.a_vp = vp;
1154 ap.a_name = name;
1155 ap.a_uio = uio;
1156 ap.a_cred = cred;
1157 ap.a_td = td;
cbe54d63
MD
1158
1159 DO_OPS(ops, error, &ap, vop_setextattr);
1160 return(error);
2d3e977e
MD
1161}
1162
1163int
0961aa92 1164vop_createvobject(struct vop_ops *ops, struct vnode *vp, struct thread *td)
2d3e977e
MD
1165{
1166 struct vop_createvobject_args ap;
cbe54d63 1167 int error;
2d3e977e
MD
1168
1169 ap.a_head.a_desc = &vop_createvobject_desc;
0961aa92 1170 ap.a_head.a_ops = ops;
2d3e977e
MD
1171 ap.a_vp = vp;
1172 ap.a_td = td;
cbe54d63
MD
1173
1174 DO_OPS(ops, error, &ap, vop_createvobject);
1175 return(error);
2d3e977e
MD
1176}
1177
1178int
0961aa92 1179vop_destroyvobject(struct vop_ops *ops, struct vnode *vp)
2d3e977e
MD
1180{
1181 struct vop_destroyvobject_args ap;
cbe54d63 1182 int error;
2d3e977e
MD
1183
1184 ap.a_head.a_desc = &vop_destroyvobject_desc;
0961aa92 1185 ap.a_head.a_ops = ops;
2d3e977e 1186 ap.a_vp = vp;
cbe54d63
MD
1187
1188 DO_OPS(ops, error, &ap, vop_destroyvobject);
1189 return(error);
2d3e977e
MD
1190}
1191
1192int
0961aa92 1193vop_getvobject(struct vop_ops *ops, struct vnode *vp, struct vm_object **objpp)
2d3e977e
MD
1194{
1195 struct vop_getvobject_args ap;
cbe54d63 1196 int error;
2d3e977e
MD
1197
1198 ap.a_head.a_desc = &vop_getvobject_desc;
0961aa92 1199 ap.a_head.a_ops = ops;
2d3e977e
MD
1200 ap.a_vp = vp;
1201 ap.a_objpp = objpp;
cbe54d63
MD
1202
1203 DO_OPS(ops, error, &ap, vop_getvobject);
1204 return(error);
1205}
1206
1207int
1208vop_vfsset(struct vop_ops *ops, int op, const char *opstr)
1209{
1210 struct vop_vfsset_args ap;
1211 int error;
1212
1213 ap.a_head.a_desc = &vop_vfsset_desc;
1214 ap.a_head.a_ops = ops;
1215 ap.a_op = op;
1216 ap.a_opstr = opstr;
1217
1218 DO_OPS(ops, error, &ap, vop_vfsset);
1219 return(error);
0961aa92
MD
1220}
1221
1222/************************************************************************
1223 * PRIMARY VNODE OPERATIONS FORWARDING CALLS *
1224 ************************************************************************
1225 *
1226 * These procedures are called from VFSs such as unionfs and nullfs
1227 * when they wish to forward an operation on one VFS to another. The
1228 * argument structure/message is modified and then directly passed to the
1229 * appropriate routine. This routines may also be called by initiators
1230 * who have an argument structure in hand rather then discreet arguments.
1231 */
1232int
1233vop_vnoperate_ap(struct vop_generic_args *ap)
1234{
cbe54d63
MD
1235 struct vop_ops *ops;
1236 int error;
1237
1238 ops = ap->a_ops;
1239 if (ops->vv_flags & VVF_HOOK_MASK) {
1240 if (ops->vv_flags & VVF_JOURNAL_HOOK)
1241 error = VOCALL(ops->vv_jops, ap);
1242 else
1243 error = 0;
1244 if (error == 0)
1245 error = VOCALL(ops, ap);
1246 } else {
1247 error = VOCALL(ops, ap);
1248 }
1249 return (error);
0961aa92
MD
1250}
1251
1252int
1253vop_islocked_ap(struct vop_islocked_args *ap)
1254{
cbe54d63
MD
1255 int error;
1256
1257 DO_OPS(ap->a_head.a_ops, error, ap, vop_islocked);
1258 return(error);
0961aa92
MD
1259}
1260
690a3127
MD
1261int
1262vop_resolve_ap(struct vop_resolve_args *ap)
1263{
1264 int error;
1265
1266 DO_OPS(ap->a_head.a_ops, error, ap, vop_resolve);
1267 return(error);
1268}
1269
1270
0961aa92
MD
1271int
1272vop_lookup_ap(struct vop_lookup_args *ap)
1273{
cbe54d63
MD
1274 int error;
1275
1276 DO_OPS(ap->a_head.a_ops, error, ap, vop_lookup);
1277 return(error);
0961aa92
MD
1278}
1279
1280int
1281vop_cachedlookup_ap(struct vop_cachedlookup_args *ap)
1282{
cbe54d63
MD
1283 int error;
1284
1285 DO_OPS(ap->a_head.a_ops, error, ap, vop_cachedlookup);
1286 return(error);
0961aa92
MD
1287}
1288
1289int
1290vop_create_ap(struct vop_create_args *ap)
1291{
cbe54d63
MD
1292 int error;
1293
1294 DO_OPS(ap->a_head.a_ops, error, ap, vop_create);
1295 return(error);
0961aa92
MD
1296}
1297
1298int
1299vop_whiteout_ap(struct vop_whiteout_args *ap)
1300{
cbe54d63
MD
1301 int error;
1302
1303 DO_OPS(ap->a_head.a_ops, error, ap, vop_whiteout);
1304 return(error);
0961aa92
MD
1305}
1306
1307int
1308vop_mknod_ap(struct vop_mknod_args *ap)
1309{
cbe54d63
MD
1310 int error;
1311
1312 DO_OPS(ap->a_head.a_ops, error, ap, vop_mknod);
1313 return(error);
0961aa92
MD
1314}
1315
1316int
1317vop_open_ap(struct vop_open_args *ap)
1318{
cbe54d63
MD
1319 int error;
1320
1321 DO_OPS(ap->a_head.a_ops, error, ap, vop_open);
1322 return(error);
0961aa92
MD
1323}
1324
1325int
1326vop_close_ap(struct vop_close_args *ap)
1327{
cbe54d63
MD
1328 int error;
1329
1330 DO_OPS(ap->a_head.a_ops, error, ap, vop_close);
1331 return(error);
0961aa92
MD
1332}
1333
1334int
1335vop_access_ap(struct vop_access_args *ap)
1336{
cbe54d63
MD
1337 int error;
1338
1339 DO_OPS(ap->a_head.a_ops, error, ap, vop_access);
1340 return(error);
0961aa92
MD
1341}
1342
1343int
1344vop_getattr_ap(struct vop_getattr_args *ap)
1345{
cbe54d63
MD
1346 int error;
1347
1348 DO_OPS(ap->a_head.a_ops, error, ap, vop_getattr);
1349 return(error);
0961aa92
MD
1350}
1351
1352int
1353vop_setattr_ap(struct vop_setattr_args *ap)
1354{
cbe54d63
MD
1355 int error;
1356
1357 DO_OPS(ap->a_head.a_ops, error, ap, vop_setattr);
1358 return(error);
0961aa92
MD
1359}
1360
1361int
1362vop_read_ap(struct vop_read_args *ap)
1363{
cbe54d63
MD
1364 int error;
1365
1366 DO_OPS(ap->a_head.a_ops, error, ap, vop_read);
1367 return(error);
0961aa92
MD
1368}
1369
1370int
1371vop_write_ap(struct vop_write_args *ap)
1372{
cbe54d63
MD
1373 int error;
1374
1375 DO_OPS(ap->a_head.a_ops, error, ap, vop_write);
1376 return(error);
0961aa92
MD
1377}
1378
1379int
1380vop_lease_ap(struct vop_lease_args *ap)
1381{
cbe54d63
MD
1382 int error;
1383
1384 DO_OPS(ap->a_head.a_ops, error, ap, vop_lease);
1385 return(error);
0961aa92
MD
1386}
1387
1388int
1389vop_ioctl_ap(struct vop_ioctl_args *ap)
1390{
cbe54d63
MD
1391 int error;
1392
1393 DO_OPS(ap->a_head.a_ops, error, ap, vop_ioctl);
1394 return(error);
0961aa92
MD
1395}
1396
1397int
1398vop_poll_ap(struct vop_poll_args *ap)
1399{
cbe54d63
MD
1400 int error;
1401
1402 DO_OPS(ap->a_head.a_ops, error, ap, vop_poll);
1403 return(error);
0961aa92
MD
1404}
1405
1406int
1407vop_kqfilter_ap(struct vop_kqfilter_args *ap)
1408{
cbe54d63
MD
1409 int error;
1410
1411 DO_OPS(ap->a_head.a_ops, error, ap, vop_kqfilter);
1412 return(error);
0961aa92
MD
1413}
1414
1415int
1416vop_revoke_ap(struct vop_revoke_args *ap)
1417{
cbe54d63
MD
1418 int error;
1419
1420 DO_OPS(ap->a_head.a_ops, error, ap, vop_revoke);
1421 return(error);
0961aa92
MD
1422}
1423
1424int
1425vop_mmap_ap(struct vop_mmap_args *ap)
1426{
cbe54d63
MD
1427 int error;
1428
1429 DO_OPS(ap->a_head.a_ops, error, ap, vop_mmap);
1430 return(error);
0961aa92
MD
1431}
1432
1433int
1434vop_fsync_ap(struct vop_fsync_args *ap)
1435{
cbe54d63
MD
1436 int error;
1437
1438 DO_OPS(ap->a_head.a_ops, error, ap, vop_fsync);
1439 return(error);
0961aa92
MD
1440}
1441
1442int
1443vop_remove_ap(struct vop_remove_args *ap)
1444{
cbe54d63
MD
1445 int error;
1446
1447 DO_OPS(ap->a_head.a_ops, error, ap, vop_remove);
1448 return(error);
0961aa92
MD
1449}
1450
21739618
MD
1451int
1452vop_nremove_ap(struct vop_nremove_args *ap)
1453{
1454 int error;
1455
1456 DO_OPS(ap->a_head.a_ops, error, ap, vop_nremove);
1457 return(error);
1458}
1459
0961aa92
MD
1460int
1461vop_link_ap(struct vop_link_args *ap)
1462{
cbe54d63
MD
1463 int error;
1464
1465 DO_OPS(ap->a_head.a_ops, error, ap, vop_link);
1466 return(error);
0961aa92
MD
1467}
1468
1469int
1470vop_rename_ap(struct vop_rename_args *ap)
1471{
cbe54d63
MD
1472 int error;
1473
1474 DO_OPS(ap->a_head.a_ops, error, ap, vop_rename);
1475 return(error);
0961aa92
MD
1476}
1477
1478int
1479vop_mkdir_ap(struct vop_mkdir_args *ap)
1480{
cbe54d63
MD
1481 int error;
1482
1483 DO_OPS(ap->a_head.a_ops, error, ap, vop_mkdir);
1484 return(error);
0961aa92
MD
1485}
1486
1487int
1488vop_rmdir_ap(struct vop_rmdir_args *ap)
1489{
cbe54d63
MD
1490 int error;
1491
1492 DO_OPS(ap->a_head.a_ops, error, ap, vop_rmdir);
1493 return(error);
0961aa92
MD
1494}
1495
1496int
1497vop_symlink_ap(struct vop_symlink_args *ap)
1498{
cbe54d63
MD
1499 int error;
1500
1501 DO_OPS(ap->a_head.a_ops, error, ap, vop_symlink);
1502 return(error);
0961aa92
MD
1503}
1504
1505int
1506vop_readdir_ap(struct vop_readdir_args *ap)
1507{
cbe54d63
MD
1508 int error;
1509
1510 DO_OPS(ap->a_head.a_ops, error, ap, vop_readdir);
1511 return(error);
0961aa92
MD
1512}
1513
1514int
1515vop_readlink_ap(struct vop_readlink_args *ap)
1516{
cbe54d63
MD
1517 int error;
1518
1519 DO_OPS(ap->a_head.a_ops, error, ap, vop_readlink);
1520 return(error);
0961aa92
MD
1521}
1522
1523int
1524vop_inactive_ap(struct vop_inactive_args *ap)
1525{
cbe54d63
MD
1526 int error;
1527
1528 DO_OPS(ap->a_head.a_ops, error, ap, vop_inactive);
1529 return(error);
0961aa92
MD
1530}
1531
1532int
1533vop_reclaim_ap(struct vop_reclaim_args *ap)
1534{
cbe54d63
MD
1535 int error;
1536
1537 DO_OPS(ap->a_head.a_ops, error, ap, vop_reclaim);
1538 return(error);
0961aa92
MD
1539}
1540
1541int
1542vop_lock_ap(struct vop_lock_args *ap)
1543{
cbe54d63
MD
1544 int error;
1545
1546 DO_OPS(ap->a_head.a_ops, error, ap, vop_lock);
1547 return(error);
0961aa92
MD
1548}
1549
1550int
1551vop_unlock_ap(struct vop_unlock_args *ap)
1552{
cbe54d63
MD
1553 int error;
1554
1555 DO_OPS(ap->a_head.a_ops, error, ap, vop_unlock);
1556 return(error);
0961aa92
MD
1557}
1558
1559int
1560vop_bmap_ap(struct vop_bmap_args *ap)
1561{
cbe54d63
MD
1562 int error;
1563
1564 DO_OPS(ap->a_head.a_ops, error, ap, vop_bmap);
1565 return(error);
0961aa92
MD
1566}
1567
1568int
1569vop_strategy_ap(struct vop_strategy_args *ap)
1570{
cbe54d63
MD
1571 int error;
1572
1573 DO_OPS(ap->a_head.a_ops, error, ap, vop_strategy);
1574 return(error);
0961aa92
MD
1575}
1576
1577int
1578vop_print_ap(struct vop_print_args *ap)
1579{
cbe54d63
MD
1580 int error;
1581
1582 DO_OPS(ap->a_head.a_ops, error, ap, vop_print);
1583 return(error);
0961aa92
MD
1584}
1585
1586int
1587vop_pathconf_ap(struct vop_pathconf_args *ap)
1588{
cbe54d63
MD
1589 int error;
1590
1591 DO_OPS(ap->a_head.a_ops, error, ap, vop_pathconf);
1592 return(error);
0961aa92
MD
1593}
1594
1595int
1596vop_advlock_ap(struct vop_advlock_args *ap)
1597{
cbe54d63
MD
1598 int error;
1599
1600 DO_OPS(ap->a_head.a_ops, error, ap, vop_advlock);
1601 return(error);
0961aa92
MD
1602}
1603
1604int
1605vop_balloc_ap(struct vop_balloc_args *ap)
1606{
cbe54d63
MD
1607 int error;
1608
1609 DO_OPS(ap->a_head.a_ops, error, ap, vop_balloc);
1610 return(error);
0961aa92
MD
1611}
1612
1613int
1614vop_reallocblks_ap(struct vop_reallocblks_args *ap)
1615{
cbe54d63
MD
1616 int error;
1617
1618 DO_OPS(ap->a_head.a_ops, error, ap, vop_reallocblks);
1619 return(error);
0961aa92
MD
1620}
1621
1622int
1623vop_getpages_ap(struct vop_getpages_args *ap)
1624{
cbe54d63
MD
1625 int error;
1626
1627 DO_OPS(ap->a_head.a_ops, error, ap, vop_getpages);
1628 return(error);
0961aa92
MD
1629}
1630
1631int
1632vop_putpages_ap(struct vop_putpages_args *ap)
1633{
cbe54d63
MD
1634 int error;
1635
1636 DO_OPS(ap->a_head.a_ops, error, ap, vop_putpages);
1637 return(error);
0961aa92
MD
1638}
1639
1640int
1641vop_freeblks_ap(struct vop_freeblks_args *ap)
1642{
cbe54d63
MD
1643 int error;
1644
1645 DO_OPS(ap->a_head.a_ops, error, ap, vop_freeblks);
1646 return(error);
0961aa92
MD
1647}
1648
1649int
1650vop_bwrite_ap(struct vop_bwrite_args *ap)
1651{
cbe54d63
MD
1652 int error;
1653
1654 DO_OPS(ap->a_head.a_ops, error, ap, vop_bwrite);
1655 return(error);
0961aa92
MD
1656}
1657
1658int
1659vop_getacl_ap(struct vop_getacl_args *ap)
1660{
cbe54d63
MD
1661 int error;
1662
1663 DO_OPS(ap->a_head.a_ops, error, ap, vop_getacl);
1664 return(error);
0961aa92
MD
1665}
1666
1667int
1668vop_setacl_ap(struct vop_setacl_args *ap)
1669{
cbe54d63
MD
1670 int error;
1671
1672 DO_OPS(ap->a_head.a_ops, error, ap, vop_setacl);
1673 return(error);
0961aa92
MD
1674}
1675
1676int
1677vop_aclcheck_ap(struct vop_aclcheck_args *ap)
1678{
cbe54d63
MD
1679 int error;
1680
1681 DO_OPS(ap->a_head.a_ops, error, ap, vop_aclcheck);
1682 return(error);
0961aa92
MD
1683}
1684
1685int
1686vop_getextattr_ap(struct vop_getextattr_args *ap)
1687{
cbe54d63
MD
1688 int error;
1689
1690 DO_OPS(ap->a_head.a_ops, error, ap, vop_getextattr);
1691 return(error);
0961aa92
MD
1692}
1693
1694int
1695vop_setextattr_ap(struct vop_setextattr_args *ap)
1696{
cbe54d63
MD
1697 int error;
1698
1699 DO_OPS(ap->a_head.a_ops, error, ap, vop_setextattr);
1700 return(error);
0961aa92
MD
1701}
1702
1703int
1704vop_createvobject_ap(struct vop_createvobject_args *ap)
1705{
cbe54d63
MD
1706 int error;
1707
1708 DO_OPS(ap->a_head.a_ops, error, ap, vop_createvobject);
1709 return(error);
0961aa92
MD
1710}
1711
1712int
1713vop_destroyvobject_ap(struct vop_destroyvobject_args *ap)
1714{
cbe54d63
MD
1715 int error;
1716
1717 DO_OPS(ap->a_head.a_ops, error, ap, vop_destroyvobject);
1718 return(error);
0961aa92
MD
1719}
1720
1721int
1722vop_getvobject_ap(struct vop_getvobject_args *ap)
1723{
cbe54d63
MD
1724 int error;
1725
1726 DO_OPS(ap->a_head.a_ops, error, ap, vop_getvobject);
1727 return(error);
1728}
1729
1730int
1731vop_vfsset_ap(struct vop_vfsset_args *ap)
1732{
1733 int error;
1734
1735 DO_OPS(ap->a_head.a_ops, error, ap, vop_vfsset);
1736 return(error);
2d3e977e
MD
1737}
1738