VFS messaging/interfacing work stage 1/99. This stage replaces the old
[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 *
35 * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.1 2004/08/13 17:51:09 dillon Exp $
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>
60#include <sys/vopops.h>
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
124#define VNODEOP_DESC_INIT_DVP_VPP_CNP(name) \
125 static int VOFFNAME(name)[] = { \
126 __offsetof(VARGSSTRUCT(name), a_dvp), \
127 VDESC_NO_OFFSET }; \
128 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
129 __offsetof(VARGSSTRUCT(name), a_vpp), \
130 VDESC_NO_OFFSET, \
131 VDESC_NO_OFFSET, \
132 __offsetof(VARGSSTRUCT(name), a_cnp))
133
134#define VNODEOP_DESC_INIT_DVP_CNP(name) \
135 static int VOFFNAME(name)[] = { \
136 __offsetof(VARGSSTRUCT(name), a_dvp), \
137 VDESC_NO_OFFSET }; \
138 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
139 VDESC_NO_OFFSET, \
140 VDESC_NO_OFFSET, \
141 VDESC_NO_OFFSET, \
142 __offsetof(VARGSSTRUCT(name), a_cnp))
143
144#define VNODEOP_DESC_INIT_DVP_VP_CNP(name) \
145 static int VOFFNAME(name)[] = { \
146 __offsetof(VARGSSTRUCT(name), a_dvp), \
147 __offsetof(VARGSSTRUCT(name), a_vp), \
148 VDESC_NO_OFFSET }; \
149 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
150 VDESC_NO_OFFSET, \
151 VDESC_NO_OFFSET, \
152 VDESC_NO_OFFSET, \
153 __offsetof(VARGSSTRUCT(name), a_cnp))
154
155#define VNODEOP_DESC_INIT_TDVP_VP_CNP(name) \
156 static int VOFFNAME(name)[] = { \
157 __offsetof(VARGSSTRUCT(name), a_tdvp), \
158 __offsetof(VARGSSTRUCT(name), a_vp), \
159 VDESC_NO_OFFSET }; \
160 VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \
161 VDESC_NO_OFFSET, \
162 VDESC_NO_OFFSET, \
163 VDESC_NO_OFFSET, \
164 __offsetof(VARGSSTRUCT(name), a_cnp))
165
166VNODEOP_DESC_INIT_SIMPLE(default);
167VNODEOP_DESC_INIT_VP(islocked);
168VNODEOP_DESC_INIT_DVP_VPP_CNP(lookup);
169VNODEOP_DESC_INIT_DVP_VPP_CNP(cachedlookup);
170VNODEOP_DESC_INIT_DVP_VPP_CNP(create);
171VNODEOP_DESC_INIT_DVP_CNP(whiteout);
172VNODEOP_DESC_INIT_DVP_VPP_CNP(mknod);
173VNODEOP_DESC_INIT_VP_CRED(open);
174VNODEOP_DESC_INIT_VP(close);
175VNODEOP_DESC_INIT_VP_CRED(access);
176VNODEOP_DESC_INIT_VP(getattr);
177VNODEOP_DESC_INIT_VP_CRED(setattr);
178VNODEOP_DESC_INIT_VP_CRED(read);
179VNODEOP_DESC_INIT_VP_CRED(write);
180VNODEOP_DESC_INIT_VP_CRED(lease);
181VNODEOP_DESC_INIT_VP_CRED(ioctl);
182VNODEOP_DESC_INIT_VP_CRED(poll);
183VNODEOP_DESC_INIT_VP(kqfilter);
184VNODEOP_DESC_INIT_VP(revoke);
185VNODEOP_DESC_INIT_VP_CRED(mmap);
186VNODEOP_DESC_INIT_VP(fsync);
187VNODEOP_DESC_INIT_DVP_VP_CNP(remove);
188VNODEOP_DESC_INIT_TDVP_VP_CNP(link);
189
190static int VOFFNAME(rename)[] = {
191 __offsetof(VARGSSTRUCT(rename), a_fdvp),
192 __offsetof(VARGSSTRUCT(rename), a_fvp),
193 __offsetof(VARGSSTRUCT(rename), a_tdvp),
194 __offsetof(VARGSSTRUCT(rename), a_tvp),
195 VDESC_NO_OFFSET
196};
197VNODEOP_DESC_INIT(rename,
198 VDESC_VP0_WILLRELE|VDESC_VP1_WILLRELE|
199 VDESC_VP2_WILLRELE|VDESC_VP3_WILLRELE,
200 VOFFNAME(rename),
201 VDESC_NO_OFFSET,
202 VDESC_NO_OFFSET,
203 VDESC_NO_OFFSET,
204 __offsetof(VARGSSTRUCT(rename), a_fcnp));
205VNODEOP_DESC_INIT_DVP_VPP_CNP(mkdir);
206VNODEOP_DESC_INIT_DVP_VP_CNP(rmdir);
207VNODEOP_DESC_INIT_DVP_VPP_CNP(symlink);
208VNODEOP_DESC_INIT_VP_CRED(readdir);
209VNODEOP_DESC_INIT_VP_CRED(readlink);
210VNODEOP_DESC_INIT_VP(inactive);
211VNODEOP_DESC_INIT_VP(reclaim);
212VNODEOP_DESC_INIT_VP(lock);
213VNODEOP_DESC_INIT_VP(unlock);
214VNODEOP_DESC_INIT_VP_VPP(bmap);
215VNODEOP_DESC_INIT_VP(strategy);
216VNODEOP_DESC_INIT_VP(print);
217VNODEOP_DESC_INIT_VP(pathconf);
218VNODEOP_DESC_INIT_VP(advlock);
219VNODEOP_DESC_INIT_VP_CRED(balloc);
220VNODEOP_DESC_INIT_VP(reallocblks);
221VNODEOP_DESC_INIT_VP(getpages);
222VNODEOP_DESC_INIT_VP(putpages);
223VNODEOP_DESC_INIT_VP(freeblks);
224VNODEOP_DESC_INIT_VP(bwrite);
225VNODEOP_DESC_INIT_VP_CRED(getacl);
226VNODEOP_DESC_INIT_VP_CRED(setacl);
227VNODEOP_DESC_INIT_VP_CRED(aclcheck);
228VNODEOP_DESC_INIT_VP_CRED(getextattr);
229VNODEOP_DESC_INIT_VP_CRED(setextattr);
230VNODEOP_DESC_INIT_VP(createvobject);
231VNODEOP_DESC_INIT_VP(destroyvobject);
232VNODEOP_DESC_INIT_VP(getvobject);
233
234int
235vop_islocked(struct vnode *vp, struct thread *td)
236{
237 struct vop_islocked_args ap;
238
239 ap.a_head.a_desc = &vop_islocked_desc;
240 ap.a_vp = vp;
241 ap.a_td = td;
242 return(vp->v_vops->vop_islocked(&ap));
243}
244
245int
246vop_lookup(struct vnode *dvp, struct namecache *par,
247 struct vnode **vpp, struct namecache **ncpp,
248 struct componentname *cnp)
249{
250 struct vop_lookup_args ap;
251
252 ap.a_head.a_desc = &vop_lookup_desc;
253 ap.a_dvp = dvp;
254 ap.a_par = par;
255 ap.a_vpp = vpp;
256 ap.a_ncpp = ncpp;
257 ap.a_cnp = cnp;
258 return(dvp->v_vops->vop_lookup(&ap));
259}
260
261int
262vop_cachedlookup(struct vnode *dvp, struct namecache *par,
263 struct vnode **vpp, struct namecache **ncpp,
264 struct componentname *cnp)
265{
266 struct vop_cachedlookup_args ap;
267
268 ap.a_head.a_desc = &vop_cachedlookup_desc;
269 ap.a_dvp = dvp;
270 ap.a_par = par;
271 ap.a_vpp = vpp;
272 ap.a_ncpp = ncpp;
273 ap.a_cnp = cnp;
274 return(dvp->v_vops->vop_cachedlookup(&ap));
275}
276
277int
278vop_create(struct vnode *dvp, struct namecache *par,
279 struct vnode **vpp, struct componentname *cnp,
280 struct vattr *vap)
281{
282 struct vop_create_args ap;
283
284 ap.a_head.a_desc = &vop_create_desc;
285 ap.a_dvp = dvp;
286 ap.a_par = par;
287 ap.a_vpp = vpp;
288 ap.a_cnp = cnp;
289 ap.a_vap = vap;
290 return(dvp->v_vops->vop_create(&ap));
291}
292
293int
294vop_whiteout(struct vnode *dvp, struct namecache *par,
295 struct componentname *cnp, int flags)
296{
297 struct vop_whiteout_args ap;
298
299 ap.a_head.a_desc = &vop_whiteout_desc;
300 ap.a_dvp = dvp;
301 ap.a_par = par;
302 ap.a_cnp = cnp;
303 ap.a_flags = flags;
304 return(dvp->v_vops->vop_whiteout(&ap));
305}
306
307int
308vop_mknod(struct vnode *dvp, struct namecache *par,
309 struct vnode **vpp, struct componentname *cnp,
310 struct vattr *vap)
311{
312 struct vop_mknod_args ap;
313
314 ap.a_head.a_desc = &vop_mknod_desc;
315 ap.a_dvp = dvp;
316 ap.a_par = par;
317 ap.a_vpp = vpp;
318 ap.a_cnp = cnp;
319 ap.a_vap = vap;
320 return(dvp->v_vops->vop_mknod(&ap));
321}
322
323int
324vop_open(struct vnode *vp, int mode, struct ucred *cred,
325 struct thread *td)
326{
327 struct vop_open_args ap;
328
329 ap.a_head.a_desc = &vop_open_desc;
330 ap.a_vp = vp;
331 ap.a_mode = mode;
332 ap.a_cred = cred;
333 ap.a_td = td;
334 return(vp->v_vops->vop_open(&ap));
335}
336
337int
338vop_close(struct vnode *vp, int fflag, struct thread *td)
339{
340 struct vop_close_args ap;
341
342 ap.a_head.a_desc = &vop_close_desc;
343 ap.a_vp = vp;
344 ap.a_fflag = fflag;
345 ap.a_td = td;
346 return(vp->v_vops->vop_close(&ap));
347}
348
349int
350vop_access(struct vnode *vp, int mode, struct ucred *cred,
351 struct thread *td)
352{
353 struct vop_access_args ap;
354
355 ap.a_head.a_desc = &vop_access_desc;
356 ap.a_vp = vp;
357 ap.a_mode = mode;
358 ap.a_cred = cred;
359 ap.a_td = td;
360 return(vp->v_vops->vop_access(&ap));
361}
362
363int
364vop_getattr(struct vnode *vp, struct vattr *vap,
365 struct thread *td)
366{
367 struct vop_getattr_args ap;
368
369 ap.a_head.a_desc = &vop_getattr_desc;
370 ap.a_vp = vp;
371 ap.a_vap = vap;
372 ap.a_td = td;
373 return(vp->v_vops->vop_getattr(&ap));
374}
375
376int
377vop_setattr(struct vnode *vp, struct vattr *vap,
378 struct ucred *cred, struct thread *td)
379{
380 struct vop_setattr_args ap;
381
382 ap.a_head.a_desc = &vop_setattr_desc;
383 ap.a_vp = vp;
384 ap.a_vap = vap;
385 ap.a_cred = cred;
386 ap.a_td = td;
387 return(vp->v_vops->vop_setattr(&ap));
388}
389
390int
391vop_read(struct vnode *vp, struct uio *uio, int ioflag,
392 struct ucred *cred)
393{
394 struct vop_read_args ap;
395
396 ap.a_head.a_desc = &vop_read_desc;
397 ap.a_vp = vp;
398 ap.a_uio = uio;
399 ap.a_ioflag = ioflag;
400 ap.a_cred = cred;
401 return(vp->v_vops->vop_read(&ap));
402}
403
404int
405vop_write(struct vnode *vp, struct uio *uio, int ioflag,
406 struct ucred *cred)
407{
408 struct vop_write_args ap;
409
410 ap.a_head.a_desc = &vop_write_desc;
411 ap.a_vp = vp;
412 ap.a_uio = uio;
413 ap.a_ioflag = ioflag;
414 ap.a_cred = cred;
415 return(vp->v_vops->vop_write(&ap));
416}
417
418int
419vop_lease(struct vnode *vp, struct thread *td,
420 struct ucred *cred, int flag)
421{
422 struct vop_lease_args ap;
423
424 ap.a_head.a_desc = &vop_lease_desc;
425 ap.a_vp = vp;
426 ap.a_td = td;
427 ap.a_cred = cred;
428 ap.a_flag = flag;
429 return(vp->v_vops->vop_lease(&ap));
430}
431
432int
433vop_ioctl(struct vnode *vp, u_long command, caddr_t data,
434 int fflag, struct ucred *cred,
435 struct thread *td)
436{
437 struct vop_ioctl_args ap;
438
439 ap.a_head.a_desc = &vop_ioctl_desc;
440 ap.a_vp = vp;
441 ap.a_command = command;
442 ap.a_data = data;
443 ap.a_fflag = fflag;
444 ap.a_cred = cred;
445 ap.a_td = td;
446 return(vp->v_vops->vop_ioctl(&ap));
447}
448
449int
450vop_poll(struct vnode *vp, int events, struct ucred *cred,
451 struct thread *td)
452{
453 struct vop_poll_args ap;
454
455 ap.a_head.a_desc = &vop_poll_desc;
456 ap.a_vp = vp;
457 ap.a_events = events;
458 ap.a_cred = cred;
459 ap.a_td = td;
460 return(vp->v_vops->vop_poll(&ap));
461}
462
463int
464vop_kqfilter(struct vnode *vp, struct knote *kn)
465{
466 struct vop_kqfilter_args ap;
467
468 ap.a_head.a_desc = &vop_kqfilter_desc;
469 ap.a_vp = vp;
470 ap.a_kn = kn;
471 return(vp->v_vops->vop_kqfilter(&ap));
472}
473
474int
475vop_revoke(struct vnode *vp, int flags)
476{
477 struct vop_revoke_args ap;
478
479 ap.a_head.a_desc = &vop_revoke_desc;
480 ap.a_vp = vp;
481 ap.a_flags = flags;
482 return(vp->v_vops->vop_revoke(&ap));
483}
484
485int
486vop_mmap(struct vnode *vp, int fflags, struct ucred *cred,
487 struct thread *td)
488{
489 struct vop_mmap_args ap;
490
491 ap.a_head.a_desc = &vop_mmap_desc;
492 ap.a_vp = vp;
493 ap.a_fflags = fflags;
494 ap.a_cred = cred;
495 ap.a_td = td;
496 return(vp->v_vops->vop_mmap(&ap));
497}
498
499int
500vop_fsync(struct vnode *vp, int waitfor, struct thread *td)
501{
502 struct vop_fsync_args ap;
503
504 ap.a_head.a_desc = &vop_fsync_desc;
505 ap.a_vp = vp;
506 ap.a_waitfor = waitfor;
507 ap.a_td = td;
508 return(vp->v_vops->vop_fsync(&ap));
509}
510
511int
512vop_remove(struct vnode *dvp, struct namecache *par,
513 struct vnode *vp, struct componentname *cnp)
514{
515 struct vop_remove_args ap;
516
517 ap.a_head.a_desc = &vop_remove_desc;
518 ap.a_dvp = dvp;
519 ap.a_par = par;
520 ap.a_vp = vp;
521 ap.a_cnp = cnp;
522 return(dvp->v_vops->vop_remove(&ap));
523}
524
525int
526vop_link(struct vnode *tdvp, struct namecache *par,
527 struct vnode *vp, struct componentname *cnp)
528{
529 struct vop_link_args ap;
530
531 ap.a_head.a_desc = &vop_link_desc;
532 ap.a_tdvp = tdvp;
533 ap.a_par = par;
534 ap.a_vp = vp;
535 ap.a_cnp = cnp;
536 return(tdvp->v_vops->vop_link(&ap));
537}
538
539int
540vop_rename(struct vnode *fdvp, struct namecache *fpar,
541 struct vnode *fvp, struct componentname *fcnp,
542 struct vnode *tdvp, struct namecache *tpar,
543 struct vnode *tvp, struct componentname *tcnp)
544{
545 struct vop_rename_args ap;
546
547 ap.a_head.a_desc = &vop_rename_desc;
548 ap.a_fdvp = fdvp;
549 ap.a_fpar = fpar;
550 ap.a_fvp = fvp;
551 ap.a_fcnp = fcnp;
552 ap.a_tdvp = tdvp;
553 ap.a_tpar = tpar;
554 ap.a_tvp = tvp;
555 ap.a_tcnp = tcnp;
556 return(fdvp->v_vops->vop_rename(&ap));
557}
558
559int
560vop_mkdir(struct vnode *dvp, struct namecache *par,
561 struct vnode **vpp, struct componentname *cnp,
562 struct vattr *vap)
563{
564 struct vop_mkdir_args ap;
565
566 ap.a_head.a_desc = &vop_mkdir_desc;
567 ap.a_dvp = dvp;
568 ap.a_par = par;
569 ap.a_vpp = vpp;
570 ap.a_cnp = cnp;
571 ap.a_vap = vap;
572 return(dvp->v_vops->vop_mkdir(&ap));
573}
574
575int
576vop_rmdir(struct vnode *dvp, struct namecache *par,
577 struct vnode *vp, struct componentname *cnp)
578{
579 struct vop_rmdir_args ap;
580
581 ap.a_head.a_desc = &vop_rmdir_desc;
582 ap.a_dvp = dvp;
583 ap.a_par = par;
584 ap.a_vp = vp;
585 ap.a_cnp = cnp;
586 return(dvp->v_vops->vop_rmdir(&ap));
587}
588
589int
590vop_symlink(struct vnode *dvp, struct namecache *par,
591 struct vnode **vpp, struct componentname *cnp,
592 struct vattr *vap, char *target)
593{
594 struct vop_symlink_args ap;
595
596 ap.a_head.a_desc = &vop_symlink_desc;
597 ap.a_dvp = dvp;
598 ap.a_par = par;
599 ap.a_vpp = vpp;
600 ap.a_cnp = cnp;
601 ap.a_vap = vap;
602 ap.a_target = target;
603 return(dvp->v_vops->vop_symlink(&ap));
604}
605
606int
607vop_readdir(struct vnode *vp, struct uio *uio,
608 struct ucred *cred, int *eofflag,
609 int *ncookies, u_long **cookies)
610{
611 struct vop_readdir_args ap;
612
613 ap.a_head.a_desc = &vop_readdir_desc;
614 ap.a_vp = vp;
615 ap.a_uio = uio;
616 ap.a_cred = cred;
617 ap.a_eofflag = eofflag;
618 ap.a_ncookies = ncookies;
619 ap.a_cookies = cookies;
620 return(vp->v_vops->vop_readdir(&ap));
621}
622
623int
624vop_readlink(struct vnode *vp, struct uio *uio,
625 struct ucred *cred)
626{
627 struct vop_readlink_args ap;
628
629 ap.a_head.a_desc = &vop_readlink_desc;
630 ap.a_vp = vp;
631 ap.a_uio = uio;
632 ap.a_cred = cred;
633 return(vp->v_vops->vop_readlink(&ap));
634}
635
636int
637vop_inactive(struct vnode *vp, struct thread *td)
638{
639 struct vop_inactive_args ap;
640
641 ap.a_head.a_desc = &vop_inactive_desc;
642 ap.a_vp = vp;
643 ap.a_td = td;
644 return(vp->v_vops->vop_inactive(&ap));
645}
646
647int
648vop_reclaim(struct vnode *vp, struct thread *td)
649{
650 struct vop_reclaim_args ap;
651
652 ap.a_head.a_desc = &vop_reclaim_desc;
653 ap.a_vp = vp;
654 ap.a_td = td;
655 return(vp->v_vops->vop_reclaim(&ap));
656}
657
658int
659vop_lock(struct vnode *vp, struct lwkt_tokref *vlock,
660 int flags, struct thread *td)
661{
662 struct vop_lock_args ap;
663
664 ap.a_head.a_desc = &vop_lock_desc;
665 ap.a_vp = vp;
666 ap.a_vlock = vlock;
667 ap.a_flags = flags;
668 ap.a_td = td;
669 return(vp->v_vops->vop_lock(&ap));
670}
671
672int
673vop_unlock(struct vnode *vp, struct lwkt_tokref *vlock,
674 int flags, struct thread *td)
675{
676 struct vop_unlock_args ap;
677
678 ap.a_head.a_desc = &vop_unlock_desc;
679 ap.a_vp = vp;
680 ap.a_vlock = vlock;
681 ap.a_flags = flags;
682 ap.a_td = td;
683 return(vp->v_vops->vop_unlock(&ap));
684}
685
686int
687vop_bmap(struct vnode *vp, daddr_t bn, struct vnode **vpp,
688 daddr_t *bnp, int *runp, int *runb)
689{
690 struct vop_bmap_args ap;
691
692 ap.a_head.a_desc = &vop_bmap_desc;
693 ap.a_vp = vp;
694 ap.a_bn = bn;
695 ap.a_vpp = vpp;
696 ap.a_bnp = bnp;
697 ap.a_runp = runp;
698 ap.a_runb = runb;
699 return(vp->v_vops->vop_bmap(&ap));
700}
701
702int
703vop_strategy(struct vnode *vp, struct buf *bp)
704{
705 struct vop_strategy_args ap;
706
707 ap.a_head.a_desc = &vop_strategy_desc;
708 ap.a_vp = vp;
709 ap.a_bp = bp;
710 return(vp->v_vops->vop_strategy(&ap));
711}
712
713int
714vop_print(struct vnode *vp)
715{
716 struct vop_print_args ap;
717
718 ap.a_head.a_desc = &vop_print_desc;
719 ap.a_vp = vp;
720 return(vp->v_vops->vop_print(&ap));
721}
722
723int
724vop_pathconf(struct vnode *vp, int name,
725 register_t *retval)
726{
727 struct vop_pathconf_args ap;
728
729 ap.a_head.a_desc = &vop_pathconf_desc;
730 ap.a_vp = vp;
731 ap.a_name = name;
732 ap.a_retval = retval;
733 return(vp->v_vops->vop_pathconf(&ap));
734}
735
736int
737vop_advlock(struct vnode *vp, caddr_t id, int op,
738 struct flock *fl, int flags)
739{
740 struct vop_advlock_args ap;
741
742 ap.a_head.a_desc = &vop_advlock_desc;
743 ap.a_vp = vp;
744 ap.a_id = id;
745 ap.a_op = op;
746 ap.a_fl = fl;
747 ap.a_flags = flags;
748 return(vp->v_vops->vop_advlock(&ap));
749}
750
751int
752vop_balloc(struct vnode *vp, off_t startoffset,
753 int size, struct ucred *cred, int flags,
754 struct buf **bpp)
755{
756 struct vop_balloc_args ap;
757
758 ap.a_head.a_desc = &vop_balloc_desc;
759 ap.a_vp = vp;
760 ap.a_startoffset = startoffset;
761 ap.a_size = size;
762 ap.a_cred = cred;
763 ap.a_flags = flags;
764 ap.a_bpp = bpp;
765 return(vp->v_vops->vop_balloc(&ap));
766}
767
768int
769vop_reallocblks(struct vnode *vp,
770 struct cluster_save *buflist)
771{
772 struct vop_reallocblks_args ap;
773
774 ap.a_head.a_desc = &vop_reallocblks_desc;
775 ap.a_vp = vp;
776 ap.a_buflist = buflist;
777 return(vp->v_vops->vop_reallocblks(&ap));
778}
779
780int
781vop_getpages(struct vnode *vp, vm_page_t *m, int count,
782 int reqpage, vm_ooffset_t offset)
783{
784 struct vop_getpages_args ap;
785
786 ap.a_head.a_desc = &vop_getpages_desc;
787 ap.a_vp = vp;
788 ap.a_m = m;
789 ap.a_count = count;
790 ap.a_reqpage = reqpage;
791 ap.a_offset = offset;
792 return(vp->v_vops->vop_getpages(&ap));
793}
794
795int
796vop_putpages(struct vnode *vp, vm_page_t *m, int count,
797 int sync, int *rtvals,
798 vm_ooffset_t offset)
799{
800 struct vop_putpages_args ap;
801
802 ap.a_head.a_desc = &vop_putpages_desc;
803 ap.a_vp = vp;
804 ap.a_m = m;
805 ap.a_count = count;
806 ap.a_sync = sync;
807 ap.a_rtvals = rtvals;
808 ap.a_offset = offset;
809 return(vp->v_vops->vop_putpages(&ap));
810}
811
812int
813vop_freeblks(struct vnode *vp, daddr_t addr,
814 daddr_t length)
815{
816 struct vop_freeblks_args ap;
817
818 ap.a_head.a_desc = &vop_freeblks_desc;
819 ap.a_vp = vp;
820 ap.a_addr = addr;
821 ap.a_length = length;
822 return(vp->v_vops->vop_freeblks(&ap));
823}
824
825int
826vop_bwrite(struct vnode *vp, struct buf *bp)
827{
828 struct vop_bwrite_args ap;
829
830 ap.a_head.a_desc = &vop_bwrite_desc;
831 ap.a_vp = vp;
832 ap.a_bp = bp;
833 return(vp->v_vops->vop_bwrite(&ap));
834}
835
836int
837vop_getacl(struct vnode *vp, acl_type_t type,
838 struct acl *aclp, struct ucred *cred,
839 struct thread *td)
840{
841 struct vop_getacl_args ap;
842
843 ap.a_head.a_desc = &vop_getacl_desc;
844 ap.a_vp = vp;
845 ap.a_type = type;
846 ap.a_aclp = aclp;
847 ap.a_cred = cred;
848 ap.a_td = td;
849 return(vp->v_vops->vop_getacl(&ap));
850}
851
852int
853vop_setacl(struct vnode *vp, acl_type_t type,
854 struct acl *aclp, struct ucred *cred,
855 struct thread *td)
856{
857 struct vop_setacl_args ap;
858
859 ap.a_head.a_desc = &vop_setacl_desc;
860 ap.a_vp = vp;
861 ap.a_type = type;
862 ap.a_aclp = aclp;
863 ap.a_cred = cred;
864 ap.a_td = td;
865 return(vp->v_vops->vop_setacl(&ap));
866}
867
868int
869vop_aclcheck(struct vnode *vp, acl_type_t type,
870 struct acl *aclp, struct ucred *cred,
871 struct thread *td)
872{
873 struct vop_aclcheck_args ap;
874
875 ap.a_head.a_desc = &vop_aclcheck_desc;
876 ap.a_vp = vp;
877 ap.a_type = type;
878 ap.a_aclp = aclp;
879 ap.a_cred = cred;
880 ap.a_td = td;
881 return(vp->v_vops->vop_aclcheck(&ap));
882}
883
884int
885vop_getextattr(struct vnode *vp, char *name,
886 struct uio *uio, struct ucred *cred,
887 struct thread *td)
888{
889 struct vop_getextattr_args ap;
890
891 ap.a_head.a_desc = &vop_getextattr_desc;
892 ap.a_vp = vp;
893 ap.a_name = name;
894 ap.a_uio = uio;
895 ap.a_cred = cred;
896 ap.a_td = td;
897 return(vp->v_vops->vop_getextattr(&ap));
898}
899
900int
901vop_setextattr(struct vnode *vp, char *name,
902 struct uio *uio, struct ucred *cred,
903 struct thread *td)
904{
905 struct vop_setextattr_args ap;
906
907 ap.a_head.a_desc = &vop_setextattr_desc;
908 ap.a_vp = vp;
909 ap.a_name = name;
910 ap.a_uio = uio;
911 ap.a_cred = cred;
912 ap.a_td = td;
913 return(vp->v_vops->vop_setextattr(&ap));
914}
915
916int
917vop_createvobject(struct vnode *vp, struct thread *td)
918{
919 struct vop_createvobject_args ap;
920
921 ap.a_head.a_desc = &vop_createvobject_desc;
922 ap.a_vp = vp;
923 ap.a_td = td;
924 return(vp->v_vops->vop_createvobject(&ap));
925}
926
927int
928vop_destroyvobject(struct vnode *vp)
929{
930 struct vop_destroyvobject_args ap;
931
932 ap.a_head.a_desc = &vop_destroyvobject_desc;
933 ap.a_vp = vp;
934 return(vp->v_vops->vop_destroyvobject(&ap));
935}
936
937int
938vop_getvobject(struct vnode *vp, struct vm_object **objpp)
939{
940 struct vop_getvobject_args ap;
941
942 ap.a_head.a_desc = &vop_getvobject_desc;
943 ap.a_vp = vp;
944 ap.a_objpp = objpp;
945 return(vp->v_vops->vop_getvobject(&ap));
946}
947