63 64static vop_setattr_t cd9660_setattr; 65static vop_open_t cd9660_open; 66static vop_access_t cd9660_access; 67static vop_getattr_t cd9660_getattr; 68static vop_ioctl_t cd9660_ioctl; 69static vop_pathconf_t cd9660_pathconf; 70static vop_read_t cd9660_read; 71struct isoreaddir; 72static int iso_uiodir(struct isoreaddir *idp, struct dirent *dp, off_t off); 73static int iso_shipdir(struct isoreaddir *idp); 74static vop_readdir_t cd9660_readdir; 75static vop_readlink_t cd9660_readlink; 76static vop_strategy_t cd9660_strategy; 77 78/* 79 * Setattr call. Only allowed for block and character special devices. 80 */ 81static int 82cd9660_setattr(ap) 83 struct vop_setattr_args /* { 84 struct vnodeop_desc *a_desc; 85 struct vnode *a_vp; 86 struct vattr *a_vap; 87 struct ucred *a_cred; 88 struct thread *a_td; 89 } */ *ap; 90{ 91 struct vnode *vp = ap->a_vp; 92 struct vattr *vap = ap->a_vap; 93 94 if (vap->va_flags != (u_long)VNOVAL || vap->va_uid != (uid_t)VNOVAL || 95 vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || 96 vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) 97 return (EROFS); 98 if (vap->va_size != (u_quad_t)VNOVAL) { 99 switch (vp->v_type) { 100 case VDIR: 101 return (EISDIR); 102 case VLNK: 103 case VREG: 104 return (EROFS); 105 case VCHR: 106 case VBLK: 107 case VSOCK: 108 case VFIFO: 109 case VNON: 110 case VBAD: 111 case VMARKER: 112 return (0); 113 } 114 } 115 return (0); 116} 117 118/* 119 * Check mode permission on inode pointer. Mode is READ, WRITE or EXEC. 120 * The mode is shifted to select the owner/group/other fields. The 121 * super user is granted all permissions. 122 */ 123/* ARGSUSED */ 124static int 125cd9660_access(ap) 126 struct vop_access_args /* { 127 struct vnode *a_vp; 128 int a_mode; 129 struct ucred *a_cred; 130 struct thread *a_td; 131 } */ *ap; 132{ 133 struct vnode *vp = ap->a_vp; 134 struct iso_node *ip = VTOI(vp); 135 mode_t mode = ap->a_mode; 136 137 if (vp->v_type == VCHR || vp->v_type == VBLK) 138 return (EOPNOTSUPP); 139 140 /* 141 * Disallow write attempts unless the file is a socket, 142 * fifo, or a block or character device resident on the 143 * filesystem. 144 */ 145 if (mode & VWRITE) { 146 switch (vp->v_type) { 147 case VDIR: 148 case VLNK: 149 case VREG: 150 return (EROFS); 151 /* NOT REACHED */ 152 default: 153 break; 154 } 155 } 156 157 return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, 158 ip->inode.iso_gid, ap->a_mode, ap->a_cred, NULL)); 159} 160 161static int 162cd9660_open(ap) 163 struct vop_open_args /* { 164 struct vnode *a_vp; 165 int a_mode; 166 struct ucred *a_cred; 167 struct thread *a_td; 168 int a_fdidx; 169 } */ *ap; 170{ 171 struct iso_node *ip = VTOI(ap->a_vp); 172 173 vnode_create_vobject(ap->a_vp, ip->i_size, ap->a_td); 174 return 0; 175} 176 177 178static int 179cd9660_getattr(ap) 180 struct vop_getattr_args /* { 181 struct vnode *a_vp; 182 struct vattr *a_vap; 183 struct ucred *a_cred; 184 struct thread *a_td; 185 } */ *ap; 186 187{ 188 struct vnode *vp = ap->a_vp; 189 struct vattr *vap = ap->a_vap; 190 struct iso_node *ip = VTOI(vp); 191 192 vap->va_fsid = dev2udev(ip->i_mnt->im_dev); 193 vap->va_fileid = ip->i_number; 194 195 vap->va_mode = ip->inode.iso_mode; 196 vap->va_nlink = ip->inode.iso_links; 197 vap->va_uid = ip->inode.iso_uid; 198 vap->va_gid = ip->inode.iso_gid; 199 vap->va_atime = ip->inode.iso_atime; 200 vap->va_mtime = ip->inode.iso_mtime; 201 vap->va_ctime = ip->inode.iso_ctime; 202 vap->va_rdev = ip->inode.iso_rdev; 203 204 vap->va_size = (u_quad_t) ip->i_size; 205 if (ip->i_size == 0 && (vap->va_mode & S_IFMT) == S_IFLNK) { 206 struct vop_readlink_args rdlnk; 207 struct iovec aiov; 208 struct uio auio; 209 char *cp; 210 211 MALLOC(cp, char *, MAXPATHLEN, M_TEMP, M_WAITOK); 212 aiov.iov_base = cp; 213 aiov.iov_len = MAXPATHLEN; 214 auio.uio_iov = &aiov; 215 auio.uio_iovcnt = 1; 216 auio.uio_offset = 0; 217 auio.uio_rw = UIO_READ; 218 auio.uio_segflg = UIO_SYSSPACE; 219 auio.uio_td = ap->a_td; 220 auio.uio_resid = MAXPATHLEN; 221 rdlnk.a_uio = &auio; 222 rdlnk.a_vp = ap->a_vp; 223 rdlnk.a_cred = ap->a_cred; 224 if (cd9660_readlink(&rdlnk) == 0) 225 vap->va_size = MAXPATHLEN - auio.uio_resid; 226 FREE(cp, M_TEMP); 227 } 228 vap->va_flags = 0; 229 vap->va_gen = 1; 230 vap->va_blocksize = ip->i_mnt->logical_block_size; 231 vap->va_bytes = (u_quad_t) ip->i_size; 232 vap->va_type = vp->v_type; 233 vap->va_filerev = 0; 234 return (0); 235} 236 237/* 238 * Vnode op for ioctl. 239 */ 240static int 241cd9660_ioctl(ap) 242 struct vop_ioctl_args /* { 243 struct vnode *a_vp; 244 u_long a_command; 245 caddr_t a_data; 246 int a_fflag; 247 struct ucred *a_cred; 248 struct thread *a_td; 249 } */ *ap; 250{ 251 struct vnode *vp = ap->a_vp; 252 struct iso_node *ip = VTOI(vp); 253 254 if (vp->v_type == VCHR || vp->v_type == VBLK) 255 return (EOPNOTSUPP); 256 257 switch (ap->a_command) { 258 259 case FIOGETLBA: 260 *(int *)(ap->a_data) = ip->iso_start; 261 return 0; 262 default: 263 return (ENOTTY); 264 } 265} 266 267/* 268 * Vnode op for reading. 269 */ 270static int 271cd9660_read(ap) 272 struct vop_read_args /* { 273 struct vnode *a_vp; 274 struct uio *a_uio; 275 int a_ioflag; 276 struct ucred *a_cred; 277 } */ *ap; 278{ 279 struct vnode *vp = ap->a_vp; 280 struct uio *uio = ap->a_uio; 281 struct iso_node *ip = VTOI(vp); 282 struct iso_mnt *imp; 283 struct buf *bp; 284 daddr_t lbn, rablock; 285 off_t diff; 286 int rasize, error = 0; 287 int seqcount; 288 long size, n, on; 289 290 if (vp->v_type == VCHR || vp->v_type == VBLK) 291 return (EOPNOTSUPP); 292 293 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 294 295 if (uio->uio_resid == 0) 296 return (0); 297 if (uio->uio_offset < 0) 298 return (EINVAL); 299 ip->i_flag |= IN_ACCESS; 300 imp = ip->i_mnt; 301 do { 302 lbn = lblkno(imp, uio->uio_offset); 303 on = blkoff(imp, uio->uio_offset); 304 n = min((u_int)(imp->logical_block_size - on), 305 uio->uio_resid); 306 diff = (off_t)ip->i_size - uio->uio_offset; 307 if (diff <= 0) 308 return (0); 309 if (diff < n) 310 n = diff; 311 size = blksize(imp, ip, lbn); 312 rablock = lbn + 1; 313 if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { 314 if (lblktosize(imp, rablock) < ip->i_size) 315 error = cluster_read(vp, (off_t)ip->i_size, 316 lbn, size, NOCRED, uio->uio_resid, 317 (ap->a_ioflag >> 16), &bp); 318 else 319 error = bread(vp, lbn, size, NOCRED, &bp); 320 } else { 321 if (seqcount > 1 && 322 lblktosize(imp, rablock) < ip->i_size) { 323 rasize = blksize(imp, ip, rablock); 324 error = breadn(vp, lbn, size, &rablock, 325 &rasize, 1, NOCRED, &bp); 326 } else 327 error = bread(vp, lbn, size, NOCRED, &bp); 328 } 329 n = min(n, size - bp->b_resid); 330 if (error) { 331 brelse(bp); 332 return (error); 333 } 334 335 error = uiomove(bp->b_data + on, (int)n, uio); 336 brelse(bp); 337 } while (error == 0 && uio->uio_resid > 0 && n != 0); 338 return (error); 339} 340 341/* 342 * Structure for reading directories 343 */ 344struct isoreaddir { 345 struct dirent saveent; 346 struct dirent assocent; 347 struct dirent current; 348 off_t saveoff; 349 off_t assocoff; 350 off_t curroff; 351 struct uio *uio; 352 off_t uio_off; 353 int eofflag; 354 u_long *cookies; 355 int ncookies; 356}; 357 358static int 359iso_uiodir(idp,dp,off) 360 struct isoreaddir *idp; 361 struct dirent *dp; 362 off_t off; 363{ 364 int error; 365 366 dp->d_name[dp->d_namlen] = 0; 367 dp->d_reclen = GENERIC_DIRSIZ(dp); 368 369 if (idp->uio->uio_resid < dp->d_reclen) { 370 idp->eofflag = 0; 371 return (-1); 372 } 373 374 if (idp->cookies) { 375 if (idp->ncookies <= 0) { 376 idp->eofflag = 0; 377 return (-1); 378 } 379 380 *idp->cookies++ = off; 381 --idp->ncookies; 382 } 383 384 if ((error = uiomove(dp, dp->d_reclen, idp->uio)) != 0) 385 return (error); 386 idp->uio_off = off; 387 return (0); 388} 389 390static int 391iso_shipdir(idp) 392 struct isoreaddir *idp; 393{ 394 struct dirent *dp; 395 int cl, sl, assoc; 396 int error; 397 char *cname, *sname; 398 399 cl = idp->current.d_namlen; 400 cname = idp->current.d_name; 401assoc = (cl > 1) && (*cname == ASSOCCHAR); 402 if (assoc) { 403 cl--; 404 cname++; 405 } 406 407 dp = &idp->saveent; 408 sname = dp->d_name; 409 if (!(sl = dp->d_namlen)) { 410 dp = &idp->assocent; 411 sname = dp->d_name + 1; 412 sl = dp->d_namlen - 1; 413 } 414 if (sl > 0) { 415 if (sl != cl 416 || bcmp(sname,cname,sl)) { 417 if (idp->assocent.d_namlen) { 418 if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0) 419 return (error); 420 idp->assocent.d_namlen = 0; 421 } 422 if (idp->saveent.d_namlen) { 423 if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0) 424 return (error); 425 idp->saveent.d_namlen = 0; 426 } 427 } 428 } 429 idp->current.d_reclen = GENERIC_DIRSIZ(&idp->current); 430 if (assoc) { 431 idp->assocoff = idp->curroff; 432 bcopy(&idp->current,&idp->assocent,idp->current.d_reclen); 433 } else { 434 idp->saveoff = idp->curroff; 435 bcopy(&idp->current,&idp->saveent,idp->current.d_reclen); 436 } 437 return (0); 438} 439 440/* 441 * Vnode op for readdir 442 */ 443static int 444cd9660_readdir(ap) 445 struct vop_readdir_args /* { 446 struct vnode *a_vp; 447 struct uio *a_uio; 448 struct ucred *a_cred; 449 int *a_eofflag; 450 int *a_ncookies; 451 u_long **a_cookies; 452 } */ *ap; 453{ 454 struct uio *uio = ap->a_uio; 455 struct isoreaddir *idp; 456 struct vnode *vdp = ap->a_vp; 457 struct iso_node *dp; 458 struct iso_mnt *imp; 459 struct buf *bp = NULL; 460 struct iso_directory_record *ep; 461 int entryoffsetinblock; 462 doff_t endsearch; 463 u_long bmask; 464 int error = 0; 465 int reclen; 466 u_short namelen; 467 int ncookies = 0; 468 u_long *cookies = NULL; 469 470 dp = VTOI(vdp); 471 imp = dp->i_mnt; 472 bmask = imp->im_bmask; 473 474 MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK); 475 idp->saveent.d_namlen = idp->assocent.d_namlen = 0; 476 /* 477 * XXX 478 * Is it worth trying to figure out the type? 479 */ 480 idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type = 481 DT_UNKNOWN; 482 idp->uio = uio; 483 if (ap->a_ncookies == NULL) { 484 idp->cookies = NULL; 485 } else { 486 /* 487 * Guess the number of cookies needed. 488 */ 489 ncookies = uio->uio_resid / 16; 490 MALLOC(cookies, u_long *, ncookies * sizeof(u_long), 491 M_TEMP, M_WAITOK); 492 idp->cookies = cookies; 493 idp->ncookies = ncookies; 494 } 495 idp->eofflag = 1; 496 idp->curroff = uio->uio_offset; 497 498 if ((entryoffsetinblock = idp->curroff & bmask) && 499 (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) { 500 FREE(idp, M_TEMP); 501 return (error); 502 } 503 endsearch = dp->i_size; 504 505 while (idp->curroff < endsearch) { 506 /* 507 * If offset is on a block boundary, 508 * read the next directory block. 509 * Release previous if it exists. 510 */ 511 if ((idp->curroff & bmask) == 0) { 512 if (bp != NULL) 513 brelse(bp); 514 if ((error = 515 cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0) 516 break; 517 entryoffsetinblock = 0; 518 } 519 /* 520 * Get pointer to next entry. 521 */ 522 ep = (struct iso_directory_record *) 523 ((char *)bp->b_data + entryoffsetinblock); 524 525 reclen = isonum_711(ep->length); 526 if (reclen == 0) { 527 /* skip to next block, if any */ 528 idp->curroff = 529 (idp->curroff & ~bmask) + imp->logical_block_size; 530 continue; 531 } 532 533 if (reclen < ISO_DIRECTORY_RECORD_SIZE) { 534 error = EINVAL; 535 /* illegal entry, stop */ 536 break; 537 } 538 539 if (entryoffsetinblock + reclen > imp->logical_block_size) { 540 error = EINVAL; 541 /* illegal directory, so stop looking */ 542 break; 543 } 544 545 idp->current.d_namlen = isonum_711(ep->name_len); 546 547 if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) { 548 error = EINVAL; 549 /* illegal entry, stop */ 550 break; 551 } 552 553 if (isonum_711(ep->flags)&2) 554 idp->current.d_fileno = isodirino(ep, imp); 555 else 556 idp->current.d_fileno = dbtob(bp->b_blkno) + 557 entryoffsetinblock; 558 559 idp->curroff += reclen; 560 561 switch (imp->iso_ftype) { 562 case ISO_FTYPE_RRIP: 563 cd9660_rrip_getname(ep,idp->current.d_name, &namelen, 564 &idp->current.d_fileno,imp); 565 idp->current.d_namlen = (u_char)namelen; 566 if (idp->current.d_namlen) 567 error = iso_uiodir(idp,&idp->current,idp->curroff); 568 break; 569 default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/ 570 strcpy(idp->current.d_name,".."); 571 if (idp->current.d_namlen == 1 && ep->name[0] == 0) { 572 idp->current.d_namlen = 1; 573 error = iso_uiodir(idp,&idp->current,idp->curroff); 574 } else if (idp->current.d_namlen == 1 && ep->name[0] == 1) { 575 idp->current.d_namlen = 2; 576 error = iso_uiodir(idp,&idp->current,idp->curroff); 577 } else { 578 isofntrans(ep->name,idp->current.d_namlen, 579 idp->current.d_name, &namelen, 580 imp->iso_ftype == ISO_FTYPE_9660, 581 isonum_711(ep->flags)&4, 582 imp->joliet_level, 583 imp->im_flags, 584 imp->im_d2l); 585 idp->current.d_namlen = (u_char)namelen; 586 if (imp->iso_ftype == ISO_FTYPE_DEFAULT) 587 error = iso_shipdir(idp); 588 else 589 error = iso_uiodir(idp,&idp->current,idp->curroff); 590 } 591 } 592 if (error) 593 break; 594 595 entryoffsetinblock += reclen; 596 } 597 598 if (!error && imp->iso_ftype == ISO_FTYPE_DEFAULT) { 599 idp->current.d_namlen = 0; 600 error = iso_shipdir(idp); 601 } 602 if (error < 0) 603 error = 0; 604 605 if (ap->a_ncookies != NULL) { 606 if (error) 607 free(cookies, M_TEMP); 608 else { 609 /* 610 * Work out the number of cookies actually used. 611 */ 612 *ap->a_ncookies = ncookies - idp->ncookies; 613 *ap->a_cookies = cookies; 614 } 615 } 616 617 if (bp) 618 brelse (bp); 619 620 uio->uio_offset = idp->uio_off; 621 *ap->a_eofflag = idp->eofflag; 622 623 FREE(idp, M_TEMP); 624 625 return (error); 626} 627 628/* 629 * Return target name of a symbolic link 630 * Shouldn't we get the parent vnode and read the data from there? 631 * This could eventually result in deadlocks in cd9660_lookup. 632 * But otherwise the block read here is in the block buffer two times. 633 */ 634typedef struct iso_directory_record ISODIR; 635typedef struct iso_node ISONODE; 636typedef struct iso_mnt ISOMNT; 637static int 638cd9660_readlink(ap) 639 struct vop_readlink_args /* { 640 struct vnode *a_vp; 641 struct uio *a_uio; 642 struct ucred *a_cred; 643 } */ *ap; 644{ 645 ISONODE *ip; 646 ISODIR *dirp; 647 ISOMNT *imp; 648 struct buf *bp; 649 struct uio *uio; 650 u_short symlen; 651 int error; 652 char *symname; 653 654 ip = VTOI(ap->a_vp); 655 imp = ip->i_mnt; 656 uio = ap->a_uio; 657 658 if (imp->iso_ftype != ISO_FTYPE_RRIP) 659 return (EINVAL); 660 661 /* 662 * Get parents directory record block that this inode included. 663 */ 664 error = bread(imp->im_devvp, 665 (ip->i_number >> imp->im_bshift) << 666 (imp->im_bshift - DEV_BSHIFT), 667 imp->logical_block_size, NOCRED, &bp); 668 if (error) { 669 brelse(bp); 670 return (EINVAL); 671 } 672 673 /* 674 * Setup the directory pointer for this inode 675 */ 676 dirp = (ISODIR *)(bp->b_data + (ip->i_number & imp->im_bmask)); 677 678 /* 679 * Just make sure, we have a right one.... 680 * 1: Check not cross boundary on block 681 */ 682 if ((ip->i_number & imp->im_bmask) + isonum_711(dirp->length) 683 > (unsigned)imp->logical_block_size) { 684 brelse(bp); 685 return (EINVAL); 686 } 687 688 /* 689 * Now get a buffer 690 * Abuse a namei buffer for now. 691 */ 692 if (uio->uio_segflg == UIO_SYSSPACE) 693 symname = uio->uio_iov->iov_base; 694 else 695 symname = uma_zalloc(namei_zone, M_WAITOK); 696 697 /* 698 * Ok, we just gathering a symbolic name in SL record. 699 */ 700 if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) { 701 if (uio->uio_segflg != UIO_SYSSPACE) 702 uma_zfree(namei_zone, symname); 703 brelse(bp); 704 return (EINVAL); 705 } 706 /* 707 * Don't forget before you leave from home ;-) 708 */ 709 brelse(bp); 710 711 /* 712 * return with the symbolic name to caller's. 713 */ 714 if (uio->uio_segflg != UIO_SYSSPACE) { 715 error = uiomove(symname, symlen, uio); 716 uma_zfree(namei_zone, symname); 717 return (error); 718 } 719 uio->uio_resid -= symlen; 720 uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + symlen; 721 uio->uio_iov->iov_len -= symlen; 722 return (0); 723} 724 725/* 726 * Calculate the logical to physical mapping if not done already, 727 * then call the device strategy routine. 728 */ 729static int 730cd9660_strategy(ap) 731 struct vop_strategy_args /* { 732 struct buf *a_vp; 733 struct buf *a_bp; 734 } */ *ap; 735{ 736 struct buf *bp = ap->a_bp; 737 struct vnode *vp = ap->a_vp; 738 struct iso_node *ip; 739 struct bufobj *bo; 740 741 ip = VTOI(vp); 742 if (vp->v_type == VBLK || vp->v_type == VCHR) 743 panic("cd9660_strategy: spec"); 744 if (bp->b_blkno == bp->b_lblkno) { 745 bp->b_blkno = (ip->iso_start + bp->b_lblkno) << 746 (ip->i_mnt->im_bshift - DEV_BSHIFT); 747 if ((long)bp->b_blkno == -1) /* XXX: cut&paste junk ? */ 748 clrbuf(bp); 749 } 750 if ((long)bp->b_blkno == -1) { /* XXX: cut&paste junk ? */ 751 bufdone(bp); 752 return (0); 753 } 754 bp->b_iooffset = dbtob(bp->b_blkno); 755 bo = ip->i_mnt->im_bo; 756 BO_STRATEGY(bo, bp); 757 return (0); 758} 759 760/* 761 * Return POSIX pathconf information applicable to cd9660 filesystems. 762 */ 763static int 764cd9660_pathconf(ap) 765 struct vop_pathconf_args /* { 766 struct vnode *a_vp; 767 int a_name; 768 register_t *a_retval; 769 } */ *ap; 770{ 771 772 switch (ap->a_name) { 773 case _PC_LINK_MAX: 774 *ap->a_retval = 1; 775 return (0); 776 case _PC_NAME_MAX: 777 if (VTOI(ap->a_vp)->i_mnt->iso_ftype == ISO_FTYPE_RRIP) 778 *ap->a_retval = NAME_MAX; 779 else 780 *ap->a_retval = 37; 781 return (0); 782 case _PC_PATH_MAX: 783 *ap->a_retval = PATH_MAX; 784 return (0); 785 case _PC_PIPE_BUF: 786 *ap->a_retval = PIPE_BUF; 787 return (0); 788 case _PC_CHOWN_RESTRICTED: 789 *ap->a_retval = 1; 790 return (0); 791 case _PC_NO_TRUNC: 792 *ap->a_retval = 1; 793 return (0); 794 default: 795 return (EINVAL); 796 } 797 /* NOTREACHED */ 798} 799 800/* 801 * Global vfs data structures for cd9660 802 */ 803struct vop_vector cd9660_vnodeops = { 804 .vop_default = &default_vnodeops, 805 .vop_open = cd9660_open, 806 .vop_access = cd9660_access, 807 .vop_bmap = cd9660_bmap, 808 .vop_cachedlookup = cd9660_lookup, 809 .vop_getattr = cd9660_getattr, 810 .vop_inactive = cd9660_inactive, 811 .vop_ioctl = cd9660_ioctl, 812 .vop_lookup = vfs_cache_lookup, 813 .vop_pathconf = cd9660_pathconf, 814 .vop_read = cd9660_read, 815 .vop_readdir = cd9660_readdir, 816 .vop_readlink = cd9660_readlink, 817 .vop_reclaim = cd9660_reclaim, 818 .vop_setattr = cd9660_setattr, 819 .vop_strategy = cd9660_strategy, 820}; 821 822/* 823 * Special device vnode ops 824 */ 825 826struct vop_vector cd9660_fifoops = { 827 .vop_default = &fifo_specops, 828 .vop_access = cd9660_access, 829 .vop_getattr = cd9660_getattr, 830 .vop_inactive = cd9660_inactive, 831 .vop_reclaim = cd9660_reclaim, 832 .vop_setattr = cd9660_setattr, 833};
| 63 64static vop_setattr_t cd9660_setattr; 65static vop_open_t cd9660_open; 66static vop_access_t cd9660_access; 67static vop_getattr_t cd9660_getattr; 68static vop_ioctl_t cd9660_ioctl; 69static vop_pathconf_t cd9660_pathconf; 70static vop_read_t cd9660_read; 71struct isoreaddir; 72static int iso_uiodir(struct isoreaddir *idp, struct dirent *dp, off_t off); 73static int iso_shipdir(struct isoreaddir *idp); 74static vop_readdir_t cd9660_readdir; 75static vop_readlink_t cd9660_readlink; 76static vop_strategy_t cd9660_strategy; 77 78/* 79 * Setattr call. Only allowed for block and character special devices. 80 */ 81static int 82cd9660_setattr(ap) 83 struct vop_setattr_args /* { 84 struct vnodeop_desc *a_desc; 85 struct vnode *a_vp; 86 struct vattr *a_vap; 87 struct ucred *a_cred; 88 struct thread *a_td; 89 } */ *ap; 90{ 91 struct vnode *vp = ap->a_vp; 92 struct vattr *vap = ap->a_vap; 93 94 if (vap->va_flags != (u_long)VNOVAL || vap->va_uid != (uid_t)VNOVAL || 95 vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || 96 vap->va_mtime.tv_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) 97 return (EROFS); 98 if (vap->va_size != (u_quad_t)VNOVAL) { 99 switch (vp->v_type) { 100 case VDIR: 101 return (EISDIR); 102 case VLNK: 103 case VREG: 104 return (EROFS); 105 case VCHR: 106 case VBLK: 107 case VSOCK: 108 case VFIFO: 109 case VNON: 110 case VBAD: 111 case VMARKER: 112 return (0); 113 } 114 } 115 return (0); 116} 117 118/* 119 * Check mode permission on inode pointer. Mode is READ, WRITE or EXEC. 120 * The mode is shifted to select the owner/group/other fields. The 121 * super user is granted all permissions. 122 */ 123/* ARGSUSED */ 124static int 125cd9660_access(ap) 126 struct vop_access_args /* { 127 struct vnode *a_vp; 128 int a_mode; 129 struct ucred *a_cred; 130 struct thread *a_td; 131 } */ *ap; 132{ 133 struct vnode *vp = ap->a_vp; 134 struct iso_node *ip = VTOI(vp); 135 mode_t mode = ap->a_mode; 136 137 if (vp->v_type == VCHR || vp->v_type == VBLK) 138 return (EOPNOTSUPP); 139 140 /* 141 * Disallow write attempts unless the file is a socket, 142 * fifo, or a block or character device resident on the 143 * filesystem. 144 */ 145 if (mode & VWRITE) { 146 switch (vp->v_type) { 147 case VDIR: 148 case VLNK: 149 case VREG: 150 return (EROFS); 151 /* NOT REACHED */ 152 default: 153 break; 154 } 155 } 156 157 return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, 158 ip->inode.iso_gid, ap->a_mode, ap->a_cred, NULL)); 159} 160 161static int 162cd9660_open(ap) 163 struct vop_open_args /* { 164 struct vnode *a_vp; 165 int a_mode; 166 struct ucred *a_cred; 167 struct thread *a_td; 168 int a_fdidx; 169 } */ *ap; 170{ 171 struct iso_node *ip = VTOI(ap->a_vp); 172 173 vnode_create_vobject(ap->a_vp, ip->i_size, ap->a_td); 174 return 0; 175} 176 177 178static int 179cd9660_getattr(ap) 180 struct vop_getattr_args /* { 181 struct vnode *a_vp; 182 struct vattr *a_vap; 183 struct ucred *a_cred; 184 struct thread *a_td; 185 } */ *ap; 186 187{ 188 struct vnode *vp = ap->a_vp; 189 struct vattr *vap = ap->a_vap; 190 struct iso_node *ip = VTOI(vp); 191 192 vap->va_fsid = dev2udev(ip->i_mnt->im_dev); 193 vap->va_fileid = ip->i_number; 194 195 vap->va_mode = ip->inode.iso_mode; 196 vap->va_nlink = ip->inode.iso_links; 197 vap->va_uid = ip->inode.iso_uid; 198 vap->va_gid = ip->inode.iso_gid; 199 vap->va_atime = ip->inode.iso_atime; 200 vap->va_mtime = ip->inode.iso_mtime; 201 vap->va_ctime = ip->inode.iso_ctime; 202 vap->va_rdev = ip->inode.iso_rdev; 203 204 vap->va_size = (u_quad_t) ip->i_size; 205 if (ip->i_size == 0 && (vap->va_mode & S_IFMT) == S_IFLNK) { 206 struct vop_readlink_args rdlnk; 207 struct iovec aiov; 208 struct uio auio; 209 char *cp; 210 211 MALLOC(cp, char *, MAXPATHLEN, M_TEMP, M_WAITOK); 212 aiov.iov_base = cp; 213 aiov.iov_len = MAXPATHLEN; 214 auio.uio_iov = &aiov; 215 auio.uio_iovcnt = 1; 216 auio.uio_offset = 0; 217 auio.uio_rw = UIO_READ; 218 auio.uio_segflg = UIO_SYSSPACE; 219 auio.uio_td = ap->a_td; 220 auio.uio_resid = MAXPATHLEN; 221 rdlnk.a_uio = &auio; 222 rdlnk.a_vp = ap->a_vp; 223 rdlnk.a_cred = ap->a_cred; 224 if (cd9660_readlink(&rdlnk) == 0) 225 vap->va_size = MAXPATHLEN - auio.uio_resid; 226 FREE(cp, M_TEMP); 227 } 228 vap->va_flags = 0; 229 vap->va_gen = 1; 230 vap->va_blocksize = ip->i_mnt->logical_block_size; 231 vap->va_bytes = (u_quad_t) ip->i_size; 232 vap->va_type = vp->v_type; 233 vap->va_filerev = 0; 234 return (0); 235} 236 237/* 238 * Vnode op for ioctl. 239 */ 240static int 241cd9660_ioctl(ap) 242 struct vop_ioctl_args /* { 243 struct vnode *a_vp; 244 u_long a_command; 245 caddr_t a_data; 246 int a_fflag; 247 struct ucred *a_cred; 248 struct thread *a_td; 249 } */ *ap; 250{ 251 struct vnode *vp = ap->a_vp; 252 struct iso_node *ip = VTOI(vp); 253 254 if (vp->v_type == VCHR || vp->v_type == VBLK) 255 return (EOPNOTSUPP); 256 257 switch (ap->a_command) { 258 259 case FIOGETLBA: 260 *(int *)(ap->a_data) = ip->iso_start; 261 return 0; 262 default: 263 return (ENOTTY); 264 } 265} 266 267/* 268 * Vnode op for reading. 269 */ 270static int 271cd9660_read(ap) 272 struct vop_read_args /* { 273 struct vnode *a_vp; 274 struct uio *a_uio; 275 int a_ioflag; 276 struct ucred *a_cred; 277 } */ *ap; 278{ 279 struct vnode *vp = ap->a_vp; 280 struct uio *uio = ap->a_uio; 281 struct iso_node *ip = VTOI(vp); 282 struct iso_mnt *imp; 283 struct buf *bp; 284 daddr_t lbn, rablock; 285 off_t diff; 286 int rasize, error = 0; 287 int seqcount; 288 long size, n, on; 289 290 if (vp->v_type == VCHR || vp->v_type == VBLK) 291 return (EOPNOTSUPP); 292 293 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 294 295 if (uio->uio_resid == 0) 296 return (0); 297 if (uio->uio_offset < 0) 298 return (EINVAL); 299 ip->i_flag |= IN_ACCESS; 300 imp = ip->i_mnt; 301 do { 302 lbn = lblkno(imp, uio->uio_offset); 303 on = blkoff(imp, uio->uio_offset); 304 n = min((u_int)(imp->logical_block_size - on), 305 uio->uio_resid); 306 diff = (off_t)ip->i_size - uio->uio_offset; 307 if (diff <= 0) 308 return (0); 309 if (diff < n) 310 n = diff; 311 size = blksize(imp, ip, lbn); 312 rablock = lbn + 1; 313 if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { 314 if (lblktosize(imp, rablock) < ip->i_size) 315 error = cluster_read(vp, (off_t)ip->i_size, 316 lbn, size, NOCRED, uio->uio_resid, 317 (ap->a_ioflag >> 16), &bp); 318 else 319 error = bread(vp, lbn, size, NOCRED, &bp); 320 } else { 321 if (seqcount > 1 && 322 lblktosize(imp, rablock) < ip->i_size) { 323 rasize = blksize(imp, ip, rablock); 324 error = breadn(vp, lbn, size, &rablock, 325 &rasize, 1, NOCRED, &bp); 326 } else 327 error = bread(vp, lbn, size, NOCRED, &bp); 328 } 329 n = min(n, size - bp->b_resid); 330 if (error) { 331 brelse(bp); 332 return (error); 333 } 334 335 error = uiomove(bp->b_data + on, (int)n, uio); 336 brelse(bp); 337 } while (error == 0 && uio->uio_resid > 0 && n != 0); 338 return (error); 339} 340 341/* 342 * Structure for reading directories 343 */ 344struct isoreaddir { 345 struct dirent saveent; 346 struct dirent assocent; 347 struct dirent current; 348 off_t saveoff; 349 off_t assocoff; 350 off_t curroff; 351 struct uio *uio; 352 off_t uio_off; 353 int eofflag; 354 u_long *cookies; 355 int ncookies; 356}; 357 358static int 359iso_uiodir(idp,dp,off) 360 struct isoreaddir *idp; 361 struct dirent *dp; 362 off_t off; 363{ 364 int error; 365 366 dp->d_name[dp->d_namlen] = 0; 367 dp->d_reclen = GENERIC_DIRSIZ(dp); 368 369 if (idp->uio->uio_resid < dp->d_reclen) { 370 idp->eofflag = 0; 371 return (-1); 372 } 373 374 if (idp->cookies) { 375 if (idp->ncookies <= 0) { 376 idp->eofflag = 0; 377 return (-1); 378 } 379 380 *idp->cookies++ = off; 381 --idp->ncookies; 382 } 383 384 if ((error = uiomove(dp, dp->d_reclen, idp->uio)) != 0) 385 return (error); 386 idp->uio_off = off; 387 return (0); 388} 389 390static int 391iso_shipdir(idp) 392 struct isoreaddir *idp; 393{ 394 struct dirent *dp; 395 int cl, sl, assoc; 396 int error; 397 char *cname, *sname; 398 399 cl = idp->current.d_namlen; 400 cname = idp->current.d_name; 401assoc = (cl > 1) && (*cname == ASSOCCHAR); 402 if (assoc) { 403 cl--; 404 cname++; 405 } 406 407 dp = &idp->saveent; 408 sname = dp->d_name; 409 if (!(sl = dp->d_namlen)) { 410 dp = &idp->assocent; 411 sname = dp->d_name + 1; 412 sl = dp->d_namlen - 1; 413 } 414 if (sl > 0) { 415 if (sl != cl 416 || bcmp(sname,cname,sl)) { 417 if (idp->assocent.d_namlen) { 418 if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0) 419 return (error); 420 idp->assocent.d_namlen = 0; 421 } 422 if (idp->saveent.d_namlen) { 423 if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0) 424 return (error); 425 idp->saveent.d_namlen = 0; 426 } 427 } 428 } 429 idp->current.d_reclen = GENERIC_DIRSIZ(&idp->current); 430 if (assoc) { 431 idp->assocoff = idp->curroff; 432 bcopy(&idp->current,&idp->assocent,idp->current.d_reclen); 433 } else { 434 idp->saveoff = idp->curroff; 435 bcopy(&idp->current,&idp->saveent,idp->current.d_reclen); 436 } 437 return (0); 438} 439 440/* 441 * Vnode op for readdir 442 */ 443static int 444cd9660_readdir(ap) 445 struct vop_readdir_args /* { 446 struct vnode *a_vp; 447 struct uio *a_uio; 448 struct ucred *a_cred; 449 int *a_eofflag; 450 int *a_ncookies; 451 u_long **a_cookies; 452 } */ *ap; 453{ 454 struct uio *uio = ap->a_uio; 455 struct isoreaddir *idp; 456 struct vnode *vdp = ap->a_vp; 457 struct iso_node *dp; 458 struct iso_mnt *imp; 459 struct buf *bp = NULL; 460 struct iso_directory_record *ep; 461 int entryoffsetinblock; 462 doff_t endsearch; 463 u_long bmask; 464 int error = 0; 465 int reclen; 466 u_short namelen; 467 int ncookies = 0; 468 u_long *cookies = NULL; 469 470 dp = VTOI(vdp); 471 imp = dp->i_mnt; 472 bmask = imp->im_bmask; 473 474 MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK); 475 idp->saveent.d_namlen = idp->assocent.d_namlen = 0; 476 /* 477 * XXX 478 * Is it worth trying to figure out the type? 479 */ 480 idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type = 481 DT_UNKNOWN; 482 idp->uio = uio; 483 if (ap->a_ncookies == NULL) { 484 idp->cookies = NULL; 485 } else { 486 /* 487 * Guess the number of cookies needed. 488 */ 489 ncookies = uio->uio_resid / 16; 490 MALLOC(cookies, u_long *, ncookies * sizeof(u_long), 491 M_TEMP, M_WAITOK); 492 idp->cookies = cookies; 493 idp->ncookies = ncookies; 494 } 495 idp->eofflag = 1; 496 idp->curroff = uio->uio_offset; 497 498 if ((entryoffsetinblock = idp->curroff & bmask) && 499 (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) { 500 FREE(idp, M_TEMP); 501 return (error); 502 } 503 endsearch = dp->i_size; 504 505 while (idp->curroff < endsearch) { 506 /* 507 * If offset is on a block boundary, 508 * read the next directory block. 509 * Release previous if it exists. 510 */ 511 if ((idp->curroff & bmask) == 0) { 512 if (bp != NULL) 513 brelse(bp); 514 if ((error = 515 cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0) 516 break; 517 entryoffsetinblock = 0; 518 } 519 /* 520 * Get pointer to next entry. 521 */ 522 ep = (struct iso_directory_record *) 523 ((char *)bp->b_data + entryoffsetinblock); 524 525 reclen = isonum_711(ep->length); 526 if (reclen == 0) { 527 /* skip to next block, if any */ 528 idp->curroff = 529 (idp->curroff & ~bmask) + imp->logical_block_size; 530 continue; 531 } 532 533 if (reclen < ISO_DIRECTORY_RECORD_SIZE) { 534 error = EINVAL; 535 /* illegal entry, stop */ 536 break; 537 } 538 539 if (entryoffsetinblock + reclen > imp->logical_block_size) { 540 error = EINVAL; 541 /* illegal directory, so stop looking */ 542 break; 543 } 544 545 idp->current.d_namlen = isonum_711(ep->name_len); 546 547 if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) { 548 error = EINVAL; 549 /* illegal entry, stop */ 550 break; 551 } 552 553 if (isonum_711(ep->flags)&2) 554 idp->current.d_fileno = isodirino(ep, imp); 555 else 556 idp->current.d_fileno = dbtob(bp->b_blkno) + 557 entryoffsetinblock; 558 559 idp->curroff += reclen; 560 561 switch (imp->iso_ftype) { 562 case ISO_FTYPE_RRIP: 563 cd9660_rrip_getname(ep,idp->current.d_name, &namelen, 564 &idp->current.d_fileno,imp); 565 idp->current.d_namlen = (u_char)namelen; 566 if (idp->current.d_namlen) 567 error = iso_uiodir(idp,&idp->current,idp->curroff); 568 break; 569 default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/ 570 strcpy(idp->current.d_name,".."); 571 if (idp->current.d_namlen == 1 && ep->name[0] == 0) { 572 idp->current.d_namlen = 1; 573 error = iso_uiodir(idp,&idp->current,idp->curroff); 574 } else if (idp->current.d_namlen == 1 && ep->name[0] == 1) { 575 idp->current.d_namlen = 2; 576 error = iso_uiodir(idp,&idp->current,idp->curroff); 577 } else { 578 isofntrans(ep->name,idp->current.d_namlen, 579 idp->current.d_name, &namelen, 580 imp->iso_ftype == ISO_FTYPE_9660, 581 isonum_711(ep->flags)&4, 582 imp->joliet_level, 583 imp->im_flags, 584 imp->im_d2l); 585 idp->current.d_namlen = (u_char)namelen; 586 if (imp->iso_ftype == ISO_FTYPE_DEFAULT) 587 error = iso_shipdir(idp); 588 else 589 error = iso_uiodir(idp,&idp->current,idp->curroff); 590 } 591 } 592 if (error) 593 break; 594 595 entryoffsetinblock += reclen; 596 } 597 598 if (!error && imp->iso_ftype == ISO_FTYPE_DEFAULT) { 599 idp->current.d_namlen = 0; 600 error = iso_shipdir(idp); 601 } 602 if (error < 0) 603 error = 0; 604 605 if (ap->a_ncookies != NULL) { 606 if (error) 607 free(cookies, M_TEMP); 608 else { 609 /* 610 * Work out the number of cookies actually used. 611 */ 612 *ap->a_ncookies = ncookies - idp->ncookies; 613 *ap->a_cookies = cookies; 614 } 615 } 616 617 if (bp) 618 brelse (bp); 619 620 uio->uio_offset = idp->uio_off; 621 *ap->a_eofflag = idp->eofflag; 622 623 FREE(idp, M_TEMP); 624 625 return (error); 626} 627 628/* 629 * Return target name of a symbolic link 630 * Shouldn't we get the parent vnode and read the data from there? 631 * This could eventually result in deadlocks in cd9660_lookup. 632 * But otherwise the block read here is in the block buffer two times. 633 */ 634typedef struct iso_directory_record ISODIR; 635typedef struct iso_node ISONODE; 636typedef struct iso_mnt ISOMNT; 637static int 638cd9660_readlink(ap) 639 struct vop_readlink_args /* { 640 struct vnode *a_vp; 641 struct uio *a_uio; 642 struct ucred *a_cred; 643 } */ *ap; 644{ 645 ISONODE *ip; 646 ISODIR *dirp; 647 ISOMNT *imp; 648 struct buf *bp; 649 struct uio *uio; 650 u_short symlen; 651 int error; 652 char *symname; 653 654 ip = VTOI(ap->a_vp); 655 imp = ip->i_mnt; 656 uio = ap->a_uio; 657 658 if (imp->iso_ftype != ISO_FTYPE_RRIP) 659 return (EINVAL); 660 661 /* 662 * Get parents directory record block that this inode included. 663 */ 664 error = bread(imp->im_devvp, 665 (ip->i_number >> imp->im_bshift) << 666 (imp->im_bshift - DEV_BSHIFT), 667 imp->logical_block_size, NOCRED, &bp); 668 if (error) { 669 brelse(bp); 670 return (EINVAL); 671 } 672 673 /* 674 * Setup the directory pointer for this inode 675 */ 676 dirp = (ISODIR *)(bp->b_data + (ip->i_number & imp->im_bmask)); 677 678 /* 679 * Just make sure, we have a right one.... 680 * 1: Check not cross boundary on block 681 */ 682 if ((ip->i_number & imp->im_bmask) + isonum_711(dirp->length) 683 > (unsigned)imp->logical_block_size) { 684 brelse(bp); 685 return (EINVAL); 686 } 687 688 /* 689 * Now get a buffer 690 * Abuse a namei buffer for now. 691 */ 692 if (uio->uio_segflg == UIO_SYSSPACE) 693 symname = uio->uio_iov->iov_base; 694 else 695 symname = uma_zalloc(namei_zone, M_WAITOK); 696 697 /* 698 * Ok, we just gathering a symbolic name in SL record. 699 */ 700 if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) { 701 if (uio->uio_segflg != UIO_SYSSPACE) 702 uma_zfree(namei_zone, symname); 703 brelse(bp); 704 return (EINVAL); 705 } 706 /* 707 * Don't forget before you leave from home ;-) 708 */ 709 brelse(bp); 710 711 /* 712 * return with the symbolic name to caller's. 713 */ 714 if (uio->uio_segflg != UIO_SYSSPACE) { 715 error = uiomove(symname, symlen, uio); 716 uma_zfree(namei_zone, symname); 717 return (error); 718 } 719 uio->uio_resid -= symlen; 720 uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + symlen; 721 uio->uio_iov->iov_len -= symlen; 722 return (0); 723} 724 725/* 726 * Calculate the logical to physical mapping if not done already, 727 * then call the device strategy routine. 728 */ 729static int 730cd9660_strategy(ap) 731 struct vop_strategy_args /* { 732 struct buf *a_vp; 733 struct buf *a_bp; 734 } */ *ap; 735{ 736 struct buf *bp = ap->a_bp; 737 struct vnode *vp = ap->a_vp; 738 struct iso_node *ip; 739 struct bufobj *bo; 740 741 ip = VTOI(vp); 742 if (vp->v_type == VBLK || vp->v_type == VCHR) 743 panic("cd9660_strategy: spec"); 744 if (bp->b_blkno == bp->b_lblkno) { 745 bp->b_blkno = (ip->iso_start + bp->b_lblkno) << 746 (ip->i_mnt->im_bshift - DEV_BSHIFT); 747 if ((long)bp->b_blkno == -1) /* XXX: cut&paste junk ? */ 748 clrbuf(bp); 749 } 750 if ((long)bp->b_blkno == -1) { /* XXX: cut&paste junk ? */ 751 bufdone(bp); 752 return (0); 753 } 754 bp->b_iooffset = dbtob(bp->b_blkno); 755 bo = ip->i_mnt->im_bo; 756 BO_STRATEGY(bo, bp); 757 return (0); 758} 759 760/* 761 * Return POSIX pathconf information applicable to cd9660 filesystems. 762 */ 763static int 764cd9660_pathconf(ap) 765 struct vop_pathconf_args /* { 766 struct vnode *a_vp; 767 int a_name; 768 register_t *a_retval; 769 } */ *ap; 770{ 771 772 switch (ap->a_name) { 773 case _PC_LINK_MAX: 774 *ap->a_retval = 1; 775 return (0); 776 case _PC_NAME_MAX: 777 if (VTOI(ap->a_vp)->i_mnt->iso_ftype == ISO_FTYPE_RRIP) 778 *ap->a_retval = NAME_MAX; 779 else 780 *ap->a_retval = 37; 781 return (0); 782 case _PC_PATH_MAX: 783 *ap->a_retval = PATH_MAX; 784 return (0); 785 case _PC_PIPE_BUF: 786 *ap->a_retval = PIPE_BUF; 787 return (0); 788 case _PC_CHOWN_RESTRICTED: 789 *ap->a_retval = 1; 790 return (0); 791 case _PC_NO_TRUNC: 792 *ap->a_retval = 1; 793 return (0); 794 default: 795 return (EINVAL); 796 } 797 /* NOTREACHED */ 798} 799 800/* 801 * Global vfs data structures for cd9660 802 */ 803struct vop_vector cd9660_vnodeops = { 804 .vop_default = &default_vnodeops, 805 .vop_open = cd9660_open, 806 .vop_access = cd9660_access, 807 .vop_bmap = cd9660_bmap, 808 .vop_cachedlookup = cd9660_lookup, 809 .vop_getattr = cd9660_getattr, 810 .vop_inactive = cd9660_inactive, 811 .vop_ioctl = cd9660_ioctl, 812 .vop_lookup = vfs_cache_lookup, 813 .vop_pathconf = cd9660_pathconf, 814 .vop_read = cd9660_read, 815 .vop_readdir = cd9660_readdir, 816 .vop_readlink = cd9660_readlink, 817 .vop_reclaim = cd9660_reclaim, 818 .vop_setattr = cd9660_setattr, 819 .vop_strategy = cd9660_strategy, 820}; 821 822/* 823 * Special device vnode ops 824 */ 825 826struct vop_vector cd9660_fifoops = { 827 .vop_default = &fifo_specops, 828 .vop_access = cd9660_access, 829 .vop_getattr = cd9660_getattr, 830 .vop_inactive = cd9660_inactive, 831 .vop_reclaim = cd9660_reclaim, 832 .vop_setattr = cd9660_setattr, 833};
|