| 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.10 2004/11/12 00:09:24 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/vfsops.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_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 | |
| 131 | #define VNODEOP_DESC_INIT_NCP2_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 | |
| 138 | #define VNODEOP_DESC_INIT_NCP_CRED(name) \ |
| 139 | VNODEOP_DESC_INIT(name, 0, NULL, \ |
| 140 | VDESC_NO_OFFSET, \ |
| 141 | __offsetof(VARGSSTRUCT(name), a_cred), \ |
| 142 | VDESC_NO_OFFSET, \ |
| 143 | VDESC_NO_OFFSET) |
| 144 | |
| 145 | #define VNODEOP_DESC_INIT_NCP_VP_CRED(name) \ |
| 146 | static int VOFFNAME(name)[] = { \ |
| 147 | __offsetof(VARGSSTRUCT(name), a_vp), \ |
| 148 | VDESC_NO_OFFSET }; \ |
| 149 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 150 | VDESC_NO_OFFSET, \ |
| 151 | __offsetof(VARGSSTRUCT(name), a_cred), \ |
| 152 | VDESC_NO_OFFSET, \ |
| 153 | VDESC_NO_OFFSET) |
| 154 | |
| 155 | #define VNODEOP_DESC_INIT_NCP_CRED_VPP(name) \ |
| 156 | VNODEOP_DESC_INIT(name, 0, NULL, \ |
| 157 | __offsetof(VARGSSTRUCT(name), a_vpp), \ |
| 158 | __offsetof(VARGSSTRUCT(name), a_cred), \ |
| 159 | VDESC_NO_OFFSET, \ |
| 160 | VDESC_NO_OFFSET) |
| 161 | |
| 162 | #define VNODEOP_DESC_INIT_DVP_VPP_CNP(name) \ |
| 163 | static int VOFFNAME(name)[] = { \ |
| 164 | __offsetof(VARGSSTRUCT(name), a_dvp), \ |
| 165 | VDESC_NO_OFFSET }; \ |
| 166 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 167 | __offsetof(VARGSSTRUCT(name), a_vpp), \ |
| 168 | VDESC_NO_OFFSET, \ |
| 169 | VDESC_NO_OFFSET, \ |
| 170 | __offsetof(VARGSSTRUCT(name), a_cnp)) |
| 171 | |
| 172 | #define VNODEOP_DESC_INIT_DVP_VPP_CRED(name) \ |
| 173 | static int VOFFNAME(name)[] = { \ |
| 174 | __offsetof(VARGSSTRUCT(name), a_dvp), \ |
| 175 | VDESC_NO_OFFSET }; \ |
| 176 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 177 | __offsetof(VARGSSTRUCT(name), a_vpp), \ |
| 178 | __offsetof(VARGSSTRUCT(name), a_cred), \ |
| 179 | VDESC_NO_OFFSET, \ |
| 180 | VDESC_NO_OFFSET) |
| 181 | |
| 182 | #define VNODEOP_DESC_INIT_DVP_CNP(name) \ |
| 183 | static int VOFFNAME(name)[] = { \ |
| 184 | __offsetof(VARGSSTRUCT(name), a_dvp), \ |
| 185 | VDESC_NO_OFFSET }; \ |
| 186 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 187 | VDESC_NO_OFFSET, \ |
| 188 | VDESC_NO_OFFSET, \ |
| 189 | VDESC_NO_OFFSET, \ |
| 190 | __offsetof(VARGSSTRUCT(name), a_cnp)) |
| 191 | |
| 192 | #define VNODEOP_DESC_INIT_DVP_VP_CNP(name) \ |
| 193 | static int VOFFNAME(name)[] = { \ |
| 194 | __offsetof(VARGSSTRUCT(name), a_dvp), \ |
| 195 | __offsetof(VARGSSTRUCT(name), a_vp), \ |
| 196 | VDESC_NO_OFFSET }; \ |
| 197 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 198 | VDESC_NO_OFFSET, \ |
| 199 | VDESC_NO_OFFSET, \ |
| 200 | VDESC_NO_OFFSET, \ |
| 201 | __offsetof(VARGSSTRUCT(name), a_cnp)) |
| 202 | |
| 203 | #define VNODEOP_DESC_INIT_TDVP_VP_CNP(name) \ |
| 204 | static int VOFFNAME(name)[] = { \ |
| 205 | __offsetof(VARGSSTRUCT(name), a_tdvp), \ |
| 206 | __offsetof(VARGSSTRUCT(name), a_vp), \ |
| 207 | VDESC_NO_OFFSET }; \ |
| 208 | VNODEOP_DESC_INIT(name, 0, VOFFNAME(name), \ |
| 209 | VDESC_NO_OFFSET, \ |
| 210 | VDESC_NO_OFFSET, \ |
| 211 | VDESC_NO_OFFSET, \ |
| 212 | __offsetof(VARGSSTRUCT(name), a_cnp)) |
| 213 | |
| 214 | VNODEOP_DESC_INIT_SIMPLE(default); |
| 215 | VNODEOP_DESC_INIT_VP(islocked); |
| 216 | VNODEOP_DESC_INIT_DVP_VPP_CNP(lookup); |
| 217 | VNODEOP_DESC_INIT_DVP_VPP_CNP(create); |
| 218 | VNODEOP_DESC_INIT_DVP_CNP(whiteout); |
| 219 | VNODEOP_DESC_INIT_DVP_VPP_CNP(mknod); |
| 220 | VNODEOP_DESC_INIT_VP_CRED(open); |
| 221 | VNODEOP_DESC_INIT_VP(close); |
| 222 | VNODEOP_DESC_INIT_VP_CRED(access); |
| 223 | VNODEOP_DESC_INIT_VP(getattr); |
| 224 | VNODEOP_DESC_INIT_VP_CRED(setattr); |
| 225 | VNODEOP_DESC_INIT_VP_CRED(read); |
| 226 | VNODEOP_DESC_INIT_VP_CRED(write); |
| 227 | VNODEOP_DESC_INIT_VP_CRED(lease); |
| 228 | VNODEOP_DESC_INIT_VP_CRED(ioctl); |
| 229 | VNODEOP_DESC_INIT_VP_CRED(poll); |
| 230 | VNODEOP_DESC_INIT_VP(kqfilter); |
| 231 | VNODEOP_DESC_INIT_VP(revoke); |
| 232 | VNODEOP_DESC_INIT_VP_CRED(mmap); |
| 233 | VNODEOP_DESC_INIT_VP(fsync); |
| 234 | VNODEOP_DESC_INIT_DVP_VP_CNP(remove); |
| 235 | VNODEOP_DESC_INIT_TDVP_VP_CNP(link); |
| 236 | |
| 237 | static int VOFFNAME(rename)[] = { |
| 238 | __offsetof(VARGSSTRUCT(rename), a_fdvp), |
| 239 | __offsetof(VARGSSTRUCT(rename), a_fvp), |
| 240 | __offsetof(VARGSSTRUCT(rename), a_tdvp), |
| 241 | __offsetof(VARGSSTRUCT(rename), a_tvp), |
| 242 | VDESC_NO_OFFSET |
| 243 | }; |
| 244 | VNODEOP_DESC_INIT(rename, |
| 245 | VDESC_VP0_WILLRELE|VDESC_VP1_WILLRELE| |
| 246 | VDESC_VP2_WILLRELE|VDESC_VP3_WILLRELE| |
| 247 | VDESC_VP2_WILLUNLOCK|VDESC_VP3_WILLUNLOCK, /* tdvp and tvp */ |
| 248 | VOFFNAME(rename), |
| 249 | VDESC_NO_OFFSET, |
| 250 | VDESC_NO_OFFSET, |
| 251 | VDESC_NO_OFFSET, |
| 252 | __offsetof(VARGSSTRUCT(rename), a_fcnp)); |
| 253 | |
| 254 | VNODEOP_DESC_INIT_DVP_VPP_CNP(mkdir); |
| 255 | VNODEOP_DESC_INIT_DVP_VP_CNP(rmdir); |
| 256 | VNODEOP_DESC_INIT_DVP_VPP_CNP(symlink); |
| 257 | VNODEOP_DESC_INIT_VP_CRED(readdir); |
| 258 | VNODEOP_DESC_INIT_VP_CRED(readlink); |
| 259 | VNODEOP_DESC_INIT_VP(inactive); |
| 260 | VNODEOP_DESC_INIT_VP(reclaim); |
| 261 | VNODEOP_DESC_INIT_VP(lock); |
| 262 | VNODEOP_DESC_INIT_VP(unlock); |
| 263 | VNODEOP_DESC_INIT_VP_VPP(bmap); |
| 264 | VNODEOP_DESC_INIT_VP(strategy); |
| 265 | VNODEOP_DESC_INIT_VP(print); |
| 266 | VNODEOP_DESC_INIT_VP(pathconf); |
| 267 | VNODEOP_DESC_INIT_VP(advlock); |
| 268 | VNODEOP_DESC_INIT_VP_CRED(balloc); |
| 269 | VNODEOP_DESC_INIT_VP(reallocblks); |
| 270 | VNODEOP_DESC_INIT_VP(getpages); |
| 271 | VNODEOP_DESC_INIT_VP(putpages); |
| 272 | VNODEOP_DESC_INIT_VP(freeblks); |
| 273 | VNODEOP_DESC_INIT_VP(bwrite); |
| 274 | VNODEOP_DESC_INIT_VP_CRED(getacl); |
| 275 | VNODEOP_DESC_INIT_VP_CRED(setacl); |
| 276 | VNODEOP_DESC_INIT_VP_CRED(aclcheck); |
| 277 | VNODEOP_DESC_INIT_VP_CRED(getextattr); |
| 278 | VNODEOP_DESC_INIT_VP_CRED(setextattr); |
| 279 | VNODEOP_DESC_INIT_VP(createvobject); |
| 280 | VNODEOP_DESC_INIT_VP(destroyvobject); |
| 281 | VNODEOP_DESC_INIT_VP(getvobject); |
| 282 | VNODEOP_DESC_INIT_SIMPLE(vfsset); |
| 283 | |
| 284 | VNODEOP_DESC_INIT_NCP_CRED(nresolve); |
| 285 | VNODEOP_DESC_INIT_DVP_VPP_CRED(nlookupdotdot); |
| 286 | VNODEOP_DESC_INIT_NCP_CRED_VPP(ncreate); |
| 287 | VNODEOP_DESC_INIT_NCP_CRED_VPP(nmkdir); |
| 288 | VNODEOP_DESC_INIT_NCP_CRED_VPP(nmknod); |
| 289 | VNODEOP_DESC_INIT_NCP_VP_CRED(nlink); |
| 290 | VNODEOP_DESC_INIT_NCP_CRED_VPP(nsymlink); |
| 291 | VNODEOP_DESC_INIT_NCP_CRED(nwhiteout); |
| 292 | VNODEOP_DESC_INIT_NCP_CRED(nremove); |
| 293 | VNODEOP_DESC_INIT_NCP_CRED(nrmdir); |
| 294 | VNODEOP_DESC_INIT_NCP2_CRED(nrename); |
| 295 | |
| 296 | /* |
| 297 | * The DO_OPS macro basicallys calls ops->blah(&ap) but is also responsible |
| 298 | * for checking vv_flags and executing additional hook functions. |
| 299 | * |
| 300 | * NOTE: vop_vnoperate_ap() rolls its own DO_OPS equivalent. |
| 301 | */ |
| 302 | #define DO_OPS(ops, error, ap, vop_field) \ |
| 303 | if (ops->vv_flags & VVF_HOOK_MASK) { \ |
| 304 | if (ops->vv_flags & VVF_JOURNAL_HOOK) \ |
| 305 | error = ops->vv_jops->vop_field(ap); \ |
| 306 | else \ |
| 307 | error = 0; \ |
| 308 | if (error == 0) \ |
| 309 | error = ops->vop_field(ap); \ |
| 310 | } else { \ |
| 311 | error = ops->vop_field(ap); \ |
| 312 | } \ |
| 313 | |
| 314 | |
| 315 | /************************************************************************ |
| 316 | * PRIMARY HIGH LEVEL VNODE OPERATIONS CALLS * |
| 317 | ************************************************************************ |
| 318 | * |
| 319 | * These procedures are called directly from the kernel and/or fileops |
| 320 | * code to perform file/device operations on the system. |
| 321 | */ |
| 322 | |
| 323 | int |
| 324 | vop_islocked(struct vop_ops *ops, struct vnode *vp, struct thread *td) |
| 325 | { |
| 326 | struct vop_islocked_args ap; |
| 327 | int error; |
| 328 | |
| 329 | ap.a_head.a_desc = &vop_islocked_desc; |
| 330 | ap.a_head.a_ops = ops; |
| 331 | ap.a_vp = vp; |
| 332 | ap.a_td = td; |
| 333 | |
| 334 | DO_OPS(ops, error, &ap, vop_islocked); |
| 335 | return(error); |
| 336 | } |
| 337 | |
| 338 | int |
| 339 | vop_lookup(struct vop_ops *ops, struct vnode *dvp, |
| 340 | struct vnode **vpp, struct componentname *cnp) |
| 341 | { |
| 342 | struct vop_lookup_args ap; |
| 343 | int error; |
| 344 | |
| 345 | ap.a_head.a_desc = &vop_lookup_desc; |
| 346 | ap.a_head.a_ops = ops; |
| 347 | ap.a_dvp = dvp; |
| 348 | ap.a_vpp = vpp; |
| 349 | ap.a_cnp = cnp; |
| 350 | |
| 351 | DO_OPS(ops, error, &ap, vop_lookup); |
| 352 | return(error); |
| 353 | } |
| 354 | |
| 355 | int |
| 356 | vop_create(struct vop_ops *ops, struct vnode *dvp, |
| 357 | struct vnode **vpp, struct componentname *cnp, struct vattr *vap) |
| 358 | { |
| 359 | struct vop_create_args ap; |
| 360 | int error; |
| 361 | |
| 362 | ap.a_head.a_desc = &vop_create_desc; |
| 363 | ap.a_head.a_ops = ops; |
| 364 | ap.a_dvp = dvp; |
| 365 | ap.a_vpp = vpp; |
| 366 | ap.a_cnp = cnp; |
| 367 | ap.a_vap = vap; |
| 368 | |
| 369 | DO_OPS(ops, error, &ap, vop_create); |
| 370 | return(error); |
| 371 | } |
| 372 | |
| 373 | int |
| 374 | vop_whiteout(struct vop_ops *ops, struct vnode *dvp, |
| 375 | struct componentname *cnp, int flags) |
| 376 | { |
| 377 | struct vop_whiteout_args ap; |
| 378 | int error; |
| 379 | |
| 380 | ap.a_head.a_desc = &vop_whiteout_desc; |
| 381 | ap.a_head.a_ops = ops; |
| 382 | ap.a_dvp = dvp; |
| 383 | ap.a_cnp = cnp; |
| 384 | ap.a_flags = flags; |
| 385 | |
| 386 | DO_OPS(ops, error, &ap, vop_whiteout); |
| 387 | return(error); |
| 388 | } |
| 389 | |
| 390 | int |
| 391 | vop_mknod(struct vop_ops *ops, struct vnode *dvp, |
| 392 | struct vnode **vpp, struct componentname *cnp, struct vattr *vap) |
| 393 | { |
| 394 | struct vop_mknod_args ap; |
| 395 | int error; |
| 396 | |
| 397 | ap.a_head.a_desc = &vop_mknod_desc; |
| 398 | ap.a_head.a_ops = ops; |
| 399 | ap.a_dvp = dvp; |
| 400 | ap.a_vpp = vpp; |
| 401 | ap.a_cnp = cnp; |
| 402 | ap.a_vap = vap; |
| 403 | |
| 404 | DO_OPS(ops, error, &ap, vop_mknod); |
| 405 | return(error); |
| 406 | } |
| 407 | |
| 408 | int |
| 409 | vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, |
| 410 | struct file *fp, struct thread *td) |
| 411 | { |
| 412 | struct vop_open_args ap; |
| 413 | int error; |
| 414 | |
| 415 | ap.a_head.a_desc = &vop_open_desc; |
| 416 | ap.a_head.a_ops = ops; |
| 417 | ap.a_vp = vp; |
| 418 | ap.a_fp = fp; |
| 419 | ap.a_mode = mode; |
| 420 | ap.a_cred = cred; |
| 421 | ap.a_td = td; |
| 422 | |
| 423 | DO_OPS(ops, error, &ap, vop_open); |
| 424 | return(error); |
| 425 | } |
| 426 | |
| 427 | int |
| 428 | vop_close(struct vop_ops *ops, struct vnode *vp, int fflag, struct thread *td) |
| 429 | { |
| 430 | struct vop_close_args ap; |
| 431 | int error; |
| 432 | |
| 433 | ap.a_head.a_desc = &vop_close_desc; |
| 434 | ap.a_head.a_ops = ops; |
| 435 | ap.a_vp = vp; |
| 436 | ap.a_fflag = fflag; |
| 437 | ap.a_td = td; |
| 438 | |
| 439 | DO_OPS(ops, error, &ap, vop_close); |
| 440 | return(error); |
| 441 | } |
| 442 | |
| 443 | int |
| 444 | vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred, |
| 445 | struct thread *td) |
| 446 | { |
| 447 | struct vop_access_args ap; |
| 448 | int error; |
| 449 | |
| 450 | ap.a_head.a_desc = &vop_access_desc; |
| 451 | ap.a_head.a_ops = ops; |
| 452 | ap.a_vp = vp; |
| 453 | ap.a_mode = mode; |
| 454 | ap.a_cred = cred; |
| 455 | ap.a_td = td; |
| 456 | |
| 457 | DO_OPS(ops, error, &ap, vop_access); |
| 458 | return(error); |
| 459 | } |
| 460 | |
| 461 | int |
| 462 | vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, |
| 463 | struct thread *td) |
| 464 | { |
| 465 | struct vop_getattr_args ap; |
| 466 | int error; |
| 467 | |
| 468 | ap.a_head.a_desc = &vop_getattr_desc; |
| 469 | ap.a_head.a_ops = ops; |
| 470 | ap.a_vp = vp; |
| 471 | ap.a_vap = vap; |
| 472 | ap.a_td = td; |
| 473 | |
| 474 | DO_OPS(ops, error, &ap, vop_getattr); |
| 475 | return(error); |
| 476 | } |
| 477 | |
| 478 | int |
| 479 | vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap, |
| 480 | struct ucred *cred, struct thread *td) |
| 481 | { |
| 482 | struct vop_setattr_args ap; |
| 483 | int error; |
| 484 | |
| 485 | ap.a_head.a_desc = &vop_setattr_desc; |
| 486 | ap.a_head.a_ops = ops; |
| 487 | ap.a_vp = vp; |
| 488 | ap.a_vap = vap; |
| 489 | ap.a_cred = cred; |
| 490 | ap.a_td = td; |
| 491 | |
| 492 | DO_OPS(ops, error, &ap, vop_setattr); |
| 493 | return(error); |
| 494 | } |
| 495 | |
| 496 | int |
| 497 | vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, |
| 498 | struct ucred *cred) |
| 499 | { |
| 500 | struct vop_read_args ap; |
| 501 | int error; |
| 502 | |
| 503 | ap.a_head.a_desc = &vop_read_desc; |
| 504 | ap.a_head.a_ops = ops; |
| 505 | ap.a_vp = vp; |
| 506 | ap.a_uio = uio; |
| 507 | ap.a_ioflag = ioflag; |
| 508 | ap.a_cred = cred; |
| 509 | |
| 510 | DO_OPS(ops, error, &ap, vop_read); |
| 511 | return(error); |
| 512 | } |
| 513 | |
| 514 | int |
| 515 | vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, |
| 516 | struct ucred *cred) |
| 517 | { |
| 518 | struct vop_write_args ap; |
| 519 | int error; |
| 520 | |
| 521 | ap.a_head.a_desc = &vop_write_desc; |
| 522 | ap.a_head.a_ops = ops; |
| 523 | ap.a_vp = vp; |
| 524 | ap.a_uio = uio; |
| 525 | ap.a_ioflag = ioflag; |
| 526 | ap.a_cred = cred; |
| 527 | |
| 528 | DO_OPS(ops, error, &ap, vop_write); |
| 529 | return(error); |
| 530 | } |
| 531 | |
| 532 | int |
| 533 | vop_lease(struct vop_ops *ops, struct vnode *vp, struct thread *td, |
| 534 | struct ucred *cred, int flag) |
| 535 | { |
| 536 | struct vop_lease_args ap; |
| 537 | int error; |
| 538 | |
| 539 | ap.a_head.a_desc = &vop_lease_desc; |
| 540 | ap.a_head.a_ops = ops; |
| 541 | ap.a_vp = vp; |
| 542 | ap.a_td = td; |
| 543 | ap.a_cred = cred; |
| 544 | ap.a_flag = flag; |
| 545 | |
| 546 | DO_OPS(ops, error, &ap, vop_lease); |
| 547 | return(error); |
| 548 | } |
| 549 | |
| 550 | int |
| 551 | vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data, |
| 552 | int fflag, struct ucred *cred, |
| 553 | struct thread *td) |
| 554 | { |
| 555 | struct vop_ioctl_args ap; |
| 556 | int error; |
| 557 | |
| 558 | ap.a_head.a_desc = &vop_ioctl_desc; |
| 559 | ap.a_head.a_ops = ops; |
| 560 | ap.a_vp = vp; |
| 561 | ap.a_command = command; |
| 562 | ap.a_data = data; |
| 563 | ap.a_fflag = fflag; |
| 564 | ap.a_cred = cred; |
| 565 | ap.a_td = td; |
| 566 | |
| 567 | DO_OPS(ops, error, &ap, vop_ioctl); |
| 568 | return(error); |
| 569 | } |
| 570 | |
| 571 | int |
| 572 | vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred, |
| 573 | struct thread *td) |
| 574 | { |
| 575 | struct vop_poll_args ap; |
| 576 | int error; |
| 577 | |
| 578 | ap.a_head.a_desc = &vop_poll_desc; |
| 579 | ap.a_head.a_ops = ops; |
| 580 | ap.a_vp = vp; |
| 581 | ap.a_events = events; |
| 582 | ap.a_cred = cred; |
| 583 | ap.a_td = td; |
| 584 | |
| 585 | DO_OPS(ops, error, &ap, vop_poll); |
| 586 | return(error); |
| 587 | } |
| 588 | |
| 589 | int |
| 590 | vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn) |
| 591 | { |
| 592 | struct vop_kqfilter_args ap; |
| 593 | int error; |
| 594 | |
| 595 | ap.a_head.a_desc = &vop_kqfilter_desc; |
| 596 | ap.a_head.a_ops = ops; |
| 597 | ap.a_vp = vp; |
| 598 | ap.a_kn = kn; |
| 599 | |
| 600 | DO_OPS(ops, error, &ap, vop_kqfilter); |
| 601 | return(error); |
| 602 | } |
| 603 | |
| 604 | int |
| 605 | vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags) |
| 606 | { |
| 607 | struct vop_revoke_args ap; |
| 608 | int error; |
| 609 | |
| 610 | ap.a_head.a_desc = &vop_revoke_desc; |
| 611 | ap.a_head.a_ops = ops; |
| 612 | ap.a_vp = vp; |
| 613 | ap.a_flags = flags; |
| 614 | |
| 615 | DO_OPS(ops, error, &ap, vop_revoke); |
| 616 | return(error); |
| 617 | } |
| 618 | |
| 619 | int |
| 620 | vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred, |
| 621 | struct thread *td) |
| 622 | { |
| 623 | struct vop_mmap_args ap; |
| 624 | int error; |
| 625 | |
| 626 | ap.a_head.a_desc = &vop_mmap_desc; |
| 627 | ap.a_head.a_ops = ops; |
| 628 | ap.a_vp = vp; |
| 629 | ap.a_fflags = fflags; |
| 630 | ap.a_cred = cred; |
| 631 | ap.a_td = td; |
| 632 | |
| 633 | DO_OPS(ops, error, &ap, vop_mmap); |
| 634 | return(error); |
| 635 | } |
| 636 | |
| 637 | int |
| 638 | vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, struct thread *td) |
| 639 | { |
| 640 | struct vop_fsync_args ap; |
| 641 | int error; |
| 642 | |
| 643 | ap.a_head.a_desc = &vop_fsync_desc; |
| 644 | ap.a_head.a_ops = ops; |
| 645 | ap.a_vp = vp; |
| 646 | ap.a_waitfor = waitfor; |
| 647 | ap.a_td = td; |
| 648 | |
| 649 | DO_OPS(ops, error, &ap, vop_fsync); |
| 650 | return(error); |
| 651 | } |
| 652 | |
| 653 | int |
| 654 | vop_remove(struct vop_ops *ops, struct vnode *dvp, |
| 655 | struct vnode *vp, struct componentname *cnp) |
| 656 | { |
| 657 | struct vop_remove_args ap; |
| 658 | int error; |
| 659 | |
| 660 | ap.a_head.a_desc = &vop_remove_desc; |
| 661 | ap.a_head.a_ops = ops; |
| 662 | ap.a_dvp = dvp; |
| 663 | ap.a_vp = vp; |
| 664 | ap.a_cnp = cnp; |
| 665 | |
| 666 | DO_OPS(ops, error, &ap, vop_remove); |
| 667 | return(error); |
| 668 | } |
| 669 | |
| 670 | int |
| 671 | vop_link(struct vop_ops *ops, struct vnode *tdvp, |
| 672 | struct vnode *vp, struct componentname *cnp) |
| 673 | { |
| 674 | struct vop_link_args ap; |
| 675 | int error; |
| 676 | |
| 677 | ap.a_head.a_desc = &vop_link_desc; |
| 678 | ap.a_head.a_ops = ops; |
| 679 | ap.a_tdvp = tdvp; |
| 680 | ap.a_vp = vp; |
| 681 | ap.a_cnp = cnp; |
| 682 | |
| 683 | DO_OPS(ops, error, &ap, vop_link); |
| 684 | return(error); |
| 685 | } |
| 686 | |
| 687 | int |
| 688 | vop_rename(struct vop_ops *ops, |
| 689 | struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, |
| 690 | struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp) |
| 691 | { |
| 692 | struct vop_rename_args ap; |
| 693 | int error; |
| 694 | |
| 695 | ap.a_head.a_desc = &vop_rename_desc; |
| 696 | ap.a_head.a_ops = ops; |
| 697 | ap.a_fdvp = fdvp; |
| 698 | ap.a_fvp = fvp; |
| 699 | ap.a_fcnp = fcnp; |
| 700 | ap.a_tdvp = tdvp; |
| 701 | ap.a_tvp = tvp; |
| 702 | ap.a_tcnp = tcnp; |
| 703 | |
| 704 | DO_OPS(ops, error, &ap, vop_rename); |
| 705 | return(error); |
| 706 | } |
| 707 | |
| 708 | int |
| 709 | vop_mkdir(struct vop_ops *ops, struct vnode *dvp, |
| 710 | struct vnode **vpp, struct componentname *cnp, struct vattr *vap) |
| 711 | { |
| 712 | struct vop_mkdir_args ap; |
| 713 | int error; |
| 714 | |
| 715 | ap.a_head.a_desc = &vop_mkdir_desc; |
| 716 | ap.a_head.a_ops = ops; |
| 717 | ap.a_dvp = dvp; |
| 718 | ap.a_vpp = vpp; |
| 719 | ap.a_cnp = cnp; |
| 720 | ap.a_vap = vap; |
| 721 | |
| 722 | DO_OPS(ops, error, &ap, vop_mkdir); |
| 723 | return(error); |
| 724 | } |
| 725 | |
| 726 | int |
| 727 | vop_rmdir(struct vop_ops *ops, struct vnode *dvp, |
| 728 | struct vnode *vp, struct componentname *cnp) |
| 729 | { |
| 730 | struct vop_rmdir_args ap; |
| 731 | int error; |
| 732 | |
| 733 | ap.a_head.a_desc = &vop_rmdir_desc; |
| 734 | ap.a_head.a_ops = ops; |
| 735 | ap.a_dvp = dvp; |
| 736 | ap.a_vp = vp; |
| 737 | ap.a_cnp = cnp; |
| 738 | |
| 739 | DO_OPS(ops, error, &ap, vop_rmdir); |
| 740 | return(error); |
| 741 | } |
| 742 | |
| 743 | int |
| 744 | vop_symlink(struct vop_ops *ops, struct vnode *dvp, |
| 745 | struct vnode **vpp, struct componentname *cnp, |
| 746 | struct vattr *vap, char *target) |
| 747 | { |
| 748 | struct vop_symlink_args ap; |
| 749 | int error; |
| 750 | |
| 751 | ap.a_head.a_desc = &vop_symlink_desc; |
| 752 | ap.a_head.a_ops = ops; |
| 753 | ap.a_dvp = dvp; |
| 754 | ap.a_vpp = vpp; |
| 755 | ap.a_cnp = cnp; |
| 756 | ap.a_vap = vap; |
| 757 | ap.a_target = target; |
| 758 | |
| 759 | DO_OPS(ops, error, &ap, vop_symlink); |
| 760 | return(error); |
| 761 | } |
| 762 | |
| 763 | int |
| 764 | vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio, |
| 765 | struct ucred *cred, int *eofflag, int *ncookies, u_long **cookies) |
| 766 | { |
| 767 | struct vop_readdir_args ap; |
| 768 | int error; |
| 769 | |
| 770 | ap.a_head.a_desc = &vop_readdir_desc; |
| 771 | ap.a_head.a_ops = ops; |
| 772 | ap.a_vp = vp; |
| 773 | ap.a_uio = uio; |
| 774 | ap.a_cred = cred; |
| 775 | ap.a_eofflag = eofflag; |
| 776 | ap.a_ncookies = ncookies; |
| 777 | ap.a_cookies = cookies; |
| 778 | |
| 779 | DO_OPS(ops, error, &ap, vop_readdir); |
| 780 | return(error); |
| 781 | } |
| 782 | |
| 783 | int |
| 784 | vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio, |
| 785 | struct ucred *cred) |
| 786 | { |
| 787 | struct vop_readlink_args ap; |
| 788 | int error; |
| 789 | |
| 790 | ap.a_head.a_desc = &vop_readlink_desc; |
| 791 | ap.a_head.a_ops = ops; |
| 792 | ap.a_vp = vp; |
| 793 | ap.a_uio = uio; |
| 794 | ap.a_cred = cred; |
| 795 | |
| 796 | DO_OPS(ops, error, &ap, vop_readlink); |
| 797 | return(error); |
| 798 | } |
| 799 | |
| 800 | int |
| 801 | vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td) |
| 802 | { |
| 803 | struct vop_inactive_args ap; |
| 804 | int error; |
| 805 | |
| 806 | ap.a_head.a_desc = &vop_inactive_desc; |
| 807 | ap.a_head.a_ops = ops; |
| 808 | ap.a_vp = vp; |
| 809 | ap.a_td = td; |
| 810 | |
| 811 | DO_OPS(ops, error, &ap, vop_inactive); |
| 812 | return(error); |
| 813 | } |
| 814 | |
| 815 | int |
| 816 | vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td) |
| 817 | { |
| 818 | struct vop_reclaim_args ap; |
| 819 | int error; |
| 820 | |
| 821 | ap.a_head.a_desc = &vop_reclaim_desc; |
| 822 | ap.a_head.a_ops = ops; |
| 823 | ap.a_vp = vp; |
| 824 | ap.a_td = td; |
| 825 | |
| 826 | DO_OPS(ops, error, &ap, vop_reclaim); |
| 827 | return(error); |
| 828 | } |
| 829 | |
| 830 | int |
| 831 | vop_lock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) |
| 832 | { |
| 833 | struct vop_lock_args ap; |
| 834 | int error; |
| 835 | |
| 836 | ap.a_head.a_desc = &vop_lock_desc; |
| 837 | ap.a_head.a_ops = ops; |
| 838 | ap.a_vp = vp; |
| 839 | ap.a_flags = flags; |
| 840 | ap.a_td = td; |
| 841 | |
| 842 | DO_OPS(ops, error, &ap, vop_lock); |
| 843 | return(error); |
| 844 | } |
| 845 | |
| 846 | int |
| 847 | vop_unlock(struct vop_ops *ops, struct vnode *vp, int flags, struct thread *td) |
| 848 | { |
| 849 | struct vop_unlock_args ap; |
| 850 | int error; |
| 851 | |
| 852 | ap.a_head.a_desc = &vop_unlock_desc; |
| 853 | ap.a_head.a_ops = ops; |
| 854 | ap.a_vp = vp; |
| 855 | ap.a_flags = flags; |
| 856 | ap.a_td = td; |
| 857 | |
| 858 | DO_OPS(ops, error, &ap, vop_unlock); |
| 859 | return(error); |
| 860 | } |
| 861 | |
| 862 | int |
| 863 | vop_bmap(struct vop_ops *ops, struct vnode *vp, daddr_t bn, struct vnode **vpp, |
| 864 | daddr_t *bnp, int *runp, int *runb) |
| 865 | { |
| 866 | struct vop_bmap_args ap; |
| 867 | int error; |
| 868 | |
| 869 | ap.a_head.a_desc = &vop_bmap_desc; |
| 870 | ap.a_head.a_ops = ops; |
| 871 | ap.a_vp = vp; |
| 872 | ap.a_bn = bn; |
| 873 | ap.a_vpp = vpp; |
| 874 | ap.a_bnp = bnp; |
| 875 | ap.a_runp = runp; |
| 876 | ap.a_runb = runb; |
| 877 | |
| 878 | DO_OPS(ops, error, &ap, vop_bmap); |
| 879 | return(error); |
| 880 | } |
| 881 | |
| 882 | int |
| 883 | vop_strategy(struct vop_ops *ops, struct vnode *vp, struct buf *bp) |
| 884 | { |
| 885 | struct vop_strategy_args ap; |
| 886 | int error; |
| 887 | |
| 888 | ap.a_head.a_desc = &vop_strategy_desc; |
| 889 | ap.a_head.a_ops = ops; |
| 890 | ap.a_vp = vp; |
| 891 | ap.a_bp = bp; |
| 892 | |
| 893 | DO_OPS(ops, error, &ap, vop_strategy); |
| 894 | return(error); |
| 895 | } |
| 896 | |
| 897 | int |
| 898 | vop_print(struct vop_ops *ops, struct vnode *vp) |
| 899 | { |
| 900 | struct vop_print_args ap; |
| 901 | int error; |
| 902 | |
| 903 | ap.a_head.a_desc = &vop_print_desc; |
| 904 | ap.a_head.a_ops = ops; |
| 905 | ap.a_vp = vp; |
| 906 | |
| 907 | DO_OPS(ops, error, &ap, vop_print); |
| 908 | return(error); |
| 909 | } |
| 910 | |
| 911 | int |
| 912 | vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name, |
| 913 | register_t *retval) |
| 914 | { |
| 915 | struct vop_pathconf_args ap; |
| 916 | int error; |
| 917 | |
| 918 | ap.a_head.a_desc = &vop_pathconf_desc; |
| 919 | ap.a_head.a_ops = ops; |
| 920 | ap.a_vp = vp; |
| 921 | ap.a_name = name; |
| 922 | ap.a_retval = retval; |
| 923 | |
| 924 | DO_OPS(ops, error, &ap, vop_pathconf); |
| 925 | return(error); |
| 926 | } |
| 927 | |
| 928 | int |
| 929 | vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op, |
| 930 | struct flock *fl, int flags) |
| 931 | { |
| 932 | struct vop_advlock_args ap; |
| 933 | int error; |
| 934 | |
| 935 | ap.a_head.a_desc = &vop_advlock_desc; |
| 936 | ap.a_head.a_ops = ops; |
| 937 | ap.a_vp = vp; |
| 938 | ap.a_id = id; |
| 939 | ap.a_op = op; |
| 940 | ap.a_fl = fl; |
| 941 | ap.a_flags = flags; |
| 942 | |
| 943 | DO_OPS(ops, error, &ap, vop_advlock); |
| 944 | return(error); |
| 945 | } |
| 946 | |
| 947 | int |
| 948 | vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset, |
| 949 | int size, struct ucred *cred, int flags, |
| 950 | struct buf **bpp) |
| 951 | { |
| 952 | struct vop_balloc_args ap; |
| 953 | int error; |
| 954 | |
| 955 | ap.a_head.a_desc = &vop_balloc_desc; |
| 956 | ap.a_head.a_ops = ops; |
| 957 | ap.a_vp = vp; |
| 958 | ap.a_startoffset = startoffset; |
| 959 | ap.a_size = size; |
| 960 | ap.a_cred = cred; |
| 961 | ap.a_flags = flags; |
| 962 | ap.a_bpp = bpp; |
| 963 | |
| 964 | DO_OPS(ops, error, &ap, vop_balloc); |
| 965 | return(error); |
| 966 | } |
| 967 | |
| 968 | int |
| 969 | vop_reallocblks(struct vop_ops *ops, struct vnode *vp, |
| 970 | struct cluster_save *buflist) |
| 971 | { |
| 972 | struct vop_reallocblks_args ap; |
| 973 | int error; |
| 974 | |
| 975 | ap.a_head.a_desc = &vop_reallocblks_desc; |
| 976 | ap.a_head.a_ops = ops; |
| 977 | ap.a_vp = vp; |
| 978 | ap.a_buflist = buflist; |
| 979 | |
| 980 | DO_OPS(ops, error, &ap, vop_reallocblks); |
| 981 | return(error); |
| 982 | } |
| 983 | |
| 984 | int |
| 985 | vop_getpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count, |
| 986 | int reqpage, vm_ooffset_t offset) |
| 987 | { |
| 988 | struct vop_getpages_args ap; |
| 989 | int error; |
| 990 | |
| 991 | ap.a_head.a_desc = &vop_getpages_desc; |
| 992 | ap.a_head.a_ops = ops; |
| 993 | ap.a_vp = vp; |
| 994 | ap.a_m = m; |
| 995 | ap.a_count = count; |
| 996 | ap.a_reqpage = reqpage; |
| 997 | ap.a_offset = offset; |
| 998 | |
| 999 | DO_OPS(ops, error, &ap, vop_getpages); |
| 1000 | return(error); |
| 1001 | } |
| 1002 | |
| 1003 | int |
| 1004 | vop_putpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count, |
| 1005 | int sync, int *rtvals, vm_ooffset_t offset) |
| 1006 | { |
| 1007 | struct vop_putpages_args ap; |
| 1008 | int error; |
| 1009 | |
| 1010 | ap.a_head.a_desc = &vop_putpages_desc; |
| 1011 | ap.a_head.a_ops = ops; |
| 1012 | ap.a_vp = vp; |
| 1013 | ap.a_m = m; |
| 1014 | ap.a_count = count; |
| 1015 | ap.a_sync = sync; |
| 1016 | ap.a_rtvals = rtvals; |
| 1017 | ap.a_offset = offset; |
| 1018 | |
| 1019 | DO_OPS(ops, error, &ap, vop_putpages); |
| 1020 | return(error); |
| 1021 | } |
| 1022 | |
| 1023 | int |
| 1024 | vop_freeblks(struct vop_ops *ops, struct vnode *vp, |
| 1025 | daddr_t addr, daddr_t length) |
| 1026 | { |
| 1027 | struct vop_freeblks_args ap; |
| 1028 | int error; |
| 1029 | |
| 1030 | ap.a_head.a_desc = &vop_freeblks_desc; |
| 1031 | ap.a_head.a_ops = ops; |
| 1032 | ap.a_vp = vp; |
| 1033 | ap.a_addr = addr; |
| 1034 | ap.a_length = length; |
| 1035 | |
| 1036 | DO_OPS(ops, error, &ap, vop_freeblks); |
| 1037 | return(error); |
| 1038 | } |
| 1039 | |
| 1040 | int |
| 1041 | vop_bwrite(struct vop_ops *ops, struct vnode *vp, struct buf *bp) |
| 1042 | { |
| 1043 | struct vop_bwrite_args ap; |
| 1044 | int error; |
| 1045 | |
| 1046 | ap.a_head.a_desc = &vop_bwrite_desc; |
| 1047 | ap.a_head.a_ops = ops; |
| 1048 | ap.a_vp = vp; |
| 1049 | ap.a_bp = bp; |
| 1050 | |
| 1051 | DO_OPS(ops, error, &ap, vop_bwrite); |
| 1052 | return(error); |
| 1053 | } |
| 1054 | |
| 1055 | int |
| 1056 | vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, |
| 1057 | struct acl *aclp, struct ucred *cred, struct thread *td) |
| 1058 | { |
| 1059 | struct vop_getacl_args ap; |
| 1060 | int error; |
| 1061 | |
| 1062 | ap.a_head.a_desc = &vop_getacl_desc; |
| 1063 | ap.a_head.a_ops = ops; |
| 1064 | ap.a_vp = vp; |
| 1065 | ap.a_type = type; |
| 1066 | ap.a_aclp = aclp; |
| 1067 | ap.a_cred = cred; |
| 1068 | ap.a_td = td; |
| 1069 | |
| 1070 | DO_OPS(ops, error, &ap, vop_getacl); |
| 1071 | return(error); |
| 1072 | } |
| 1073 | |
| 1074 | int |
| 1075 | vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type, |
| 1076 | struct acl *aclp, struct ucred *cred, struct thread *td) |
| 1077 | { |
| 1078 | struct vop_setacl_args ap; |
| 1079 | int error; |
| 1080 | |
| 1081 | ap.a_head.a_desc = &vop_setacl_desc; |
| 1082 | ap.a_head.a_ops = ops; |
| 1083 | ap.a_vp = vp; |
| 1084 | ap.a_type = type; |
| 1085 | ap.a_aclp = aclp; |
| 1086 | ap.a_cred = cred; |
| 1087 | ap.a_td = td; |
| 1088 | |
| 1089 | DO_OPS(ops, error, &ap, vop_setacl); |
| 1090 | return(error); |
| 1091 | } |
| 1092 | |
| 1093 | int |
| 1094 | vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type, |
| 1095 | struct acl *aclp, struct ucred *cred, struct thread *td) |
| 1096 | { |
| 1097 | struct vop_aclcheck_args ap; |
| 1098 | int error; |
| 1099 | |
| 1100 | ap.a_head.a_desc = &vop_aclcheck_desc; |
| 1101 | ap.a_head.a_ops = ops; |
| 1102 | ap.a_vp = vp; |
| 1103 | ap.a_type = type; |
| 1104 | ap.a_aclp = aclp; |
| 1105 | ap.a_cred = cred; |
| 1106 | ap.a_td = td; |
| 1107 | |
| 1108 | DO_OPS(ops, error, &ap, vop_aclcheck); |
| 1109 | return(error); |
| 1110 | } |
| 1111 | |
| 1112 | int |
| 1113 | vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name, |
| 1114 | struct uio *uio, struct ucred *cred, struct thread *td) |
| 1115 | { |
| 1116 | struct vop_getextattr_args ap; |
| 1117 | int error; |
| 1118 | |
| 1119 | ap.a_head.a_desc = &vop_getextattr_desc; |
| 1120 | ap.a_head.a_ops = ops; |
| 1121 | ap.a_vp = vp; |
| 1122 | ap.a_name = name; |
| 1123 | ap.a_uio = uio; |
| 1124 | ap.a_cred = cred; |
| 1125 | ap.a_td = td; |
| 1126 | |
| 1127 | DO_OPS(ops, error, &ap, vop_getextattr); |
| 1128 | return(error); |
| 1129 | } |
| 1130 | |
| 1131 | int |
| 1132 | vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name, |
| 1133 | struct uio *uio, struct ucred *cred, struct thread *td) |
| 1134 | { |
| 1135 | struct vop_setextattr_args ap; |
| 1136 | int error; |
| 1137 | |
| 1138 | ap.a_head.a_desc = &vop_setextattr_desc; |
| 1139 | ap.a_head.a_ops = ops; |
| 1140 | ap.a_vp = vp; |
| 1141 | ap.a_name = name; |
| 1142 | ap.a_uio = uio; |
| 1143 | ap.a_cred = cred; |
| 1144 | ap.a_td = td; |
| 1145 | |
| 1146 | DO_OPS(ops, error, &ap, vop_setextattr); |
| 1147 | return(error); |
| 1148 | } |
| 1149 | |
| 1150 | int |
| 1151 | vop_createvobject(struct vop_ops *ops, struct vnode *vp, struct thread *td) |
| 1152 | { |
| 1153 | struct vop_createvobject_args ap; |
| 1154 | int error; |
| 1155 | |
| 1156 | ap.a_head.a_desc = &vop_createvobject_desc; |
| 1157 | ap.a_head.a_ops = ops; |
| 1158 | ap.a_vp = vp; |
| 1159 | ap.a_td = td; |
| 1160 | |
| 1161 | DO_OPS(ops, error, &ap, vop_createvobject); |
| 1162 | return(error); |
| 1163 | } |
| 1164 | |
| 1165 | int |
| 1166 | vop_destroyvobject(struct vop_ops *ops, struct vnode *vp) |
| 1167 | { |
| 1168 | struct vop_destroyvobject_args ap; |
| 1169 | int error; |
| 1170 | |
| 1171 | ap.a_head.a_desc = &vop_destroyvobject_desc; |
| 1172 | ap.a_head.a_ops = ops; |
| 1173 | ap.a_vp = vp; |
| 1174 | |
| 1175 | DO_OPS(ops, error, &ap, vop_destroyvobject); |
| 1176 | return(error); |
| 1177 | } |
| 1178 | |
| 1179 | int |
| 1180 | vop_getvobject(struct vop_ops *ops, struct vnode *vp, struct vm_object **objpp) |
| 1181 | { |
| 1182 | struct vop_getvobject_args ap; |
| 1183 | int error; |
| 1184 | |
| 1185 | ap.a_head.a_desc = &vop_getvobject_desc; |
| 1186 | ap.a_head.a_ops = ops; |
| 1187 | ap.a_vp = vp; |
| 1188 | ap.a_objpp = objpp; |
| 1189 | |
| 1190 | DO_OPS(ops, error, &ap, vop_getvobject); |
| 1191 | return(error); |
| 1192 | } |
| 1193 | |
| 1194 | int |
| 1195 | vop_vfsset(struct vop_ops *ops, int op, const char *opstr) |
| 1196 | { |
| 1197 | struct vop_vfsset_args ap; |
| 1198 | int error; |
| 1199 | |
| 1200 | ap.a_head.a_desc = &vop_vfsset_desc; |
| 1201 | ap.a_head.a_ops = ops; |
| 1202 | ap.a_op = op; |
| 1203 | ap.a_opstr = opstr; |
| 1204 | |
| 1205 | DO_OPS(ops, error, &ap, vop_vfsset); |
| 1206 | return(error); |
| 1207 | } |
| 1208 | |
| 1209 | /* |
| 1210 | * NEW API FUNCTIONS |
| 1211 | * |
| 1212 | * nresolve takes a locked ncp and a cred and resolves the ncp into a |
| 1213 | * positive or negative hit. |
| 1214 | * |
| 1215 | * The namecache is automatically adjusted by this function. The ncp |
| 1216 | * is left locked on return. |
| 1217 | */ |
| 1218 | int |
| 1219 | vop_nresolve(struct vop_ops *ops, struct namecache *ncp, struct ucred *cred) |
| 1220 | { |
| 1221 | struct vop_nresolve_args ap; |
| 1222 | int error; |
| 1223 | |
| 1224 | ap.a_head.a_desc = &vop_nresolve_desc; |
| 1225 | ap.a_head.a_ops = ops; |
| 1226 | ap.a_ncp = ncp; |
| 1227 | ap.a_cred = cred; |
| 1228 | |
| 1229 | DO_OPS(ops, error, &ap, vop_nresolve); |
| 1230 | return(error); |
| 1231 | } |
| 1232 | |
| 1233 | /* |
| 1234 | * nlookupdotdot takes an unlocked directory, dvp, and looks up "..", returning |
| 1235 | * a locked parent directory in *vpp. If an error occurs *vpp will be NULL. |
| 1236 | */ |
| 1237 | int |
| 1238 | vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp, |
| 1239 | struct vnode **vpp, struct ucred *cred) |
| 1240 | { |
| 1241 | struct vop_nlookupdotdot_args ap; |
| 1242 | int error; |
| 1243 | |
| 1244 | ap.a_head.a_desc = &vop_nlookupdotdot_desc; |
| 1245 | ap.a_head.a_ops = ops; |
| 1246 | ap.a_dvp = dvp; |
| 1247 | ap.a_vpp = vpp; |
| 1248 | ap.a_cred = cred; |
| 1249 | |
| 1250 | DO_OPS(ops, error, &ap, vop_nlookupdotdot); |
| 1251 | return(error); |
| 1252 | } |
| 1253 | |
| 1254 | /* |
| 1255 | * ncreate takes a locked, resolved ncp that typically represents a negative |
| 1256 | * cache hit and creates the file or node specified by the ncp, cred, and |
| 1257 | * vattr. If no error occurs a locked vnode is returned in *vpp. |
| 1258 | * |
| 1259 | * The namecache is automatically adjusted by this function. The ncp |
| 1260 | * is left locked on return. |
| 1261 | */ |
| 1262 | int |
| 1263 | vop_ncreate(struct vop_ops *ops, struct namecache *ncp, |
| 1264 | struct vnode **vpp, struct ucred *cred, struct vattr *vap) |
| 1265 | { |
| 1266 | struct vop_ncreate_args ap; |
| 1267 | int error; |
| 1268 | |
| 1269 | ap.a_head.a_desc = &vop_ncreate_desc; |
| 1270 | ap.a_head.a_ops = ops; |
| 1271 | ap.a_ncp = ncp; |
| 1272 | ap.a_vpp = vpp; |
| 1273 | ap.a_cred = cred; |
| 1274 | ap.a_vap = vap; |
| 1275 | |
| 1276 | DO_OPS(ops, error, &ap, vop_ncreate); |
| 1277 | return(error); |
| 1278 | } |
| 1279 | |
| 1280 | /* |
| 1281 | * nmkdir takes a locked, resolved ncp that typically represents a negative |
| 1282 | * cache hit and creates the directory specified by the ncp, cred, and |
| 1283 | * vattr. If no error occurs a locked vnode is returned in *vpp. |
| 1284 | * |
| 1285 | * The namecache is automatically adjusted by this function. The ncp |
| 1286 | * is left locked on return. |
| 1287 | */ |
| 1288 | int |
| 1289 | vop_nmkdir(struct vop_ops *ops, struct namecache *ncp, |
| 1290 | struct vnode **vpp, struct ucred *cred, struct vattr *vap) |
| 1291 | { |
| 1292 | struct vop_nmkdir_args ap; |
| 1293 | int error; |
| 1294 | |
| 1295 | ap.a_head.a_desc = &vop_nmkdir_desc; |
| 1296 | ap.a_head.a_ops = ops; |
| 1297 | ap.a_ncp = ncp; |
| 1298 | ap.a_vpp = vpp; |
| 1299 | ap.a_cred = cred; |
| 1300 | ap.a_vap = vap; |
| 1301 | |
| 1302 | DO_OPS(ops, error, &ap, vop_nmkdir); |
| 1303 | return(error); |
| 1304 | } |
| 1305 | |
| 1306 | /* |
| 1307 | * nmknod takes a locked, resolved ncp that typically represents a negative |
| 1308 | * cache hit and creates the node specified by the ncp, cred, and |
| 1309 | * vattr. If no error occurs a locked vnode is returned in *vpp. |
| 1310 | * |
| 1311 | * The namecache is automatically adjusted by this function. The ncp |
| 1312 | * is left locked on return. |
| 1313 | */ |
| 1314 | int |
| 1315 | vop_nmknod(struct vop_ops *ops, struct namecache *ncp, |
| 1316 | struct vnode **vpp, struct ucred *cred, struct vattr *vap) |
| 1317 | { |
| 1318 | struct vop_nmknod_args ap; |
| 1319 | int error; |
| 1320 | |
| 1321 | ap.a_head.a_desc = &vop_nmknod_desc; |
| 1322 | ap.a_head.a_ops = ops; |
| 1323 | ap.a_ncp = ncp; |
| 1324 | ap.a_vpp = vpp; |
| 1325 | ap.a_cred = cred; |
| 1326 | ap.a_vap = vap; |
| 1327 | |
| 1328 | DO_OPS(ops, error, &ap, vop_nmknod); |
| 1329 | return(error); |
| 1330 | } |
| 1331 | |
| 1332 | /* |
| 1333 | * nlink takes a locked, resolved ncp that typically represents a negative |
| 1334 | * cache hit and creates the node specified by the ncp, cred, and |
| 1335 | * existing vnode. The passed vp must be locked and will remain locked |
| 1336 | * on return, as does the ncp, whether an error occurs or not. |
| 1337 | * |
| 1338 | * The namecache is automatically adjusted by this function. The ncp |
| 1339 | * is left locked on return. |
| 1340 | */ |
| 1341 | int |
| 1342 | vop_nlink(struct vop_ops *ops, struct namecache *ncp, |
| 1343 | struct vnode *vp, struct ucred *cred) |
| 1344 | { |
| 1345 | struct vop_nlink_args ap; |
| 1346 | int error; |
| 1347 | |
| 1348 | ap.a_head.a_desc = &vop_nlink_desc; |
| 1349 | ap.a_head.a_ops = ops; |
| 1350 | ap.a_ncp = ncp; |
| 1351 | ap.a_vp = vp; |
| 1352 | ap.a_cred = cred; |
| 1353 | |
| 1354 | DO_OPS(ops, error, &ap, vop_nlink); |
| 1355 | return(error); |
| 1356 | } |
| 1357 | |
| 1358 | /* |
| 1359 | * nsymlink takes a locked, resolved ncp that typically represents a negative |
| 1360 | * cache hit and creates a symbolic link based on cred, vap, and target (the |
| 1361 | * contents of the link). If no error occurs a locked vnode is returned in |
| 1362 | * *vpp. |
| 1363 | * |
| 1364 | * The namecache is automatically adjusted by this function. The ncp |
| 1365 | * is left locked on return. |
| 1366 | */ |
| 1367 | int |
| 1368 | vop_nsymlink(struct vop_ops *ops, struct namecache *ncp, |
| 1369 | struct vnode **vpp, struct ucred *cred, |
| 1370 | struct vattr *vap, char *target) |
| 1371 | { |
| 1372 | struct vop_nsymlink_args ap; |
| 1373 | int error; |
| 1374 | |
| 1375 | ap.a_head.a_desc = &vop_nsymlink_desc; |
| 1376 | ap.a_head.a_ops = ops; |
| 1377 | ap.a_ncp = ncp; |
| 1378 | ap.a_vpp = vpp; |
| 1379 | ap.a_cred = cred; |
| 1380 | ap.a_vap = vap; |
| 1381 | ap.a_target = target; |
| 1382 | |
| 1383 | DO_OPS(ops, error, &ap, vop_nsymlink); |
| 1384 | return(error); |
| 1385 | } |
| 1386 | |
| 1387 | /* |
| 1388 | * nwhiteout takes a locked, resolved ncp that can represent a positive or |
| 1389 | * negative hit and executes the whiteout function specified in flags. |
| 1390 | * |
| 1391 | * The namecache is automatically adjusted by this function. The ncp |
| 1392 | * is left locked on return. |
| 1393 | */ |
| 1394 | int |
| 1395 | vop_nwhiteout(struct vop_ops *ops, struct namecache *ncp, |
| 1396 | struct ucred *cred, int flags) |
| 1397 | { |
| 1398 | struct vop_nwhiteout_args ap; |
| 1399 | int error; |
| 1400 | |
| 1401 | ap.a_head.a_desc = &vop_nwhiteout_desc; |
| 1402 | ap.a_head.a_ops = ops; |
| 1403 | ap.a_ncp = ncp; |
| 1404 | ap.a_cred = cred; |
| 1405 | ap.a_flags = flags; |
| 1406 | |
| 1407 | DO_OPS(ops, error, &ap, vop_nwhiteout); |
| 1408 | return(error); |
| 1409 | } |
| 1410 | |
| 1411 | /* |
| 1412 | * nremove takes a locked, resolved ncp that generally represents a |
| 1413 | * positive hit and removes the file. |
| 1414 | * |
| 1415 | * The namecache is automatically adjusted by this function. The ncp |
| 1416 | * is left locked on return. |
| 1417 | */ |
| 1418 | int |
| 1419 | vop_nremove(struct vop_ops *ops, struct namecache *ncp, struct ucred *cred) |
| 1420 | { |
| 1421 | struct vop_nremove_args ap; |
| 1422 | int error; |
| 1423 | |
| 1424 | ap.a_head.a_desc = &vop_nremove_desc; |
| 1425 | ap.a_head.a_ops = ops; |
| 1426 | ap.a_ncp = ncp; |
| 1427 | ap.a_cred = cred; |
| 1428 | |
| 1429 | DO_OPS(ops, error, &ap, vop_nremove); |
| 1430 | return(error); |
| 1431 | } |
| 1432 | |
| 1433 | /* |
| 1434 | * nrmdir takes a locked, resolved ncp that generally represents a |
| 1435 | * directory and removes the directory. |
| 1436 | * |
| 1437 | * The namecache is automatically adjusted by this function. The ncp |
| 1438 | * is left locked on return. |
| 1439 | */ |
| 1440 | int |
| 1441 | vop_nrmdir(struct vop_ops *ops, struct namecache *ncp, struct ucred *cred) |
| 1442 | { |
| 1443 | struct vop_nrmdir_args ap; |
| 1444 | int error; |
| 1445 | |
| 1446 | ap.a_head.a_desc = &vop_nrmdir_desc; |
| 1447 | ap.a_head.a_ops = ops; |
| 1448 | ap.a_ncp = ncp; |
| 1449 | ap.a_cred = cred; |
| 1450 | |
| 1451 | DO_OPS(ops, error, &ap, vop_nrmdir); |
| 1452 | return(error); |
| 1453 | } |
| 1454 | |
| 1455 | /* |
| 1456 | * nrename takes TWO locked, resolved ncp's and the cred of the caller |
| 1457 | * and renames the source ncp to the target ncp. The target ncp may |
| 1458 | * represent a positive or negative hit. |
| 1459 | * |
| 1460 | * The namecache is automatically adjusted by this function. The ncp |
| 1461 | * is left locked on return. The source ncp is typically changed to |
| 1462 | * a negative cache hit and the target ncp typically takes on the |
| 1463 | * source ncp's underlying file. |
| 1464 | */ |
| 1465 | int |
| 1466 | vop_nrename(struct vop_ops *ops, struct namecache *fncp, |
| 1467 | struct namecache *tncp, struct ucred *cred) |
| 1468 | { |
| 1469 | struct vop_nrename_args ap; |
| 1470 | int error; |
| 1471 | |
| 1472 | ap.a_head.a_desc = &vop_nrename_desc; |
| 1473 | ap.a_head.a_ops = ops; |
| 1474 | ap.a_fncp = fncp; |
| 1475 | ap.a_tncp = tncp; |
| 1476 | ap.a_cred = cred; |
| 1477 | |
| 1478 | DO_OPS(ops, error, &ap, vop_nrename); |
| 1479 | return(error); |
| 1480 | } |
| 1481 | |
| 1482 | /************************************************************************ |
| 1483 | * PRIMARY VNODE OPERATIONS FORWARDING CALLS * |
| 1484 | ************************************************************************ |
| 1485 | * |
| 1486 | * These procedures are called from VFSs such as unionfs and nullfs |
| 1487 | * when they wish to forward an operation on one VFS to another. The |
| 1488 | * argument structure/message is modified and then directly passed to the |
| 1489 | * appropriate routine. This routines may also be called by initiators |
| 1490 | * who have an argument structure in hand rather then discreet arguments. |
| 1491 | */ |
| 1492 | int |
| 1493 | vop_vnoperate_ap(struct vop_generic_args *ap) |
| 1494 | { |
| 1495 | struct vop_ops *ops; |
| 1496 | int error; |
| 1497 | |
| 1498 | ops = ap->a_ops; |
| 1499 | if (ops->vv_flags & VVF_HOOK_MASK) { |
| 1500 | if (ops->vv_flags & VVF_JOURNAL_HOOK) |
| 1501 | error = VOCALL(ops->vv_jops, ap); |
| 1502 | else |
| 1503 | error = 0; |
| 1504 | if (error == 0) |
| 1505 | error = VOCALL(ops, ap); |
| 1506 | } else { |
| 1507 | error = VOCALL(ops, ap); |
| 1508 | } |
| 1509 | return (error); |
| 1510 | } |
| 1511 | |
| 1512 | int |
| 1513 | vop_islocked_ap(struct vop_islocked_args *ap) |
| 1514 | { |
| 1515 | int error; |
| 1516 | |
| 1517 | DO_OPS(ap->a_head.a_ops, error, ap, vop_islocked); |
| 1518 | return(error); |
| 1519 | } |
| 1520 | |
| 1521 | int |
| 1522 | vop_lookup_ap(struct vop_lookup_args *ap) |
| 1523 | { |
| 1524 | int error; |
| 1525 | |
| 1526 | DO_OPS(ap->a_head.a_ops, error, ap, vop_lookup); |
| 1527 | return(error); |
| 1528 | } |
| 1529 | |
| 1530 | int |
| 1531 | vop_create_ap(struct vop_create_args *ap) |
| 1532 | { |
| 1533 | int error; |
| 1534 | |
| 1535 | DO_OPS(ap->a_head.a_ops, error, ap, vop_create); |
| 1536 | return(error); |
| 1537 | } |
| 1538 | |
| 1539 | int |
| 1540 | vop_whiteout_ap(struct vop_whiteout_args *ap) |
| 1541 | { |
| 1542 | int error; |
| 1543 | |
| 1544 | DO_OPS(ap->a_head.a_ops, error, ap, vop_whiteout); |
| 1545 | return(error); |
| 1546 | } |
| 1547 | |
| 1548 | int |
| 1549 | vop_mknod_ap(struct vop_mknod_args *ap) |
| 1550 | { |
| 1551 | int error; |
| 1552 | |
| 1553 | DO_OPS(ap->a_head.a_ops, error, ap, vop_mknod); |
| 1554 | return(error); |
| 1555 | } |
| 1556 | |
| 1557 | int |
| 1558 | vop_open_ap(struct vop_open_args *ap) |
| 1559 | { |
| 1560 | int error; |
| 1561 | |
| 1562 | DO_OPS(ap->a_head.a_ops, error, ap, vop_open); |
| 1563 | return(error); |
| 1564 | } |
| 1565 | |
| 1566 | int |
| 1567 | vop_close_ap(struct vop_close_args *ap) |
| 1568 | { |
| 1569 | int error; |
| 1570 | |
| 1571 | DO_OPS(ap->a_head.a_ops, error, ap, vop_close); |
| 1572 | return(error); |
| 1573 | } |
| 1574 | |
| 1575 | int |
| 1576 | vop_access_ap(struct vop_access_args *ap) |
| 1577 | { |
| 1578 | int error; |
| 1579 | |
| 1580 | DO_OPS(ap->a_head.a_ops, error, ap, vop_access); |
| 1581 | return(error); |
| 1582 | } |
| 1583 | |
| 1584 | int |
| 1585 | vop_getattr_ap(struct vop_getattr_args *ap) |
| 1586 | { |
| 1587 | int error; |
| 1588 | |
| 1589 | DO_OPS(ap->a_head.a_ops, error, ap, vop_getattr); |
| 1590 | return(error); |
| 1591 | } |
| 1592 | |
| 1593 | int |
| 1594 | vop_setattr_ap(struct vop_setattr_args *ap) |
| 1595 | { |
| 1596 | int error; |
| 1597 | |
| 1598 | DO_OPS(ap->a_head.a_ops, error, ap, vop_setattr); |
| 1599 | return(error); |
| 1600 | } |
| 1601 | |
| 1602 | int |
| 1603 | vop_read_ap(struct vop_read_args *ap) |
| 1604 | { |
| 1605 | int error; |
| 1606 | |
| 1607 | DO_OPS(ap->a_head.a_ops, error, ap, vop_read); |
| 1608 | return(error); |
| 1609 | } |
| 1610 | |
| 1611 | int |
| 1612 | vop_write_ap(struct vop_write_args *ap) |
| 1613 | { |
| 1614 | int error; |
| 1615 | |
| 1616 | DO_OPS(ap->a_head.a_ops, error, ap, vop_write); |
| 1617 | return(error); |
| 1618 | } |
| 1619 | |
| 1620 | int |
| 1621 | vop_lease_ap(struct vop_lease_args *ap) |
| 1622 | { |
| 1623 | int error; |
| 1624 | |
| 1625 | DO_OPS(ap->a_head.a_ops, error, ap, vop_lease); |
| 1626 | return(error); |
| 1627 | } |
| 1628 | |
| 1629 | int |
| 1630 | vop_ioctl_ap(struct vop_ioctl_args *ap) |
| 1631 | { |
| 1632 | int error; |
| 1633 | |
| 1634 | DO_OPS(ap->a_head.a_ops, error, ap, vop_ioctl); |
| 1635 | return(error); |
| 1636 | } |
| 1637 | |
| 1638 | int |
| 1639 | vop_poll_ap(struct vop_poll_args *ap) |
| 1640 | { |
| 1641 | int error; |
| 1642 | |
| 1643 | DO_OPS(ap->a_head.a_ops, error, ap, vop_poll); |
| 1644 | return(error); |
| 1645 | } |
| 1646 | |
| 1647 | int |
| 1648 | vop_kqfilter_ap(struct vop_kqfilter_args *ap) |
| 1649 | { |
| 1650 | int error; |
| 1651 | |
| 1652 | DO_OPS(ap->a_head.a_ops, error, ap, vop_kqfilter); |
| 1653 | return(error); |
| 1654 | } |
| 1655 | |
| 1656 | int |
| 1657 | vop_revoke_ap(struct vop_revoke_args *ap) |
| 1658 | { |
| 1659 | int error; |
| 1660 | |
| 1661 | DO_OPS(ap->a_head.a_ops, error, ap, vop_revoke); |
| 1662 | return(error); |
| 1663 | } |
| 1664 | |
| 1665 | int |
| 1666 | vop_mmap_ap(struct vop_mmap_args *ap) |
| 1667 | { |
| 1668 | int error; |
| 1669 | |
| 1670 | DO_OPS(ap->a_head.a_ops, error, ap, vop_mmap); |
| 1671 | return(error); |
| 1672 | } |
| 1673 | |
| 1674 | int |
| 1675 | vop_fsync_ap(struct vop_fsync_args *ap) |
| 1676 | { |
| 1677 | int error; |
| 1678 | |
| 1679 | DO_OPS(ap->a_head.a_ops, error, ap, vop_fsync); |
| 1680 | return(error); |
| 1681 | } |
| 1682 | |
| 1683 | int |
| 1684 | vop_remove_ap(struct vop_remove_args *ap) |
| 1685 | { |
| 1686 | int error; |
| 1687 | |
| 1688 | DO_OPS(ap->a_head.a_ops, error, ap, vop_remove); |
| 1689 | return(error); |
| 1690 | } |
| 1691 | |
| 1692 | int |
| 1693 | vop_link_ap(struct vop_link_args *ap) |
| 1694 | { |
| 1695 | int error; |
| 1696 | |
| 1697 | DO_OPS(ap->a_head.a_ops, error, ap, vop_link); |
| 1698 | return(error); |
| 1699 | } |
| 1700 | |
| 1701 | int |
| 1702 | vop_rename_ap(struct vop_rename_args *ap) |
| 1703 | { |
| 1704 | int error; |
| 1705 | |
| 1706 | DO_OPS(ap->a_head.a_ops, error, ap, vop_rename); |
| 1707 | return(error); |
| 1708 | } |
| 1709 | |
| 1710 | int |
| 1711 | vop_mkdir_ap(struct vop_mkdir_args *ap) |
| 1712 | { |
| 1713 | int error; |
| 1714 | |
| 1715 | DO_OPS(ap->a_head.a_ops, error, ap, vop_mkdir); |
| 1716 | return(error); |
| 1717 | } |
| 1718 | |
| 1719 | int |
| 1720 | vop_rmdir_ap(struct vop_rmdir_args *ap) |
| 1721 | { |
| 1722 | int error; |
| 1723 | |
| 1724 | DO_OPS(ap->a_head.a_ops, error, ap, vop_rmdir); |
| 1725 | return(error); |
| 1726 | } |
| 1727 | |
| 1728 | int |
| 1729 | vop_symlink_ap(struct vop_symlink_args *ap) |
| 1730 | { |
| 1731 | int error; |
| 1732 | |
| 1733 | DO_OPS(ap->a_head.a_ops, error, ap, vop_symlink); |
| 1734 | return(error); |
| 1735 | } |
| 1736 | |
| 1737 | int |
| 1738 | vop_readdir_ap(struct vop_readdir_args *ap) |
| 1739 | { |
| 1740 | int error; |
| 1741 | |
| 1742 | DO_OPS(ap->a_head.a_ops, error, ap, vop_readdir); |
| 1743 | return(error); |
| 1744 | } |
| 1745 | |
| 1746 | int |
| 1747 | vop_readlink_ap(struct vop_readlink_args *ap) |
| 1748 | { |
| 1749 | int error; |
| 1750 | |
| 1751 | DO_OPS(ap->a_head.a_ops, error, ap, vop_readlink); |
| 1752 | return(error); |
| 1753 | } |
| 1754 | |
| 1755 | int |
| 1756 | vop_inactive_ap(struct vop_inactive_args *ap) |
| 1757 | { |
| 1758 | int error; |
| 1759 | |
| 1760 | DO_OPS(ap->a_head.a_ops, error, ap, vop_inactive); |
| 1761 | return(error); |
| 1762 | } |
| 1763 | |
| 1764 | int |
| 1765 | vop_reclaim_ap(struct vop_reclaim_args *ap) |
| 1766 | { |
| 1767 | int error; |
| 1768 | |
| 1769 | DO_OPS(ap->a_head.a_ops, error, ap, vop_reclaim); |
| 1770 | return(error); |
| 1771 | } |
| 1772 | |
| 1773 | int |
| 1774 | vop_lock_ap(struct vop_lock_args *ap) |
| 1775 | { |
| 1776 | int error; |
| 1777 | |
| 1778 | DO_OPS(ap->a_head.a_ops, error, ap, vop_lock); |
| 1779 | return(error); |
| 1780 | } |
| 1781 | |
| 1782 | int |
| 1783 | vop_unlock_ap(struct vop_unlock_args *ap) |
| 1784 | { |
| 1785 | int error; |
| 1786 | |
| 1787 | DO_OPS(ap->a_head.a_ops, error, ap, vop_unlock); |
| 1788 | return(error); |
| 1789 | } |
| 1790 | |
| 1791 | int |
| 1792 | vop_bmap_ap(struct vop_bmap_args *ap) |
| 1793 | { |
| 1794 | int error; |
| 1795 | |
| 1796 | DO_OPS(ap->a_head.a_ops, error, ap, vop_bmap); |
| 1797 | return(error); |
| 1798 | } |
| 1799 | |
| 1800 | int |
| 1801 | vop_strategy_ap(struct vop_strategy_args *ap) |
| 1802 | { |
| 1803 | int error; |
| 1804 | |
| 1805 | DO_OPS(ap->a_head.a_ops, error, ap, vop_strategy); |
| 1806 | return(error); |
| 1807 | } |
| 1808 | |
| 1809 | int |
| 1810 | vop_print_ap(struct vop_print_args *ap) |
| 1811 | { |
| 1812 | int error; |
| 1813 | |
| 1814 | DO_OPS(ap->a_head.a_ops, error, ap, vop_print); |
| 1815 | return(error); |
| 1816 | } |
| 1817 | |
| 1818 | int |
| 1819 | vop_pathconf_ap(struct vop_pathconf_args *ap) |
| 1820 | { |
| 1821 | int error; |
| 1822 | |
| 1823 | DO_OPS(ap->a_head.a_ops, error, ap, vop_pathconf); |
| 1824 | return(error); |
| 1825 | } |
| 1826 | |
| 1827 | int |
| 1828 | vop_advlock_ap(struct vop_advlock_args *ap) |
| 1829 | { |
| 1830 | int error; |
| 1831 | |
| 1832 | DO_OPS(ap->a_head.a_ops, error, ap, vop_advlock); |
| 1833 | return(error); |
| 1834 | } |
| 1835 | |
| 1836 | int |
| 1837 | vop_balloc_ap(struct vop_balloc_args *ap) |
| 1838 | { |
| 1839 | int error; |
| 1840 | |
| 1841 | DO_OPS(ap->a_head.a_ops, error, ap, vop_balloc); |
| 1842 | return(error); |
| 1843 | } |
| 1844 | |
| 1845 | int |
| 1846 | vop_reallocblks_ap(struct vop_reallocblks_args *ap) |
| 1847 | { |
| 1848 | int error; |
| 1849 | |
| 1850 | DO_OPS(ap->a_head.a_ops, error, ap, vop_reallocblks); |
| 1851 | return(error); |
| 1852 | } |
| 1853 | |
| 1854 | int |
| 1855 | vop_getpages_ap(struct vop_getpages_args *ap) |
| 1856 | { |
| 1857 | int error; |
| 1858 | |
| 1859 | DO_OPS(ap->a_head.a_ops, error, ap, vop_getpages); |
| 1860 | return(error); |
| 1861 | } |
| 1862 | |
| 1863 | int |
| 1864 | vop_putpages_ap(struct vop_putpages_args *ap) |
| 1865 | { |
| 1866 | int error; |
| 1867 | |
| 1868 | DO_OPS(ap->a_head.a_ops, error, ap, vop_putpages); |
| 1869 | return(error); |
| 1870 | } |
| 1871 | |
| 1872 | int |
| 1873 | vop_freeblks_ap(struct vop_freeblks_args *ap) |
| 1874 | { |
| 1875 | int error; |
| 1876 | |
| 1877 | DO_OPS(ap->a_head.a_ops, error, ap, vop_freeblks); |
| 1878 | return(error); |
| 1879 | } |
| 1880 | |
| 1881 | int |
| 1882 | vop_bwrite_ap(struct vop_bwrite_args *ap) |
| 1883 | { |
| 1884 | int error; |
| 1885 | |
| 1886 | DO_OPS(ap->a_head.a_ops, error, ap, vop_bwrite); |
| 1887 | return(error); |
| 1888 | } |
| 1889 | |
| 1890 | int |
| 1891 | vop_getacl_ap(struct vop_getacl_args *ap) |
| 1892 | { |
| 1893 | int error; |
| 1894 | |
| 1895 | DO_OPS(ap->a_head.a_ops, error, ap, vop_getacl); |
| 1896 | return(error); |
| 1897 | } |
| 1898 | |
| 1899 | int |
| 1900 | vop_setacl_ap(struct vop_setacl_args *ap) |
| 1901 | { |
| 1902 | int error; |
| 1903 | |
| 1904 | DO_OPS(ap->a_head.a_ops, error, ap, vop_setacl); |
| 1905 | return(error); |
| 1906 | } |
| 1907 | |
| 1908 | int |
| 1909 | vop_aclcheck_ap(struct vop_aclcheck_args *ap) |
| 1910 | { |
| 1911 | int error; |
| 1912 | |
| 1913 | DO_OPS(ap->a_head.a_ops, error, ap, vop_aclcheck); |
| 1914 | return(error); |
| 1915 | } |
| 1916 | |
| 1917 | int |
| 1918 | vop_getextattr_ap(struct vop_getextattr_args *ap) |
| 1919 | { |
| 1920 | int error; |
| 1921 | |
| 1922 | DO_OPS(ap->a_head.a_ops, error, ap, vop_getextattr); |
| 1923 | return(error); |
| 1924 | } |
| 1925 | |
| 1926 | int |
| 1927 | vop_setextattr_ap(struct vop_setextattr_args *ap) |
| 1928 | { |
| 1929 | int error; |
| 1930 | |
| 1931 | DO_OPS(ap->a_head.a_ops, error, ap, vop_setextattr); |
| 1932 | return(error); |
| 1933 | } |
| 1934 | |
| 1935 | int |
| 1936 | vop_createvobject_ap(struct vop_createvobject_args *ap) |
| 1937 | { |
| 1938 | int error; |
| 1939 | |
| 1940 | DO_OPS(ap->a_head.a_ops, error, ap, vop_createvobject); |
| 1941 | return(error); |
| 1942 | } |
| 1943 | |
| 1944 | int |
| 1945 | vop_destroyvobject_ap(struct vop_destroyvobject_args *ap) |
| 1946 | { |
| 1947 | int error; |
| 1948 | |
| 1949 | DO_OPS(ap->a_head.a_ops, error, ap, vop_destroyvobject); |
| 1950 | return(error); |
| 1951 | } |
| 1952 | |
| 1953 | int |
| 1954 | vop_getvobject_ap(struct vop_getvobject_args *ap) |
| 1955 | { |
| 1956 | int error; |
| 1957 | |
| 1958 | DO_OPS(ap->a_head.a_ops, error, ap, vop_getvobject); |
| 1959 | return(error); |
| 1960 | } |
| 1961 | |
| 1962 | int |
| 1963 | vop_vfsset_ap(struct vop_vfsset_args *ap) |
| 1964 | { |
| 1965 | int error; |
| 1966 | |
| 1967 | DO_OPS(ap->a_head.a_ops, error, ap, vop_vfsset); |
| 1968 | return(error); |
| 1969 | } |
| 1970 | |
| 1971 | int |
| 1972 | vop_nresolve_ap(struct vop_nresolve_args *ap) |
| 1973 | { |
| 1974 | int error; |
| 1975 | |
| 1976 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nresolve); |
| 1977 | return(error); |
| 1978 | } |
| 1979 | |
| 1980 | int |
| 1981 | vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap) |
| 1982 | { |
| 1983 | int error; |
| 1984 | |
| 1985 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nlookupdotdot); |
| 1986 | return(error); |
| 1987 | } |
| 1988 | |
| 1989 | int |
| 1990 | vop_ncreate_ap(struct vop_ncreate_args *ap) |
| 1991 | { |
| 1992 | int error; |
| 1993 | |
| 1994 | DO_OPS(ap->a_head.a_ops, error, ap, vop_ncreate); |
| 1995 | return(error); |
| 1996 | } |
| 1997 | |
| 1998 | int |
| 1999 | vop_nmkdir_ap(struct vop_nmkdir_args *ap) |
| 2000 | { |
| 2001 | int error; |
| 2002 | |
| 2003 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nmkdir); |
| 2004 | return(error); |
| 2005 | } |
| 2006 | |
| 2007 | int |
| 2008 | vop_nmknod_ap(struct vop_nmknod_args *ap) |
| 2009 | { |
| 2010 | int error; |
| 2011 | |
| 2012 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nmknod); |
| 2013 | return(error); |
| 2014 | } |
| 2015 | |
| 2016 | int |
| 2017 | vop_nlink_ap(struct vop_nlink_args *ap) |
| 2018 | { |
| 2019 | int error; |
| 2020 | |
| 2021 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nlink); |
| 2022 | return(error); |
| 2023 | } |
| 2024 | |
| 2025 | int |
| 2026 | vop_nsymlink_ap(struct vop_nsymlink_args *ap) |
| 2027 | { |
| 2028 | int error; |
| 2029 | |
| 2030 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nsymlink); |
| 2031 | return(error); |
| 2032 | } |
| 2033 | |
| 2034 | int |
| 2035 | vop_nwhiteout_ap(struct vop_nwhiteout_args *ap) |
| 2036 | { |
| 2037 | int error; |
| 2038 | |
| 2039 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nwhiteout); |
| 2040 | return(error); |
| 2041 | } |
| 2042 | |
| 2043 | int |
| 2044 | vop_nremove_ap(struct vop_nremove_args *ap) |
| 2045 | { |
| 2046 | int error; |
| 2047 | |
| 2048 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nremove); |
| 2049 | return(error); |
| 2050 | } |
| 2051 | |
| 2052 | int |
| 2053 | vop_nrmdir_ap(struct vop_nrmdir_args *ap) |
| 2054 | { |
| 2055 | int error; |
| 2056 | |
| 2057 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nrmdir); |
| 2058 | return(error); |
| 2059 | } |
| 2060 | |
| 2061 | int |
| 2062 | vop_nrename_ap(struct vop_nrename_args *ap) |
| 2063 | { |
| 2064 | int error; |
| 2065 | |
| 2066 | DO_OPS(ap->a_head.a_ops, error, ap, vop_nrename); |
| 2067 | return(error); |
| 2068 | } |
| 2069 | |