2 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 /* $NetBSD: cd9660_vnops.c,v 1.22 1994/12/27 19:05:12 mycroft Exp $ */
32 * The Regents of the University of California. All rights reserved.
34 * This code is derived from software contributed to Berkeley
35 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
36 * Support code is derived from software contributed to Berkeley
37 * by Atsushi Murai (amurai@spec.co.jp).
39 * Redistribution and use in source and binary forms, with or without
40 * modification, are permitted provided that the following conditions
42 * 1. Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * 2. Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in the
46 * documentation and/or other materials provided with the distribution.
47 * 3. All advertising materials mentioning features or use of this software
48 * must display the following acknowledgement:
49 * This product includes software developed by the University of
50 * California, Berkeley and its contributors.
51 * 4. Neither the name of the University nor the names of its contributors
52 * may be used to endorse or promote products derived from this software
53 * without specific prior written permission.
55 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
56 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
59 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
67 * @(#)cd9660_vnops.c 8.15 (Berkeley) 12/5/94
70 * 02-Feb-00 chw Add cd9660_copyfile to return error
71 * 29-Sep-98 djb Add cd9660_getattrlist VOP for VDI support.
72 * 15-sep-98 added cd9660_rmdir to do proper unlocking - chw
73 * 12-aug-98 added cd9660_remove which will do proper unlocking - chw
74 * 17-Feb-98 radar 1669467 - changed lock protocols to use the lock manager - chw
75 * 22-Jan-98 radar 1669467 - ISO 9660 CD support - jwc
78 #include <sys/param.h>
79 #include <sys/systm.h>
80 #include <sys/vnode.h>
81 #include <sys/mount.h>
82 #include <sys/namei.h>
83 #include <sys/resourcevar.h>
84 #include <sys/kernel.h>
89 #include <sys/kauth.h>
91 #include <miscfs/specfs/specdev.h>
92 #include <miscfs/fifofs/fifo.h>
93 #include <sys/malloc.h>
96 #include <vfs/vfs_support.h>
97 #include <vm/vm_kern.h>
100 #include <sys/ubc_internal.h>
101 #include <sys/uio_internal.h>
102 #include <libkern/OSByteOrder.h>
104 #include <vm/vm_map.h>
105 #include <vm/vm_kern.h> /* kmem_alloc, kmem_free */
107 #include <isofs/cd9660/iso.h>
108 #include <isofs/cd9660/cd9660_node.h>
109 #include <isofs/cd9660/iso_rrip.h>
117 cd9660_open(__unused
struct vnop_open_args
*ap
)
125 * Update the times on the inode on writeable file systems.
128 cd9660_close(__unused
struct vnop_close_args
*ap
)
134 cd9660_getattr(struct vnop_getattr_args
*ap
)
136 struct vnode
*vp
= ap
->a_vp
;
137 register struct vnode_attr
*vap
= ap
->a_vap
;
138 register struct iso_node
*ip
= VTOI(vp
);
140 VATTR_RETURN(vap
, va_fsid
, ip
->i_dev
);
141 VATTR_RETURN(vap
, va_fileid
, ip
->i_number
);
143 VATTR_RETURN(vap
, va_mode
, ip
->inode
.iso_mode
);
144 VATTR_RETURN(vap
, va_nlink
, ip
->inode
.iso_links
);
145 VATTR_RETURN(vap
, va_uid
, ip
->inode
.iso_uid
);
146 VATTR_RETURN(vap
, va_gid
, ip
->inode
.iso_gid
);
147 VATTR_RETURN(vap
, va_access_time
, ip
->inode
.iso_atime
);
148 VATTR_RETURN(vap
, va_modify_time
, ip
->inode
.iso_mtime
);
149 VATTR_RETURN(vap
, va_change_time
, ip
->inode
.iso_ctime
);
150 VATTR_RETURN(vap
, va_rdev
, ip
->inode
.iso_rdev
);
152 VATTR_RETURN(vap
, va_data_size
, (off_t
)ip
->i_size
);
153 if (ip
->i_size
== 0 && (vap
->va_mode
& S_IFMT
) == S_IFLNK
) {
154 struct vnop_readlink_args rdlnk
;
156 char uio_buf
[ UIO_SIZEOF(1) ];
159 MALLOC(cp
, char *, MAXPATHLEN
, M_TEMP
, M_WAITOK
);
160 auio
= uio_createwithbuffer(1, 0, UIO_SYSSPACE
, UIO_READ
,
161 &uio_buf
[0], sizeof(uio_buf
));
162 uio_addiov(auio
, CAST_USER_ADDR_T(cp
), MAXPATHLEN
);
165 rdlnk
.a_vp
= ap
->a_vp
;
166 rdlnk
.a_context
= ap
->a_context
;
167 if (cd9660_readlink(&rdlnk
) == 0)
168 // LP64todo - fix this!
169 VATTR_RETURN(vap
, va_data_size
, MAXPATHLEN
- uio_resid(auio
));
172 VATTR_RETURN(vap
, va_flags
, 0);
173 VATTR_RETURN(vap
, va_gen
, 1);
174 VATTR_RETURN(vap
, va_iosize
, ip
->i_mnt
->logical_block_size
);
175 VATTR_RETURN(vap
, va_total_size
, ip
->i_size
+ ip
->i_rsrcsize
);
182 * Vnode op for reading.
185 cd9660_read(struct vnop_read_args
*ap
)
187 struct vnode
*vp
= ap
->a_vp
;
188 register struct uio
*uio
= ap
->a_uio
;
189 register struct iso_node
*ip
= VTOI(vp
);
190 register struct iso_mnt
*imp
;
195 int rasize
, error
= 0;
198 if (uio_resid(uio
) == 0)
200 if (uio
->uio_offset
< 0)
205 if (UBCINFOEXISTS(vp
)) {
207 * Copy any part of the Apple Double header.
209 if ((ip
->i_flag
& ISO_ASSOCIATED
) && (uio
->uio_offset
< ADH_SIZE
)) {
210 apple_double_header_t header
;
213 if (uio
->uio_offset
< sizeof(apple_double_header_t
)) {
214 header
.magic
= APPLEDOUBLE_MAGIC
;
215 header
.version
= APPLEDOUBLE_VERSION
;
217 header
.entries
[0].entryID
= APPLEDOUBLE_FINDERINFO
;
218 header
.entries
[0].offset
= offsetof(apple_double_header_t
, finfo
);
219 header
.entries
[0].length
= 32;
220 header
.entries
[1].entryID
= APPLEDOUBLE_RESFORK
;
221 header
.entries
[1].offset
= ADH_SIZE
;
222 header
.entries
[1].length
= ip
->i_size
- ADH_SIZE
;
223 header
.finfo
.fdType
= ip
->i_FileType
;
224 header
.finfo
.fdCreator
= ip
->i_Creator
;
225 header
.finfo
.fdFlags
= ip
->i_FinderFlags
;
226 header
.finfo
.fdLocation
.v
= -1;
227 header
.finfo
.fdLocation
.h
= -1;
228 header
.finfo
.fdReserved
= 0;
230 bytes
= min(uio_resid(uio
), sizeof(apple_double_header_t
) - uio
->uio_offset
);
231 error
= uiomove(((char *) &header
) + uio
->uio_offset
, bytes
, uio
);
235 if (uio_resid(uio
) && uio
->uio_offset
< ADH_SIZE
) {
238 if (kmem_alloc(kernel_map
, (vm_offset_t
*)&buffer
, ADH_SIZE
)) {
241 bytes
= min(uio_resid(uio
), ADH_SIZE
- uio
->uio_offset
);
242 error
= uiomove(((char *) buffer
) + uio
->uio_offset
, bytes
, uio
);
243 kmem_free(kernel_map
, (vm_offset_t
)buffer
, ADH_SIZE
);
248 if (uio_resid(uio
) > 0)
249 error
= cluster_read(vp
, uio
, (off_t
)ip
->i_size
, ap
->a_ioflag
);
253 lbn
= lblkno(imp
, uio
->uio_offset
);
254 on
= blkoff(imp
, uio
->uio_offset
);
255 n
= min((u_int
)(imp
->logical_block_size
- on
),
257 diff
= (off_t
)ip
->i_size
- uio
->uio_offset
;
262 size
= blksize(imp
, ip
, lbn
);
263 rablock
= (daddr64_t
)lbn
+ 1;
265 if (ip
->i_lastr
+ 1 == lbn
&&
266 lblktosize(imp
, rablock
) < ip
->i_size
) {
267 rasize
= blksize(imp
, ip
, (daddr_t
)rablock
);
268 error
= (int)buf_breadn(vp
, (daddr64_t
)((unsigned)lbn
), size
, &rablock
,
269 &rasize
, 1, NOCRED
, &bp
);
271 error
= (int)buf_bread(vp
, (daddr64_t
)((unsigned)lbn
), size
, NOCRED
, &bp
);
274 n
= min(n
, size
- buf_resid(bp
));
280 error
= uiomove((caddr_t
)(buf_dataptr(bp
) + on
), (int)n
, uio
);
281 if (n
+ on
== imp
->logical_block_size
||
282 uio
->uio_offset
== (off_t
)ip
->i_size
)
285 } while (error
== 0 && uio_resid(uio
) > 0 && n
!= 0);
292 cd9660_ioctl(__unused
struct vnop_ioctl_args
*ap
)
298 cd9660_select(__unused
struct vnop_select_args
*ap
)
301 * We should really check to see if I/O is possible.
309 * NB Currently unsupported.
312 cd9660_mmap(__unused
struct vnop_mmap_args
*ap
)
319 * Structure for reading directories
322 struct dirent saveent
;
323 struct dirent current
;
334 iso_uiodir(struct isoreaddir
*idp
, struct dirent
*dp
, off_t off
)
338 dp
->d_name
[dp
->d_namlen
] = 0;
339 dp
->d_reclen
= DIRSIZ(dp
);
341 if (uio_resid(idp
->uio
) < dp
->d_reclen
) {
348 if (*idp
->ncookies
<= 0) {
353 **idp
->cookies
++ = off
;
358 if ( (error
= uiomove( (caddr_t
)dp
, dp
->d_reclen
, idp
->uio
)) )
365 iso_shipdir(struct isoreaddir
*idp
)
372 cl
= idp
->current
.d_namlen
;
373 cname
= idp
->current
.d_name
;
380 || bcmp(sname
,cname
,sl
)) {
381 if (idp
->saveent
.d_namlen
) {
382 if ( (error
= iso_uiodir(idp
,&idp
->saveent
,idp
->saveoff
)) )
384 idp
->saveent
.d_namlen
= 0;
388 idp
->current
.d_reclen
= DIRSIZ(&idp
->current
);
389 idp
->saveoff
= idp
->curroff
;
390 bcopy(&idp
->current
,&idp
->saveent
,idp
->current
.d_reclen
);
395 * Vnode op for readdir
397 * Note that directories are sector aligned (2K) and
398 * that an entry can cross a logical block but not
402 cd9660_readdir(struct vnop_readdir_args
*ap
)
404 register struct uio
*uio
= ap
->a_uio
;
406 off_t startingOffset
= uio
->uio_offset
;
409 struct isoreaddir
*idp
;
410 struct vnode
*vdp
= ap
->a_vp
;
413 struct buf
*bp
= NULL
;
414 struct iso_directory_record
*ep
;
415 int entryoffsetinblock
;
422 if (ap
->a_flags
& (VNODE_READDIR_EXTENDED
| VNODE_READDIR_REQSEEKOFF
))
427 bmask
= imp
->im_sector_size
- 1;
429 MALLOC(idp
, struct isoreaddir
*, sizeof(*idp
), M_TEMP
, M_WAITOK
);
430 idp
->saveent
.d_namlen
= 0;
433 * Is it worth trying to figure out the type?
435 idp
->saveent
.d_type
= idp
->current
.d_type
= DT_UNKNOWN
;
438 idp
->curroff
= uio
->uio_offset
;
440 if ((entryoffsetinblock
= idp
->curroff
& bmask
) &&
441 (error
= cd9660_blkatoff(vdp
, SECTOFF(imp
, idp
->curroff
), NULL
, &bp
))) {
445 endsearch
= dp
->i_size
;
447 while (idp
->curroff
< endsearch
) {
449 * If offset is on a block boundary,
450 * read the next directory block.
451 * Release previous if it exists.
453 if ((idp
->curroff
& bmask
) == 0) {
456 if ((error
= cd9660_blkatoff(vdp
, SECTOFF(imp
, idp
->curroff
), NULL
, &bp
)))
458 entryoffsetinblock
= 0;
461 * Get pointer to next entry.
463 ep
= (struct iso_directory_record
*)
464 (buf_dataptr(bp
) + entryoffsetinblock
);
466 reclen
= isonum_711(ep
->length
);
468 /* skip to next block, if any */
470 (idp
->curroff
& ~bmask
) + imp
->im_sector_size
;
474 if (reclen
< ISO_DIRECTORY_RECORD_SIZE
) {
476 /* illegal entry, stop */
480 if (entryoffsetinblock
+ reclen
> imp
->im_sector_size
) {
482 /* illegal directory, so stop looking */
486 idp
->current
.d_namlen
= isonum_711(ep
->name_len
);
488 if (reclen
< ISO_DIRECTORY_RECORD_SIZE
+ idp
->current
.d_namlen
) {
490 /* illegal entry, stop */
495 * Some poorly mastered discs have an incorrect directory
496 * file size. If the '.' entry has a better size (bigger)
497 * then use that instead.
499 if ((uio
->uio_offset
== 0) && (isonum_733(ep
->size
) > endsearch
)) {
500 dp
->i_size
= endsearch
= isonum_733(ep
->size
);
503 if ( isonum_711(ep
->flags
) & directoryBit
)
504 idp
->current
.d_fileno
= isodirino(ep
, imp
);
506 idp
->current
.d_fileno
= ((daddr_t
)buf_blkno(bp
) << imp
->im_bshift
) +
510 idp
->curroff
+= reclen
;
512 switch (imp
->iso_ftype
) {
514 cd9660_rrip_getname(ep
,idp
->current
.d_name
, &namelen
,
515 &idp
->current
.d_fileno
,imp
);
516 idp
->current
.d_namlen
= (u_char
)namelen
;
517 if (idp
->current
.d_namlen
)
518 error
= iso_uiodir(idp
,&idp
->current
,idp
->curroff
);
521 case ISO_FTYPE_JOLIET
:
522 ucsfntrans((u_int16_t
*)ep
->name
, idp
->current
.d_namlen
,
523 idp
->current
.d_name
, &namelen
,
524 isonum_711(ep
->flags
) & directoryBit
,
525 isonum_711(ep
->flags
) & associatedBit
);
526 idp
->current
.d_namlen
= (u_char
)namelen
;
527 if (idp
->current
.d_namlen
)
528 error
= iso_uiodir(idp
,&idp
->current
,idp
->curroff
);
531 default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 */
532 strlcpy(idp
->current
.d_name
, "..",
533 __DARWIN_MAXNAMLEN
+ 1);
534 switch (ep
->name
[0]) {
536 idp
->current
.d_namlen
= 1;
537 error
= iso_uiodir(idp
,&idp
->current
,idp
->curroff
);
540 idp
->current
.d_namlen
= 2;
541 error
= iso_uiodir(idp
,&idp
->current
,idp
->curroff
);
544 isofntrans(ep
->name
,idp
->current
.d_namlen
,
545 idp
->current
.d_name
, &namelen
,
546 imp
->iso_ftype
== ISO_FTYPE_9660
,
547 isonum_711(ep
->flags
) & associatedBit
);
548 idp
->current
.d_namlen
= (u_char
)namelen
;
549 if (imp
->iso_ftype
== ISO_FTYPE_DEFAULT
)
550 error
= iso_shipdir(idp
);
552 error
= iso_uiodir(idp
,&idp
->current
,idp
->curroff
);
559 entryoffsetinblock
+= reclen
;
562 if (!error
&& imp
->iso_ftype
== ISO_FTYPE_DEFAULT
) {
563 idp
->current
.d_namlen
= 0;
564 error
= iso_shipdir(idp
);
567 if (!error
&& ap
->a_ncookies
) {
568 struct dirent
*dirp
, *dpstart
;
574 * Only the NFS server uses cookies, and it loads the
575 * directory block into system space, so we can just look at
578 * We assume the entire transfer is done to a single contiguous buffer.
580 if (UIO_SEG_IS_USER_SPACE(uio
->uio_segflg
) || uio
->uio_iovcnt
!= 1)
581 panic("ufs_readdir: lost in space");
584 * Make a first pass over the buffer just generated,
585 * counting the number of entries:
587 // LP64todo - fix this!
588 dpstart
= (struct dirent
*)
589 CAST_DOWN(caddr_t
, (uio_iov_base(uio
) - (uio
->uio_offset
- startingOffset
)));
590 for (dirp
= dpstart
, bufferOffset
= startingOffset
, ncookies
= 0;
591 bufferOffset
< uio
->uio_offset
; ) {
592 if (dirp
->d_reclen
== 0)
594 bufferOffset
+= dirp
->d_reclen
;
596 dirp
= (struct dirent
*)((caddr_t
)dirp
+ dirp
->d_reclen
);
598 lost
+= uio
->uio_offset
- bufferOffset
;
599 uio
->uio_offset
= bufferOffset
;
602 * Allocate a buffer to hold the cookies requested:
604 MALLOC(cookies
, u_long
*, ncookies
* sizeof(u_long
), M_TEMP
, M_WAITOK
);
605 *ap
->a_ncookies
= ncookies
;
606 *ap
->a_cookies
= cookies
;
609 * Fill in the offsets for each entry in the buffer just allocated:
611 for (bufferOffset
= startingOffset
, dirp
= dpstart
; bufferOffset
< uio
->uio_offset
; ) {
612 *(cookies
++) = bufferOffset
;
613 bufferOffset
+= dirp
->d_reclen
;
614 dirp
= (struct dirent
*)((caddr_t
)dirp
+ dirp
->d_reclen
);
624 uio
->uio_offset
= idp
->uio_off
;
625 *ap
->a_eofflag
= idp
->eofflag
;
633 * Return target name of a symbolic link
634 * Shouldn't we get the parent vnode and read the data from there?
635 * This could eventually result in deadlocks in cd9660_lookup.
636 * But otherwise the block read here is in the block buffer two times.
638 typedef struct iso_directory_record ISODIR
;
639 typedef struct iso_node ISONODE
;
640 typedef struct iso_mnt ISOMNT
;
642 cd9660_readlink(struct vnop_readlink_args
*ap
)
657 if (imp
->iso_ftype
!= ISO_FTYPE_RRIP
)
661 * Get parents directory record block that this inode included.
663 error
= (int)buf_bread(imp
->im_devvp
,
664 (daddr64_t
)((unsigned)(ip
->i_number
>> imp
->im_bshift
)),
665 imp
->logical_block_size
, NOCRED
, &bp
);
672 * Setup the directory pointer for this inode
674 dirp
= (ISODIR
*)(buf_dataptr(bp
) + (ip
->i_number
& imp
->im_bmask
));
677 * Just make sure, we have a right one....
678 * 1: Check not cross boundary on block
680 if ((ip
->i_number
& imp
->im_bmask
) + isonum_711(dirp
->length
)
681 > imp
->logical_block_size
) {
688 * Abuse a namei buffer for now.
690 if (UIO_SEG_IS_USER_SPACE(uio
->uio_segflg
))
691 MALLOC_ZONE(symname
, char *, MAXPATHLEN
, M_NAMEI
, M_WAITOK
);
693 // LP64todo - fix this!
694 symname
= CAST_DOWN(caddr_t
, uio_iov_base(uio
));
697 * Ok, we just gathering a symbolic name in SL record.
699 if (cd9660_rrip_getsymname(dirp
, symname
, &symlen
, imp
) == 0) {
700 if (UIO_SEG_IS_USER_SPACE(uio
->uio_segflg
))
701 FREE_ZONE(symname
, MAXPATHLEN
, M_NAMEI
);
706 * Don't forget before you leave from home ;-)
711 * return with the symbolic name to caller's.
713 if (UIO_SEG_IS_USER_SPACE(uio
->uio_segflg
)) {
714 error
= uiomove(symname
, symlen
, uio
);
715 FREE_ZONE(symname
, MAXPATHLEN
, M_NAMEI
);
719 uio_setresid(uio
, (uio_resid(uio
) - symlen
));
720 uio_iov_len_add(uio
, -((int64_t)symlen
));
722 uio_setresid(uio
, (uio_resid(uio
) - symlen
));
723 uio_iov_len_add(uio
, -((int)symlen
));
725 uio_iov_base_add(uio
, symlen
);
731 * prepare and issue the I/O
734 cd9660_strategy(struct vnop_strategy_args
*ap
)
737 vnode_t vp
= buf_vnode(bp
);
738 struct iso_node
*ip
= VTOI(vp
);
740 return (buf_strategy(ip
->i_devvp
, ap
));
745 * Return POSIX pathconf information applicable to cd9660 filesystems.
748 cd9660_pathconf(struct vnop_pathconf_args
*ap
)
751 switch (ap
->a_name
) {
756 switch (VTOI(ap
->a_vp
)->i_mnt
->iso_ftype
) {
758 *ap
->a_retval
= ISO_RRIP_NAMEMAX
;
760 case ISO_FTYPE_JOLIET
:
761 *ap
->a_retval
= ISO_JOLIET_NAMEMAX
;
764 *ap
->a_retval
= ISO_NAMEMAX
;
768 *ap
->a_retval
= PATH_MAX
;
771 *ap
->a_retval
= PIPE_BUF
;
773 case _PC_CHOWN_RESTRICTED
:
774 *ap
->a_retval
= 200112; /* _POSIX_CHOWN_RESTRICTED */
777 *ap
->a_retval
= 200112; /* _POSIX_NO_TRUNC */
786 * Unsupported operation
789 cd9660_enotsupp(void)
793 /* Pagein. similar to read */
795 cd9660_pagein(struct vnop_pagein_args
*ap
)
797 struct vnode
*vp
= ap
->a_vp
;
799 size_t size
= ap
->a_size
;
800 off_t f_offset
= ap
->a_f_offset
;
801 vm_offset_t pl_offset
= ap
->a_pl_offset
;
802 int flags
= ap
->a_flags
;
803 register struct iso_node
*ip
= VTOI(vp
);
807 * Copy the Apple Double header.
809 if ((ip
->i_flag
& ISO_ASSOCIATED
) && (f_offset
== 0) && (size
== ADH_SIZE
)) {
810 apple_double_header_t header
;
814 kret
= ubc_upl_map(pl
, &ioaddr
);
815 if (kret
!= KERN_SUCCESS
)
816 panic("cd9660_xa_pagein: ubc_upl_map error = %d", kret
);
818 bzero((caddr_t
)ioaddr
, ADH_SIZE
);
820 header
.magic
= APPLEDOUBLE_MAGIC
;
821 header
.version
= APPLEDOUBLE_VERSION
;
823 header
.entries
[0].entryID
= APPLEDOUBLE_FINDERINFO
;
824 header
.entries
[0].offset
= offsetof(apple_double_header_t
, finfo
);
825 header
.entries
[0].length
= 32;
826 header
.entries
[1].entryID
= APPLEDOUBLE_RESFORK
;
827 header
.entries
[1].offset
= ADH_SIZE
;
828 header
.entries
[1].length
= ip
->i_size
- ADH_SIZE
;
829 header
.finfo
.fdType
= ip
->i_FileType
;
830 header
.finfo
.fdCreator
= ip
->i_Creator
;
831 header
.finfo
.fdFlags
= ip
->i_FinderFlags
;
832 header
.finfo
.fdLocation
.v
= -1;
833 header
.finfo
.fdLocation
.h
= -1;
834 header
.finfo
.fdReserved
= 0;
836 bcopy((caddr_t
)&header
, (caddr_t
)ioaddr
, sizeof(apple_double_header_t
));
838 kret
= ubc_upl_unmap(pl
);
839 if (kret
!= KERN_SUCCESS
)
840 panic("cd9660_xa_pagein: ubc_upl_unmap error = %d", kret
);
842 if ((flags
& UPL_NOCOMMIT
) == 0) {
843 ubc_upl_commit_range(pl
, pl_offset
, size
, UPL_COMMIT_FREE_ON_EMPTY
);
846 /* check pageouts are for reg file only and ubc info is present*/
847 error
= cluster_pagein(vp
, pl
, pl_offset
, f_offset
, size
,
848 (off_t
)ip
->i_size
, flags
);
854 * cd9660_remove - not possible to remove a file from iso cds
856 * Locking policy: a_dvp and vp locked on entry, unlocked on exit
859 cd9660_remove(__unused
struct vnop_remove_args
*ap
)
866 * cd9660_rmdir - not possible to remove a directory from iso cds
868 * Locking policy: a_dvp and vp locked on entry, unlocked on exit
871 cd9660_rmdir(struct vnop_rmdir_args
*ap
)
873 (void) nop_rmdir(ap
);
878 * Make a RIFF file header for a CD-ROM XA media file.
880 __private_extern__
void
881 cd9660_xa_init(struct iso_node
*ip
, struct iso_directory_record
*isodir
)
884 struct riff_header
*header
;
888 MALLOC(header
, struct riff_header
*, sizeof(struct riff_header
), M_TEMP
, M_WAITOK
);
890 sectors
= ip
->i_size
/ 2048;
892 strncpy(header
->riff
, "RIFF", 4);
893 header
->fileSize
= OSSwapHostToLittleInt32(sectors
* CDXA_SECTOR_SIZE
+ sizeof(struct riff_header
) - 8);
894 strncpy(header
->cdxa
, "CDXA", 4);
895 strncpy(header
->fmt
, "fmt ", 4);
896 header
->fmtSize
= OSSwapHostToLittleConstInt32(16);
897 strncpy(header
->data
, "data", 4);
898 header
->dataSize
= OSSwapHostToLittleInt32(sectors
* CDXA_SECTOR_SIZE
);
901 * Copy the CD-ROM XA extended directory information into the header. As far as
902 * I can tell, it's always 14 bytes in the directory record, but allocated 16 bytes
903 * in the header (the last two being zeroed pad bytes).
905 name_len
= isonum_711(isodir
->name_len
);
906 cdxa
= &isodir
->name
[name_len
];
907 if ((name_len
& 0x01) == 0)
908 ++cdxa
; /* Skip pad byte */
909 bcopy(cdxa
, header
->fmtData
, 14);
910 header
->fmtData
[14] = 0;
911 header
->fmtData
[15] = 0;
914 * Point this i-node to the "whole sector" device instead of the normal
915 * device. This allows cd9660_strategy to be ignorant of the block
918 ip
->i_devvp
= ip
->i_mnt
->phys_devvp
;
920 ip
->i_size
= sectors
* CDXA_SECTOR_SIZE
+ sizeof(struct riff_header
);
925 * Helper routine for vnop_read and vnop_pagein of CD-ROM XA multimedia files.
926 * This routine determines the physical location of the file, then reads
927 * sectors directly from the device into a buffer. It also handles inserting
928 * the RIFF header at the beginning of the file.
930 * Exactly one of buffer or uio must be non-zero. It will either bcopy to
931 * buffer, or uiomove via uio.
933 * XXX Should this code be using buf_breadn and ip->i_lastr to support single-block
934 * read-ahead? Should we try more aggressive read-ahead like cluster_io does?
936 * XXX This could be made to do larger I/O to the device (reading all the
937 * whole sectors directly into the buffer). That would make the code more
938 * complex, and the current code only adds 2.5% overhead compared to reading
939 * from the device directly (at least on my test machine).
942 cd9660_xa_read_common(
949 struct iso_node
*ip
= VTOI(vp
);
951 off_t diff
; /* number of bytes from offset to file's EOF */
952 daddr_t block
; /* physical disk block containing offset */
953 off_t sect_off
; /* starting offset into current sector */
954 u_int count
; /* number of bytes to transfer in current block */
958 * Copy any part of the RIFF header.
960 if (offset
< sizeof(struct riff_header
)) {
963 p
= ((char *) ip
->i_riff
) + offset
;
964 count
= min(amount
, sizeof(struct riff_header
) - offset
);
966 bcopy(p
, buffer
, count
);
969 error
= uiomove(p
, count
, uio
);
978 * Loop over (possibly partial) blocks to transfer.
980 while (error
== 0 && amount
> 0) {
982 * Determine number of bytes until EOF. If we've hit
985 diff
= ip
->i_size
- offset
;
989 /* Get a block from the underlying device */
990 block
= ip
->iso_start
+ (offset
- sizeof(struct riff_header
))/CDXA_SECTOR_SIZE
;
991 error
= (int)buf_bread(ip
->i_devvp
, (daddr64_t
)((unsigned)block
), CDXA_SECTOR_SIZE
, NOCRED
, &bp
);
997 printf("isofs: cd9660_xa_read_common: buf_bread didn't read full sector\n");
1001 /* Figure out which part of the block to copy, and copy it */
1002 sect_off
= (offset
- sizeof(struct riff_header
)) % CDXA_SECTOR_SIZE
;
1003 count
= min(CDXA_SECTOR_SIZE
-sect_off
, amount
);
1004 if (diff
< count
) /* Pin transfer amount to EOF */
1008 bcopy(CAST_DOWN(caddr_t
, (buf_dataptr(bp
)+sect_off
)), buffer
, count
);
1011 error
= uiomove(CAST_DOWN(caddr_t
, (buf_dataptr(bp
)+sect_off
)), count
, uio
);
1017 * If we copied through the end of the block, or the end of file, then
1018 * age the device block. This is optimized for sequential access.
1020 if (sect_off
+count
== CDXA_SECTOR_SIZE
|| offset
== (off_t
)ip
->i_size
)
1029 * Read from a CD-ROM XA multimedia file.
1031 * This uses the same common routine as pagein for doing the actual read
1034 * This routine doesn't do any caching beyond what the block device does.
1035 * Even then, cd9660_xa_read_common ages the blocks once we read up to
1038 * We don't even take advantage if the file has been memory mapped and has
1039 * valid pages already (in which case we could just uiomove from the page
1040 * to the caller). Since we're a read-only filesystem, there can't be
1041 * any cache coherency problems. Multimedia files are expected to be
1042 * large and streamed anyway, so caching file contents probably isn't
1046 cd9660_xa_read(struct vnop_read_args
*ap
)
1048 struct vnode
*vp
= ap
->a_vp
;
1049 register struct uio
*uio
= ap
->a_uio
;
1050 register struct iso_node
*ip
= VTOI(vp
);
1051 off_t offset
= uio
->uio_offset
;
1052 // LP64todo - fix this!
1053 size_t size
= uio_resid(uio
);
1055 /* Check for some obvious parameter problems */
1060 if (offset
>= ip
->i_size
)
1063 /* Pin the size of the read to the file's EOF */
1064 if (offset
+ size
> ip
->i_size
)
1065 size
= ip
->i_size
- offset
;
1067 return cd9660_xa_read_common(vp
, offset
, size
, NULL
, uio
);
1071 * Page in from a CD-ROM XA media file.
1073 * Since our device block size isn't a power of two, we can't use
1074 * cluster_pagein. Instead, we have to map the page and read into it.
1077 cd9660_xa_pagein(struct vnop_pagein_args
*ap
)
1079 struct vnode
*vp
= ap
->a_vp
;
1080 upl_t pl
= ap
->a_pl
;
1081 size_t size
= ap
->a_size
;
1082 off_t f_offset
= ap
->a_f_offset
;
1083 vm_offset_t pl_offset
= ap
->a_pl_offset
;
1084 int flags
= ap
->a_flags
;
1085 register struct iso_node
*ip
= VTOI(vp
);
1091 panic("cd9660_xa_pagein: size = %d", size
);
1093 kret
= ubc_upl_map(pl
, &ioaddr
);
1094 if (kret
!= KERN_SUCCESS
)
1095 panic("cd9660_xa_pagein: ubc_upl_map error = %d", kret
);
1097 ioaddr
+= pl_offset
;
1099 /* Make sure pagein doesn't extend past EOF */
1100 if (f_offset
+ size
> ip
->i_size
)
1101 size
= ip
->i_size
- f_offset
; /* pin size to EOF */
1103 /* Read the data in using the underlying device */
1104 error
= cd9660_xa_read_common(vp
, f_offset
, size
, (caddr_t
)ioaddr
, NULL
);
1106 /* Zero fill part of page past EOF */
1107 if (ap
->a_size
> size
)
1108 bzero((caddr_t
)ioaddr
+size
, ap
->a_size
-size
);
1110 kret
= ubc_upl_unmap(pl
);
1111 if (kret
!= KERN_SUCCESS
)
1112 panic("cd9660_xa_pagein: ubc_upl_unmap error = %d", kret
);
1114 if ((flags
& UPL_NOCOMMIT
) == 0)
1117 ubc_upl_abort_range(pl
, pl_offset
, ap
->a_size
, UPL_ABORT_FREE_ON_EMPTY
);
1119 ubc_upl_commit_range(pl
, pl_offset
, ap
->a_size
, UPL_COMMIT_FREE_ON_EMPTY
);
1126 * Global vfs data structures for isofs
1128 #define cd9660_create \
1129 ((int (*)(struct vnop_create_args *))err_create)
1130 #define cd9660_mknod ((int (*)(struct vnop_mknod_args *))err_mknod)
1131 #define cd9660_write ((int (*)(struct vnop_write_args *))cd9660_enotsupp)
1132 #define cd9660_fsync ((int (*)(struct vnop_fsync_args *))nullop)
1133 #define cd9660_rename \
1134 ((int (*)(struct vnop_rename_args *))err_rename)
1135 #define cd9660_copyfile \
1136 ((int (*)(struct vnop_copyfile_args *))err_copyfile)
1137 #define cd9660_link ((int (*)(struct vnop_link_args *))err_link)
1138 #define cd9660_mkdir ((int (*)(struct vnop_mkdir_args *))err_mkdir)
1139 #define cd9660_symlink \
1140 ((int (*)(struct vnop_symlink_args *))err_symlink)
1141 #define cd9660_advlock \
1142 ((int (*)(struct vnop_advlock_args *))cd9660_enotsupp)
1143 #define cd9660_bwrite \
1144 ((int (*)(struct vnop_bwrite_args *))cd9660_enotsupp)
1145 #define cd9660_pageout \
1146 ((int (*)(struct vnop_pageout_args *))cd9660_enotsupp)
1147 int cd9660_blktooff(struct vnop_blktooff_args
*ap
);
1148 int cd9660_offtoblk(struct vnop_offtoblk_args
*ap
);
1149 int cd9660_blockmap(struct vnop_blockmap_args
*ap
);
1151 #define VOPFUNC int (*)(void *)
1153 * Global vfs data structures for cd9660
1155 int (**cd9660_vnodeop_p
)(void *);
1156 struct vnodeopv_entry_desc cd9660_vnodeop_entries
[] = {
1157 { &vnop_default_desc
, (VOPFUNC
)vn_default_error
},
1158 { &vnop_lookup_desc
, (VOPFUNC
)cd9660_lookup
}, /* lookup */
1159 { &vnop_create_desc
, (VOPFUNC
)cd9660_create
}, /* create */
1160 { &vnop_mknod_desc
, (VOPFUNC
)cd9660_mknod
}, /* mknod */
1161 { &vnop_open_desc
, (VOPFUNC
)cd9660_open
}, /* open */
1162 { &vnop_close_desc
, (VOPFUNC
)cd9660_close
}, /* close */
1163 { &vnop_getattr_desc
, (VOPFUNC
)cd9660_getattr
}, /* getattr */
1164 { &vnop_read_desc
, (VOPFUNC
)cd9660_read
}, /* read */
1165 { &vnop_write_desc
, (VOPFUNC
)cd9660_write
}, /* write */
1166 { &vnop_ioctl_desc
, (VOPFUNC
)cd9660_ioctl
}, /* ioctl */
1167 { &vnop_select_desc
, (VOPFUNC
)cd9660_select
}, /* select */
1168 { &vnop_mmap_desc
, (VOPFUNC
)cd9660_mmap
}, /* mmap */
1169 { &vnop_fsync_desc
, (VOPFUNC
)cd9660_fsync
}, /* fsync */
1170 { &vnop_remove_desc
, (VOPFUNC
)cd9660_remove
}, /* remove */
1171 { &vnop_link_desc
, (VOPFUNC
)cd9660_link
}, /* link */
1172 { &vnop_rename_desc
, (VOPFUNC
)cd9660_rename
}, /* rename */
1173 { &vnop_copyfile_desc
, (VOPFUNC
)cd9660_copyfile
},/* copyfile */
1174 { &vnop_mkdir_desc
, (VOPFUNC
)cd9660_mkdir
}, /* mkdir */
1175 { &vnop_rmdir_desc
, (VOPFUNC
)cd9660_rmdir
}, /* rmdir */
1176 { &vnop_symlink_desc
, (VOPFUNC
)cd9660_symlink
}, /* symlink */
1177 { &vnop_readdir_desc
, (VOPFUNC
)cd9660_readdir
}, /* readdir */
1178 { &vnop_readlink_desc
, (VOPFUNC
)cd9660_readlink
},/* readlink */
1179 { &vnop_inactive_desc
, (VOPFUNC
)cd9660_inactive
},/* inactive */
1180 { &vnop_reclaim_desc
, (VOPFUNC
)cd9660_reclaim
}, /* reclaim */
1181 { &vnop_strategy_desc
, (VOPFUNC
)cd9660_strategy
},/* strategy */
1182 { &vnop_pathconf_desc
, (VOPFUNC
)cd9660_pathconf
},/* pathconf */
1183 { &vnop_advlock_desc
, (VOPFUNC
)cd9660_advlock
}, /* advlock */
1184 { &vnop_bwrite_desc
, (VOPFUNC
)vn_bwrite
},
1185 { &vnop_pagein_desc
, (VOPFUNC
)cd9660_pagein
}, /* Pagein */
1186 { &vnop_pageout_desc
, (VOPFUNC
)cd9660_pageout
}, /* Pageout */
1187 { &vnop_blktooff_desc
, (VOPFUNC
)cd9660_blktooff
}, /* blktooff */
1188 { &vnop_offtoblk_desc
, (VOPFUNC
)cd9660_offtoblk
}, /* offtoblk */
1189 { &vnop_blockmap_desc
, (VOPFUNC
)cd9660_blockmap
}, /* blockmap */
1190 { (struct vnodeop_desc
*)NULL
, (VOPFUNC
)NULL
}
1192 struct vnodeopv_desc cd9660_vnodeop_opv_desc
=
1193 { &cd9660_vnodeop_p
, cd9660_vnodeop_entries
};
1196 * The VOP table for CD-ROM XA (media) files is almost the same
1197 * as for ordinary files, except for read, and pagein.
1198 * Note that cd9660_xa_read doesn't use cluster I/O, so blockmap
1199 * isn't needed, and isn't implemented. Similarly, it doesn't
1200 * do buf_bread() on CD XA vnodes, so bmap, blktooff, offtoblk
1203 int (**cd9660_cdxaop_p
)(void *);
1204 struct vnodeopv_entry_desc cd9660_cdxaop_entries
[] = {
1205 { &vnop_default_desc
, (VOPFUNC
)vn_default_error
},
1206 { &vnop_lookup_desc
, (VOPFUNC
)cd9660_lookup
}, /* lookup */
1207 { &vnop_create_desc
, (VOPFUNC
)cd9660_create
}, /* create */
1208 { &vnop_mknod_desc
, (VOPFUNC
)cd9660_mknod
}, /* mknod */
1209 { &vnop_open_desc
, (VOPFUNC
)cd9660_open
}, /* open */
1210 { &vnop_close_desc
, (VOPFUNC
)cd9660_close
}, /* close */
1211 { &vnop_getattr_desc
, (VOPFUNC
)cd9660_getattr
}, /* getattr */
1212 { &vnop_read_desc
, (VOPFUNC
)cd9660_xa_read
}, /* read */
1213 { &vnop_write_desc
, (VOPFUNC
)cd9660_write
}, /* write */
1214 { &vnop_ioctl_desc
, (VOPFUNC
)cd9660_ioctl
}, /* ioctl */
1215 { &vnop_select_desc
, (VOPFUNC
)cd9660_select
}, /* select */
1216 { &vnop_mmap_desc
, (VOPFUNC
)cd9660_mmap
}, /* mmap */
1217 { &vnop_fsync_desc
, (VOPFUNC
)cd9660_fsync
}, /* fsync */
1218 { &vnop_remove_desc
, (VOPFUNC
)cd9660_remove
}, /* remove */
1219 { &vnop_link_desc
, (VOPFUNC
)cd9660_link
}, /* link */
1220 { &vnop_rename_desc
, (VOPFUNC
)cd9660_rename
}, /* rename */
1221 { &vnop_copyfile_desc
, (VOPFUNC
)cd9660_copyfile
},/* copyfile */
1222 { &vnop_mkdir_desc
, (VOPFUNC
)cd9660_mkdir
}, /* mkdir */
1223 { &vnop_rmdir_desc
, (VOPFUNC
)cd9660_rmdir
}, /* rmdir */
1224 { &vnop_symlink_desc
, (VOPFUNC
)cd9660_symlink
}, /* symlink */
1225 { &vnop_readdir_desc
, (VOPFUNC
)cd9660_readdir
}, /* readdir */
1226 { &vnop_readlink_desc
, (VOPFUNC
)cd9660_readlink
},/* readlink */
1227 { &vnop_inactive_desc
, (VOPFUNC
)cd9660_inactive
},/* inactive */
1228 { &vnop_reclaim_desc
, (VOPFUNC
)cd9660_reclaim
}, /* reclaim */
1229 { &vnop_strategy_desc
, (VOPFUNC
)cd9660_strategy
},/* strategy */
1230 { &vnop_pathconf_desc
, (VOPFUNC
)cd9660_pathconf
},/* pathconf */
1231 { &vnop_advlock_desc
, (VOPFUNC
)cd9660_advlock
}, /* advlock */
1232 { &vnop_bwrite_desc
, (VOPFUNC
)vn_bwrite
},
1233 { &vnop_pagein_desc
, (VOPFUNC
)cd9660_xa_pagein
}, /* Pagein */
1234 { &vnop_pageout_desc
, (VOPFUNC
)cd9660_pageout
}, /* Pageout */
1235 { (struct vnodeop_desc
*)NULL
, (VOPFUNC
)NULL
}
1237 struct vnodeopv_desc cd9660_cdxaop_opv_desc
=
1238 { &cd9660_cdxaop_p
, cd9660_cdxaop_entries
};
1241 * Special device vnode ops
1243 int (**cd9660_specop_p
)(void *);
1244 struct vnodeopv_entry_desc cd9660_specop_entries
[] = {
1245 { &vnop_default_desc
, (VOPFUNC
)vn_default_error
},
1246 { &vnop_lookup_desc
, (VOPFUNC
)spec_lookup
}, /* lookup */
1247 { &vnop_create_desc
, (VOPFUNC
)spec_create
}, /* create */
1248 { &vnop_mknod_desc
, (VOPFUNC
)spec_mknod
}, /* mknod */
1249 { &vnop_open_desc
, (VOPFUNC
)spec_open
}, /* open */
1250 { &vnop_close_desc
, (VOPFUNC
)spec_close
}, /* close */
1251 { &vnop_getattr_desc
, (VOPFUNC
)cd9660_getattr
}, /* getattr */
1252 { &vnop_read_desc
, (VOPFUNC
)spec_read
}, /* read */
1253 { &vnop_write_desc
, (VOPFUNC
)spec_write
}, /* write */
1254 { &vnop_ioctl_desc
, (VOPFUNC
)spec_ioctl
}, /* ioctl */
1255 { &vnop_select_desc
, (VOPFUNC
)spec_select
}, /* select */
1256 { &vnop_mmap_desc
, (VOPFUNC
)spec_mmap
}, /* mmap */
1257 { &vnop_fsync_desc
, (VOPFUNC
)spec_fsync
}, /* fsync */
1258 { &vnop_remove_desc
, (VOPFUNC
)spec_remove
}, /* remove */
1259 { &vnop_link_desc
, (VOPFUNC
)spec_link
}, /* link */
1260 { &vnop_rename_desc
, (VOPFUNC
)spec_rename
}, /* rename */
1261 { &vnop_mkdir_desc
, (VOPFUNC
)spec_mkdir
}, /* mkdir */
1262 { &vnop_rmdir_desc
, (VOPFUNC
)spec_rmdir
}, /* rmdir */
1263 { &vnop_symlink_desc
, (VOPFUNC
)spec_symlink
}, /* symlink */
1264 { &vnop_readdir_desc
, (VOPFUNC
)spec_readdir
}, /* readdir */
1265 { &vnop_readlink_desc
, (VOPFUNC
)spec_readlink
}, /* readlink */
1266 { &vnop_inactive_desc
, (VOPFUNC
)cd9660_inactive
},/* inactive */
1267 { &vnop_reclaim_desc
, (VOPFUNC
)cd9660_reclaim
}, /* reclaim */
1268 { &vnop_strategy_desc
, (VOPFUNC
)spec_strategy
}, /* strategy */
1269 { &vnop_pathconf_desc
, (VOPFUNC
)spec_pathconf
}, /* pathconf */
1270 { &vnop_advlock_desc
, (VOPFUNC
)spec_advlock
}, /* advlock */
1271 { &vnop_bwrite_desc
, (VOPFUNC
)vn_bwrite
},
1272 { &vnop_pagein_desc
, (VOPFUNC
)cd9660_pagein
}, /* Pagein */
1273 { &vnop_pageout_desc
, (VOPFUNC
)cd9660_pageout
}, /* Pageout */
1274 { &vnop_blktooff_desc
, (VOPFUNC
)cd9660_blktooff
}, /* blktooff */
1275 { &vnop_offtoblk_desc
, (VOPFUNC
)cd9660_offtoblk
}, /* offtoblk */
1276 { &vnop_blockmap_desc
, (VOPFUNC
)cd9660_blockmap
}, /* blockmap */
1277 { (struct vnodeop_desc
*)NULL
, (VOPFUNC
)NULL
}
1279 struct vnodeopv_desc cd9660_specop_opv_desc
=
1280 { &cd9660_specop_p
, cd9660_specop_entries
};
1283 int (**cd9660_fifoop_p
)(void *);
1284 struct vnodeopv_entry_desc cd9660_fifoop_entries
[] = {
1285 { &vnop_default_desc
, (VOPFUNC
)vn_default_error
},
1286 { &vnop_lookup_desc
, (VOPFUNC
)fifo_lookup
}, /* lookup */
1287 { &vnop_create_desc
, (VOPFUNC
)fifo_create
}, /* create */
1288 { &vnop_mknod_desc
, (VOPFUNC
)fifo_mknod
}, /* mknod */
1289 { &vnop_open_desc
, (VOPFUNC
)fifo_open
}, /* open */
1290 { &vnop_close_desc
, (VOPFUNC
)fifo_close
}, /* close */
1291 { &vnop_getattr_desc
, (VOPFUNC
)cd9660_getattr
}, /* getattr */
1292 { &vnop_read_desc
, (VOPFUNC
)fifo_read
}, /* read */
1293 { &vnop_write_desc
, (VOPFUNC
)fifo_write
}, /* write */
1294 { &vnop_ioctl_desc
, (VOPFUNC
)fifo_ioctl
}, /* ioctl */
1295 { &vnop_select_desc
, (VOPFUNC
)fifo_select
}, /* select */
1296 { &vnop_mmap_desc
, (VOPFUNC
)fifo_mmap
}, /* mmap */
1297 { &vnop_fsync_desc
, (VOPFUNC
)fifo_fsync
}, /* fsync */
1298 { &vnop_remove_desc
, (VOPFUNC
)fifo_remove
}, /* remove */
1299 { &vnop_link_desc
, (VOPFUNC
)fifo_link
} , /* link */
1300 { &vnop_rename_desc
, (VOPFUNC
)fifo_rename
}, /* rename */
1301 { &vnop_mkdir_desc
, (VOPFUNC
)fifo_mkdir
}, /* mkdir */
1302 { &vnop_rmdir_desc
, (VOPFUNC
)fifo_rmdir
}, /* rmdir */
1303 { &vnop_symlink_desc
, (VOPFUNC
)fifo_symlink
}, /* symlink */
1304 { &vnop_readdir_desc
, (VOPFUNC
)fifo_readdir
}, /* readdir */
1305 { &vnop_readlink_desc
, (VOPFUNC
)fifo_readlink
}, /* readlink */
1306 { &vnop_inactive_desc
, (VOPFUNC
)cd9660_inactive
},/* inactive */
1307 { &vnop_reclaim_desc
, (VOPFUNC
)cd9660_reclaim
}, /* reclaim */
1308 { &vnop_strategy_desc
, (VOPFUNC
)fifo_strategy
}, /* strategy */
1309 { &vnop_pathconf_desc
, (VOPFUNC
)fifo_pathconf
}, /* pathconf */
1310 { &vnop_advlock_desc
, (VOPFUNC
)fifo_advlock
}, /* advlock */
1311 { &vnop_bwrite_desc
, (VOPFUNC
)vn_bwrite
},
1312 { &vnop_pagein_desc
, (VOPFUNC
)cd9660_pagein
}, /* Pagein */
1313 { &vnop_pageout_desc
, (VOPFUNC
)cd9660_pageout
}, /* Pageout */
1314 { &vnop_blktooff_desc
, (VOPFUNC
)cd9660_blktooff
}, /* blktooff */
1315 { &vnop_offtoblk_desc
, (VOPFUNC
)cd9660_offtoblk
}, /* offtoblk */
1316 { (struct vnodeop_desc
*)NULL
, (VOPFUNC
)NULL
}
1318 struct vnodeopv_desc cd9660_fifoop_opv_desc
=
1319 { &cd9660_fifoop_p
, cd9660_fifoop_entries
};