1 /* $NetBSD: cd9660_vnops.c,v 1.52 2015/04/20 23:03:07 riastradh Exp $ */
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp).
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * @(#)cd9660_vnops.c 8.15 (Berkeley) 5/27/95
39 #include <sys/cdefs.h>
40 __KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.52 2015/04/20 23:03:07 riastradh Exp $");
42 #include <sys/param.h>
43 #include <sys/systm.h>
44 #include <sys/namei.h>
45 #include <sys/resourcevar.h>
46 #include <sys/kernel.h>
51 #include <sys/mount.h>
52 #include <sys/vnode.h>
53 #include <sys/malloc.h>
54 #include <sys/dirent.h>
55 #include <sys/kauth.h>
57 #include <miscfs/fifofs/fifo.h>
58 #include <miscfs/genfs/genfs.h>
59 #include <miscfs/specfs/specdev.h>
61 #include <fs/cd9660/iso.h>
62 #include <fs/cd9660/cd9660_extern.h>
63 #include <fs/cd9660/cd9660_node.h>
64 #include <fs/cd9660/iso_rrip.h>
65 #include <fs/cd9660/cd9660_mount.h>
68 * Structure for reading directories
71 struct dirent saveent
;
72 struct dirent assocent
;
73 struct dirent current
;
84 int iso_uiodir(struct isoreaddir
*, struct dirent
*, off_t
);
85 int iso_shipdir(struct isoreaddir
*);
88 cd9660_check_possible(struct vnode
*vp
, struct iso_node
*ip
, mode_t mode
)
92 * Disallow write attempts unless the file is a socket,
93 * fifo, or a block or character device resident on the
111 * Check mode permission on inode pointer. Mode is READ, WRITE or EXEC.
112 * The mode is shifted to select the owner/group/other fields. The
113 * super user is granted all permissions.
116 cd9660_check_permitted(struct vnode
*vp
, struct iso_node
*ip
, mode_t mode
,
120 return kauth_authorize_vnode(cred
, KAUTH_ACCESS_ACTION(mode
,
121 vp
->v_type
, ip
->inode
.iso_mode
& ALLPERMS
), vp
, NULL
,
122 genfs_can_access(vp
->v_type
, ip
->inode
.iso_mode
& ALLPERMS
,
123 ip
->inode
.iso_uid
, ip
->inode
.iso_gid
, mode
, cred
));
127 cd9660_access(void *v
)
129 struct vop_access_args
/* {
134 struct vnode
*vp
= ap
->a_vp
;
135 struct iso_node
*ip
= VTOI(vp
);
138 error
= cd9660_check_possible(vp
, ip
, ap
->a_mode
);
142 error
= cd9660_check_permitted(vp
, ip
, ap
->a_mode
, ap
->a_cred
);
148 cd9660_getattr(void *v
)
150 struct vop_getattr_args
/* {
155 struct vnode
*vp
= ap
->a_vp
;
156 struct iso_node
*ip
= VTOI(vp
);
157 struct vattr
*vap
= ap
->a_vap
;
159 vap
->va_fsid
= ip
->i_dev
;
160 vap
->va_fileid
= ip
->i_number
;
162 vap
->va_mode
= ip
->inode
.iso_mode
& ALLPERMS
;
163 vap
->va_nlink
= ip
->inode
.iso_links
;
164 vap
->va_uid
= ip
->inode
.iso_uid
;
165 vap
->va_gid
= ip
->inode
.iso_gid
;
166 vap
->va_atime
= ip
->inode
.iso_atime
;
167 vap
->va_mtime
= ip
->inode
.iso_mtime
;
168 vap
->va_ctime
= ip
->inode
.iso_ctime
;
169 vap
->va_rdev
= ip
->inode
.iso_rdev
;
171 vap
->va_size
= (u_quad_t
) ip
->i_size
;
172 if (ip
->i_size
== 0 && vp
->v_type
== VLNK
) {
173 struct vop_readlink_args rdlnk
;
178 cp
= (char *)malloc(MAXPATHLEN
, M_TEMP
, M_WAITOK
);
180 aiov
.iov_len
= MAXPATHLEN
;
181 auio
.uio_iov
= &aiov
;
184 auio
.uio_rw
= UIO_READ
;
185 auio
.uio_resid
= MAXPATHLEN
;
186 UIO_SETUP_SYSSPACE(&auio
);
188 rdlnk
.a_vp
= ap
->a_vp
;
189 rdlnk
.a_cred
= ap
->a_cred
;
190 if (cd9660_readlink(&rdlnk
) == 0)
191 vap
->va_size
= MAXPATHLEN
- auio
.uio_resid
;
196 vap
->va_blocksize
= ip
->i_mnt
->logical_block_size
;
197 vap
->va_bytes
= (u_quad_t
) ip
->i_size
;
198 vap
->va_type
= vp
->v_type
;
203 * Vnode op for reading.
208 struct vop_read_args
/* {
214 struct vnode
*vp
= ap
->a_vp
;
215 struct uio
*uio
= ap
->a_uio
;
216 struct iso_node
*ip
= VTOI(vp
);
219 daddr_t lbn
, rablock
;
221 int rasize
, error
= 0;
224 if (uio
->uio_resid
== 0)
226 if (uio
->uio_offset
< 0)
228 if (uio
->uio_offset
>= ip
->i_size
)
230 ip
->i_flag
|= IN_ACCESS
;
233 if (vp
->v_type
== VREG
) {
234 const int advice
= IO_ADV_DECODE(ap
->a_ioflag
);
237 while (uio
->uio_resid
> 0) {
238 vsize_t bytelen
= MIN(ip
->i_size
- uio
->uio_offset
,
243 error
= ubc_uiomove(&vp
->v_uobj
, uio
, bytelen
, advice
,
244 UBC_READ
| UBC_PARTIALOK
| UBC_UNMAP_FLAG(vp
));
252 lbn
= cd9660_lblkno(imp
, uio
->uio_offset
);
253 on
= cd9660_blkoff(imp
, uio
->uio_offset
);
254 n
= MIN(imp
->logical_block_size
- on
, uio
->uio_resid
);
255 diff
= (off_t
)ip
->i_size
- uio
->uio_offset
;
260 size
= cd9660_blksize(imp
, ip
, lbn
);
262 if (cd9660_lblktosize(imp
, rablock
) < ip
->i_size
) {
263 rasize
= cd9660_blksize(imp
, ip
, rablock
);
264 error
= breadn(vp
, lbn
, size
, &rablock
,
267 error
= bread(vp
, lbn
, size
, 0, &bp
);
272 n
= MIN(n
, size
- bp
->b_resid
);
274 error
= uiomove((char *)bp
->b_data
+ on
, (int)n
, uio
);
276 } while (error
== 0 && uio
->uio_resid
> 0 && n
!= 0);
283 iso_uiodir(struct isoreaddir
*idp
, struct dirent
*dp
, off_t off
)
287 dp
->d_name
[dp
->d_namlen
] = 0;
288 dp
->d_reclen
= _DIRENT_SIZE(dp
);
290 if (idp
->uio
->uio_resid
< dp
->d_reclen
) {
296 if (idp
->ncookies
<= 0) {
301 *idp
->cookies
++ = off
;
305 if ((error
= uiomove(dp
, dp
->d_reclen
, idp
->uio
)) != 0)
312 iso_shipdir(struct isoreaddir
*idp
)
319 cl
= idp
->current
.d_namlen
;
320 cname
= idp
->current
.d_name
;
322 if ((assoc
= cl
> 1 && *cname
== ASSOCCHAR
)) {
329 if (!(sl
= dp
->d_namlen
)) {
331 sname
= dp
->d_name
+ 1;
332 sl
= dp
->d_namlen
- 1;
336 || memcmp(sname
, cname
, sl
)) {
337 if (idp
->assocent
.d_namlen
) {
338 error
= iso_uiodir(idp
, &idp
->assocent
,
342 idp
->assocent
.d_namlen
= 0;
344 if (idp
->saveent
.d_namlen
) {
345 error
= iso_uiodir(idp
, &idp
->saveent
,
349 idp
->saveent
.d_namlen
= 0;
353 idp
->current
.d_reclen
= _DIRENT_SIZE(&idp
->current
);
355 idp
->assocoff
= idp
->curroff
;
356 memcpy(&idp
->assocent
, &idp
->current
, idp
->current
.d_reclen
);
358 idp
->saveoff
= idp
->curroff
;
359 memcpy(&idp
->saveent
, &idp
->current
, idp
->current
.d_reclen
);
365 * Vnode op for readdir
368 cd9660_readdir(void *v
)
370 struct vop_readdir_args
/* {
378 struct uio
*uio
= ap
->a_uio
;
379 struct isoreaddir
*idp
;
380 struct vnode
*vdp
= ap
->a_vp
;
383 struct buf
*bp
= NULL
;
384 struct iso_directory_record
*ep
;
385 int entryoffsetinblock
;
391 off_t
*cookies
= NULL
;
394 if (vdp
->v_type
!= VDIR
)
399 bmask
= imp
->im_bmask
;
401 idp
= (struct isoreaddir
*)malloc(sizeof(*idp
), M_TEMP
, M_WAITOK
);
402 idp
->saveent
.d_namlen
= idp
->assocent
.d_namlen
= 0;
405 * Is it worth trying to figure out the type?
407 idp
->saveent
.d_type
= idp
->assocent
.d_type
= idp
->current
.d_type
=
410 if (ap
->a_ncookies
== NULL
)
413 ncookies
= uio
->uio_resid
/ _DIRENT_MINSIZE((struct dirent
*)0);
414 cookies
= malloc(ncookies
* sizeof(off_t
), M_TEMP
, M_WAITOK
);
415 idp
->cookies
= cookies
;
416 idp
->ncookies
= ncookies
;
419 idp
->curroff
= uio
->uio_offset
;
421 if ((entryoffsetinblock
= idp
->curroff
& bmask
) &&
422 (error
= cd9660_blkatoff(vdp
, (off_t
)idp
->curroff
, NULL
, &bp
))) {
426 endsearch
= dp
->i_size
;
428 while (idp
->curroff
< endsearch
) {
430 * If offset is on a block boundary,
431 * read the next directory block.
432 * Release previous if it exists.
434 if ((idp
->curroff
& bmask
) == 0) {
437 error
= cd9660_blkatoff(vdp
, (off_t
)idp
->curroff
,
441 entryoffsetinblock
= 0;
444 * Get pointer to next entry.
447 ep
= (struct iso_directory_record
*)
448 ((char *)bp
->b_data
+ entryoffsetinblock
);
450 reclen
= isonum_711(ep
->length
);
452 /* skip to next block, if any */
454 (idp
->curroff
& ~bmask
) + imp
->logical_block_size
;
458 if (reclen
< ISO_DIRECTORY_RECORD_SIZE
) {
460 /* illegal entry, stop */
464 if (entryoffsetinblock
+ reclen
> imp
->logical_block_size
) {
466 /* illegal directory, so stop looking */
470 idp
->current
.d_namlen
= isonum_711(ep
->name_len
);
472 if (reclen
< ISO_DIRECTORY_RECORD_SIZE
+ idp
->current
.d_namlen
) {
474 /* illegal entry, stop */
478 if (isonum_711(ep
->flags
)&2)
479 idp
->current
.d_fileno
= isodirino(ep
, imp
);
481 idp
->current
.d_fileno
= dbtob(bp
->b_blkno
) +
484 idp
->curroff
+= reclen
;
486 switch (imp
->iso_ftype
) {
488 cd9660_rrip_getname(ep
, idp
->current
.d_name
, &namelen
,
489 &idp
->current
.d_fileno
, imp
);
490 idp
->current
.d_namlen
= (u_char
)namelen
;
491 if (idp
->current
.d_namlen
)
492 error
= iso_uiodir(idp
, &idp
->current
,
495 default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 */
496 isofntrans(ep
->name
, idp
->current
.d_namlen
,
497 idp
->current
.d_name
, &namelen
,
498 imp
->iso_ftype
== ISO_FTYPE_9660
,
499 (imp
->im_flags
& ISOFSMNT_NOCASETRANS
) == 0,
500 isonum_711(ep
->flags
)&4,
501 imp
->im_joliet_level
);
502 switch (idp
->current
.d_name
[0]) {
504 idp
->current
.d_name
[0] = '.';
505 idp
->current
.d_namlen
= 1;
506 error
= iso_uiodir(idp
, &idp
->current
,
510 strlcpy(idp
->current
.d_name
, "..",
511 sizeof(idp
->current
.d_name
));
512 idp
->current
.d_namlen
= 2;
513 error
= iso_uiodir(idp
, &idp
->current
,
517 idp
->current
.d_namlen
= (u_char
)namelen
;
518 if (imp
->iso_ftype
== ISO_FTYPE_DEFAULT
)
519 error
= iso_shipdir(idp
);
521 error
= iso_uiodir(idp
, &idp
->current
,
529 entryoffsetinblock
+= reclen
;
532 if (!error
&& imp
->iso_ftype
== ISO_FTYPE_DEFAULT
) {
533 idp
->current
.d_namlen
= 0;
534 error
= iso_shipdir(idp
);
539 if (ap
->a_ncookies
!= NULL
) {
541 free(cookies
, M_TEMP
);
544 * Work out the number of cookies actually used.
546 *ap
->a_ncookies
= ncookies
- idp
->ncookies
;
547 *ap
->a_cookies
= cookies
;
554 uio
->uio_offset
= idp
->uio_off
;
555 *ap
->a_eofflag
= idp
->eofflag
;
563 * Return target name of a symbolic link
564 * Shouldn't we get the parent vnode and read the data from there?
565 * This could eventually result in deadlocks in cd9660_lookup.
566 * But otherwise the block read here is in the block buffer two times.
568 typedef struct iso_directory_record ISODIR
;
569 typedef struct iso_node ISONODE
;
570 typedef struct iso_mnt ISOMNT
;
573 cd9660_readlink(void *v
)
575 struct vop_readlink_args
/* {
594 if (imp
->iso_ftype
!= ISO_FTYPE_RRIP
)
598 * Get parents directory record block that this inode included.
600 error
= bread(imp
->im_devvp
,
601 (ip
->i_number
>> imp
->im_bshift
) <<
602 (imp
->im_bshift
- DEV_BSHIFT
),
603 imp
->logical_block_size
, 0, &bp
);
609 * Setup the directory pointer for this inode
611 dirp
= (ISODIR
*)((char *)bp
->b_data
+ (ip
->i_number
& imp
->im_bmask
));
614 * Just make sure, we have a right one....
615 * 1: Check not cross boundary on block
617 if ((ip
->i_number
& imp
->im_bmask
) + isonum_711(dirp
->length
)
618 > imp
->logical_block_size
) {
625 * Abuse a namei buffer for now.
627 use_pnbuf
= !VMSPACE_IS_KERNEL_P(uio
->uio_vmspace
) ||
628 uio
->uio_iov
->iov_len
< MAXPATHLEN
;
630 symname
= PNBUF_GET();
632 symname
= uio
->uio_iov
->iov_base
;
636 * Ok, we just gathering a symbolic name in SL record.
638 if (cd9660_rrip_getsymname(dirp
, symname
, &symlen
, imp
) == 0) {
646 * Don't forget before you leave from home ;-)
651 * return with the symbolic name to caller's.
654 error
= uiomove(symname
, symlen
, uio
);
658 uio
->uio_resid
-= symlen
;
659 uio
->uio_iov
->iov_base
= (char *)uio
->uio_iov
->iov_base
+ symlen
;
660 uio
->uio_iov
->iov_len
-= symlen
;
667 struct vop_link_v2_args
/* {
670 struct componentname *a_cnp;
673 VOP_ABORTOP(ap
->a_dvp
, ap
->a_cnp
);
678 cd9660_symlink(void *v
)
680 struct vop_symlink_v3_args
/* {
682 struct vnode **a_vpp;
683 struct componentname *a_cnp;
688 VOP_ABORTOP(ap
->a_dvp
, ap
->a_cnp
);
693 * Calculate the logical to physical mapping if not done already,
694 * then call the device strategy routine.
697 cd9660_strategy(void *v
)
699 struct vop_strategy_args
/* {
703 struct buf
*bp
= ap
->a_bp
;
704 struct vnode
*vp
= ap
->a_vp
;
709 if (vp
->v_type
== VBLK
|| vp
->v_type
== VCHR
)
710 panic("cd9660_strategy: spec");
711 if (bp
->b_blkno
== bp
->b_lblkno
) {
712 error
= VOP_BMAP(vp
, bp
->b_lblkno
, NULL
, &bp
->b_blkno
, NULL
);
718 if ((long)bp
->b_blkno
== -1)
721 if ((long)bp
->b_blkno
== -1) {
725 vp
= ip
->i_mnt
->im_devvp
;
726 return (VOP_STRATEGY(vp
, bp
));
730 * Print out the contents of an inode.
734 cd9660_print(void *v
)
737 printf("tag VT_ISOFS, isofs vnode\n");
742 * Return POSIX pathconf information applicable to cd9660 filesystems.
745 cd9660_pathconf(void *v
)
747 struct vop_pathconf_args
/* {
750 register_t *a_retval;
752 switch (ap
->a_name
) {
757 if (VTOI(ap
->a_vp
)->i_mnt
->iso_ftype
== ISO_FTYPE_RRIP
)
758 *ap
->a_retval
= ISO_MAXNAMLEN
;
763 *ap
->a_retval
= PATH_MAX
;
766 *ap
->a_retval
= PIPE_BUF
;
768 case _PC_CHOWN_RESTRICTED
:
777 case _PC_FILESIZEBITS
:
787 * Allow changing the size for special files (and fifos).
790 cd9660_setattr(void *v
)
792 struct vop_setattr_args
/* {
793 struct vnodeop_desc *a_desc;
799 struct vattr
*vap
= ap
->a_vap
;
800 struct vnode
*vp
= ap
->a_vp
;
803 * Only size is changeable.
805 if (vap
->va_type
!= VNON
806 || vap
->va_nlink
!= (nlink_t
)VNOVAL
807 || vap
->va_fsid
!= VNOVAL
808 || vap
->va_fileid
!= VNOVAL
809 || vap
->va_blocksize
!= VNOVAL
810 || vap
->va_rdev
!= (dev_t
)VNOVAL
811 || (int)vap
->va_bytes
!= VNOVAL
812 || vap
->va_gen
!= VNOVAL
813 || vap
->va_flags
!= VNOVAL
814 || vap
->va_uid
!= (uid_t
)VNOVAL
815 || vap
->va_gid
!= (gid_t
)VNOVAL
816 || vap
->va_atime
.tv_sec
!= VNOVAL
817 || vap
->va_mtime
.tv_sec
!= VNOVAL
818 || vap
->va_mode
!= (mode_t
)VNOVAL
)
821 if (vap
->va_size
!= VNOVAL
822 && vp
->v_type
!= VCHR
823 && vp
->v_type
!= VBLK
824 && vp
->v_type
!= VFIFO
)
831 * Global vfs data structures for isofs
833 #define cd9660_create genfs_eopnotsupp
834 #define cd9660_mknod genfs_eopnotsupp
835 #define cd9660_write genfs_eopnotsupp
836 #define cd9660_fsync genfs_nullop
837 #define cd9660_remove genfs_eopnotsupp
838 #define cd9660_rename genfs_eopnotsupp
839 #define cd9660_mkdir genfs_eopnotsupp
840 #define cd9660_rmdir genfs_eopnotsupp
841 #define cd9660_advlock genfs_einval
842 #define cd9660_bwrite genfs_eopnotsupp
843 #define cd9660_revoke genfs_revoke
846 * Global vfs data structures for cd9660
848 int (**cd9660_vnodeop_p
)(void *);
849 const struct vnodeopv_entry_desc cd9660_vnodeop_entries
[] = {
850 { &vop_default_desc
, vn_default_error
},
851 { &vop_lookup_desc
, cd9660_lookup
}, /* lookup */
852 { &vop_create_desc
, cd9660_create
}, /* create */
853 { &vop_mknod_desc
, cd9660_mknod
}, /* mknod */
854 { &vop_open_desc
, cd9660_open
}, /* open */
855 { &vop_close_desc
, cd9660_close
}, /* close */
856 { &vop_access_desc
, cd9660_access
}, /* access */
857 { &vop_getattr_desc
, cd9660_getattr
}, /* getattr */
858 { &vop_setattr_desc
, cd9660_setattr
}, /* setattr */
859 { &vop_read_desc
, cd9660_read
}, /* read */
860 { &vop_write_desc
, cd9660_write
}, /* write */
861 { &vop_fallocate_desc
, genfs_eopnotsupp
}, /* fallocate */
862 { &vop_fdiscard_desc
, genfs_eopnotsupp
}, /* fdiscard */
863 { &vop_fcntl_desc
, genfs_fcntl
}, /* fcntl */
864 { &vop_ioctl_desc
, cd9660_ioctl
}, /* ioctl */
865 { &vop_poll_desc
, cd9660_poll
}, /* poll */
866 { &vop_revoke_desc
, cd9660_revoke
}, /* revoke */
867 { &vop_mmap_desc
, cd9660_mmap
}, /* mmap */
868 { &vop_fsync_desc
, cd9660_fsync
}, /* fsync */
869 { &vop_seek_desc
, cd9660_seek
}, /* seek */
870 { &vop_remove_desc
, cd9660_remove
}, /* remove */
871 { &vop_link_desc
, cd9660_link
}, /* link */
872 { &vop_rename_desc
, cd9660_rename
}, /* rename */
873 { &vop_mkdir_desc
, cd9660_mkdir
}, /* mkdir */
874 { &vop_rmdir_desc
, cd9660_rmdir
}, /* rmdir */
875 { &vop_symlink_desc
, cd9660_symlink
}, /* symlink */
876 { &vop_readdir_desc
, cd9660_readdir
}, /* readdir */
877 { &vop_readlink_desc
, cd9660_readlink
}, /* readlink */
878 { &vop_abortop_desc
, cd9660_abortop
}, /* abortop */
879 { &vop_inactive_desc
, cd9660_inactive
}, /* inactive */
880 { &vop_reclaim_desc
, cd9660_reclaim
}, /* reclaim */
881 { &vop_lock_desc
, genfs_lock
}, /* lock */
882 { &vop_unlock_desc
, genfs_unlock
}, /* unlock */
883 { &vop_bmap_desc
, cd9660_bmap
}, /* bmap */
884 { &vop_strategy_desc
, cd9660_strategy
}, /* strategy */
885 { &vop_print_desc
, cd9660_print
}, /* print */
886 { &vop_islocked_desc
, genfs_islocked
}, /* islocked */
887 { &vop_pathconf_desc
, cd9660_pathconf
}, /* pathconf */
888 { &vop_advlock_desc
, cd9660_advlock
}, /* advlock */
889 { &vop_bwrite_desc
, vn_bwrite
}, /* bwrite */
890 { &vop_getpages_desc
, genfs_getpages
}, /* getpages */
891 { &vop_putpages_desc
, genfs_putpages
}, /* putpages */
894 const struct vnodeopv_desc cd9660_vnodeop_opv_desc
=
895 { &cd9660_vnodeop_p
, cd9660_vnodeop_entries
};
898 * Special device vnode ops
900 int (**cd9660_specop_p
)(void *);
901 const struct vnodeopv_entry_desc cd9660_specop_entries
[] = {
902 { &vop_default_desc
, vn_default_error
},
903 { &vop_lookup_desc
, spec_lookup
}, /* lookup */
904 { &vop_create_desc
, spec_create
}, /* create */
905 { &vop_mknod_desc
, spec_mknod
}, /* mknod */
906 { &vop_open_desc
, spec_open
}, /* open */
907 { &vop_close_desc
, spec_close
}, /* close */
908 { &vop_access_desc
, cd9660_access
}, /* access */
909 { &vop_getattr_desc
, cd9660_getattr
}, /* getattr */
910 { &vop_setattr_desc
, cd9660_setattr
}, /* setattr */
911 { &vop_read_desc
, spec_read
}, /* read */
912 { &vop_write_desc
, spec_write
}, /* write */
913 { &vop_fallocate_desc
, spec_fallocate
}, /* fallocate */
914 { &vop_fdiscard_desc
, spec_fdiscard
}, /* fdiscard */
915 { &vop_fcntl_desc
, genfs_fcntl
}, /* fcntl */
916 { &vop_ioctl_desc
, spec_ioctl
}, /* ioctl */
917 { &vop_poll_desc
, spec_poll
}, /* poll */
918 { &vop_kqfilter_desc
, spec_kqfilter
}, /* kqfilter */
919 { &vop_revoke_desc
, spec_revoke
}, /* revoke */
920 { &vop_mmap_desc
, spec_mmap
}, /* mmap */
921 { &vop_fsync_desc
, spec_fsync
}, /* fsync */
922 { &vop_seek_desc
, spec_seek
}, /* seek */
923 { &vop_remove_desc
, spec_remove
}, /* remove */
924 { &vop_link_desc
, spec_link
}, /* link */
925 { &vop_rename_desc
, spec_rename
}, /* rename */
926 { &vop_mkdir_desc
, spec_mkdir
}, /* mkdir */
927 { &vop_rmdir_desc
, spec_rmdir
}, /* rmdir */
928 { &vop_symlink_desc
, spec_symlink
}, /* symlink */
929 { &vop_readdir_desc
, spec_readdir
}, /* readdir */
930 { &vop_readlink_desc
, spec_readlink
}, /* readlink */
931 { &vop_abortop_desc
, spec_abortop
}, /* abortop */
932 { &vop_inactive_desc
, cd9660_inactive
}, /* inactive */
933 { &vop_reclaim_desc
, cd9660_reclaim
}, /* reclaim */
934 { &vop_lock_desc
, genfs_lock
}, /* lock */
935 { &vop_unlock_desc
, genfs_unlock
}, /* unlock */
936 { &vop_bmap_desc
, spec_bmap
}, /* bmap */
937 { &vop_strategy_desc
, spec_strategy
}, /* strategy */
938 { &vop_print_desc
, cd9660_print
}, /* print */
939 { &vop_islocked_desc
, genfs_islocked
}, /* islocked */
940 { &vop_pathconf_desc
, spec_pathconf
}, /* pathconf */
941 { &vop_advlock_desc
, spec_advlock
}, /* advlock */
942 { &vop_bwrite_desc
, vn_bwrite
}, /* bwrite */
943 { &vop_getpages_desc
, spec_getpages
}, /* getpages */
944 { &vop_putpages_desc
, spec_putpages
}, /* putpages */
947 const struct vnodeopv_desc cd9660_specop_opv_desc
=
948 { &cd9660_specop_p
, cd9660_specop_entries
};
950 int (**cd9660_fifoop_p
)(void *);
951 const struct vnodeopv_entry_desc cd9660_fifoop_entries
[] = {
952 { &vop_default_desc
, vn_default_error
},
953 { &vop_lookup_desc
, vn_fifo_bypass
}, /* lookup */
954 { &vop_create_desc
, vn_fifo_bypass
}, /* create */
955 { &vop_mknod_desc
, vn_fifo_bypass
}, /* mknod */
956 { &vop_open_desc
, vn_fifo_bypass
}, /* open */
957 { &vop_close_desc
, vn_fifo_bypass
}, /* close */
958 { &vop_access_desc
, cd9660_access
}, /* access */
959 { &vop_getattr_desc
, cd9660_getattr
}, /* getattr */
960 { &vop_setattr_desc
, cd9660_setattr
}, /* setattr */
961 { &vop_read_desc
, vn_fifo_bypass
}, /* read */
962 { &vop_write_desc
, vn_fifo_bypass
}, /* write */
963 { &vop_fallocate_desc
, vn_fifo_bypass
}, /* fallocate */
964 { &vop_fdiscard_desc
, vn_fifo_bypass
}, /* fdiscard */
965 { &vop_fcntl_desc
, genfs_fcntl
}, /* fcntl */
966 { &vop_ioctl_desc
, vn_fifo_bypass
}, /* ioctl */
967 { &vop_poll_desc
, vn_fifo_bypass
}, /* poll */
968 { &vop_kqfilter_desc
, vn_fifo_bypass
}, /* kqfilter */
969 { &vop_revoke_desc
, vn_fifo_bypass
}, /* revoke */
970 { &vop_mmap_desc
, vn_fifo_bypass
}, /* mmap */
971 { &vop_fsync_desc
, vn_fifo_bypass
}, /* fsync */
972 { &vop_seek_desc
, vn_fifo_bypass
}, /* seek */
973 { &vop_remove_desc
, vn_fifo_bypass
}, /* remove */
974 { &vop_link_desc
, vn_fifo_bypass
} , /* link */
975 { &vop_rename_desc
, vn_fifo_bypass
}, /* rename */
976 { &vop_mkdir_desc
, vn_fifo_bypass
}, /* mkdir */
977 { &vop_rmdir_desc
, vn_fifo_bypass
}, /* rmdir */
978 { &vop_symlink_desc
, vn_fifo_bypass
}, /* symlink */
979 { &vop_readdir_desc
, vn_fifo_bypass
}, /* readdir */
980 { &vop_readlink_desc
, vn_fifo_bypass
}, /* readlink */
981 { &vop_abortop_desc
, vn_fifo_bypass
}, /* abortop */
982 { &vop_inactive_desc
, cd9660_inactive
}, /* inactive */
983 { &vop_reclaim_desc
, cd9660_reclaim
}, /* reclaim */
984 { &vop_lock_desc
, genfs_lock
}, /* lock */
985 { &vop_unlock_desc
, genfs_unlock
}, /* unlock */
986 { &vop_bmap_desc
, vn_fifo_bypass
}, /* bmap */
987 { &vop_strategy_desc
, vn_fifo_bypass
}, /* strategy */
988 { &vop_print_desc
, cd9660_print
}, /* print */
989 { &vop_islocked_desc
, genfs_islocked
}, /* islocked */
990 { &vop_pathconf_desc
, vn_fifo_bypass
}, /* pathconf */
991 { &vop_advlock_desc
, vn_fifo_bypass
}, /* advlock */
992 { &vop_bwrite_desc
, vn_bwrite
}, /* bwrite */
993 { &vop_putpages_desc
, vn_fifo_bypass
}, /* putpages */
996 const struct vnodeopv_desc cd9660_fifoop_opv_desc
=
997 { &cd9660_fifoop_p
, cd9660_fifoop_entries
};