NetBSD/sys/fs/cd9660/cd9660_vnops.c

1069 lines
28 KiB
C
Raw Normal View History

/* $NetBSD: cd9660_vnops.c,v 1.6 2003/08/07 16:31:36 agc Exp $ */
1994-06-08 15:22:45 +04:00
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley
* by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
* Support code is derived from software contributed to Berkeley
* by Atsushi Murai (amurai@spec.co.jp).
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
1994-06-08 15:22:45 +04:00
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
1998-03-01 05:20:01 +03:00
* @(#)cd9660_vnops.c 8.15 (Berkeley) 5/27/95
1994-06-08 15:22:45 +04:00
*/
2001-11-12 18:25:01 +03:00
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.6 2003/08/07 16:31:36 agc Exp $");
2001-11-12 18:25:01 +03:00
1994-06-08 15:22:45 +04:00
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/resourcevar.h>
#include <sys/kernel.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/mount.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
#include <sys/dirent.h>
1994-06-08 15:22:45 +04:00
#include <miscfs/fifofs/fifo.h>
#include <miscfs/genfs/genfs.h>
#include <miscfs/specfs/specdev.h>
#include <fs/cd9660/iso.h>
#include <fs/cd9660/cd9660_extern.h>
#include <fs/cd9660/cd9660_node.h>
#include <fs/cd9660/iso_rrip.h>
#include <fs/cd9660/cd9660_mount.h>
1994-06-08 15:22:45 +04:00
1996-02-10 00:31:50 +03:00
/*
* Structure for reading directories
*/
struct isoreaddir {
struct dirent saveent;
struct dirent assocent;
struct dirent current;
off_t saveoff;
off_t assocoff;
off_t curroff;
struct uio *uio;
off_t uio_off;
int eofflag;
off_t *cookies;
1996-02-10 00:31:50 +03:00
int ncookies;
};
int iso_uiodir __P((struct isoreaddir *, struct dirent *, off_t));
int iso_shipdir __P((struct isoreaddir *));
1994-06-08 15:22:45 +04:00
#if 0
/*
* Mknod vnode call
* Actually remap the device number
*/
1996-02-10 00:31:50 +03:00
int
1994-06-08 15:22:45 +04:00
cd9660_mknod(ndp, vap, cred, p)
struct nameidata *ndp;
struct ucred *cred;
struct vattr *vap;
struct proc *p;
{
#ifndef ISODEVMAP
free(ndp->ni_pnbuf, M_NAMEI);
vput(ndp->ni_dvp);
vput(ndp->ni_vp);
return (EINVAL);
#else
2000-03-30 16:13:30 +04:00
struct vnode *vp;
1994-06-08 15:22:45 +04:00
struct iso_node *ip;
struct iso_dnode *dp;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
vp = ndp->ni_vp;
ip = VTOI(vp);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (ip->i_mnt->iso_ftype != ISO_FTYPE_RRIP
|| vap->va_type != vp->v_type
|| (vap->va_type != VCHR && vap->va_type != VBLK)) {
free(ndp->ni_pnbuf, M_NAMEI);
vput(ndp->ni_dvp);
vput(ndp->ni_vp);
return (EINVAL);
}
1994-06-15 03:54:44 +04:00
dp = iso_dmap(ip->i_dev, ip->i_number, 1);
1997-10-17 03:56:57 +04:00
if (ip->inode.iso_rdev == vap->va_rdev ||
vap->va_rdev == (dev_t)VNOVAL) {
1994-06-08 15:22:45 +04:00
/* same as the unmapped one, delete the mapping */
LIST_REMOVE(dp, d_hash);
1995-06-28 09:10:45 +04:00
FREE(dp, M_CACHE);
1994-06-08 15:22:45 +04:00
} else
/* enter new mapping */
dp->d_dev = vap->va_rdev;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
/*
* Remove inode so that it will be reloaded by iget and
* checked to see if it is an alias of an existing entry
* in the inode cache.
*/
vput(vp);
vp->v_type = VNON;
vgone(vp);
return (0);
#endif
}
#endif
/*
* Check mode permission on inode pointer. Mode is READ, WRITE or EXEC.
* The mode is shifted to select the owner/group/other fields. The
* super user is granted all permissions.
*/
int
1996-02-10 00:31:50 +03:00
cd9660_access(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_access_args /* {
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
struct proc *a_p;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
1997-05-08 20:43:16 +04:00
struct vnode *vp = ap->a_vp;
struct iso_node *ip = VTOI(vp);
1994-06-15 03:54:44 +04:00
1998-03-01 05:20:01 +03:00
/*
* Disallow write attempts unless the file is a socket,
* fifo, or a block or character device resident on the
* file system.
*/
if (ap->a_mode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
case VREG:
return (EROFS);
default:
break;
}
}
return (vaccess(vp->v_type, ip->inode.iso_mode & ALLPERMS,
ip->inode.iso_uid, ip->inode.iso_gid, ap->a_mode, ap->a_cred));
1994-06-08 15:22:45 +04:00
}
int
1996-02-10 00:31:50 +03:00
cd9660_getattr(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_getattr_args /* {
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
struct proc *a_p;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
1994-06-08 15:22:45 +04:00
struct vnode *vp = ap->a_vp;
1997-05-08 20:43:16 +04:00
struct iso_node *ip = VTOI(vp);
2000-03-30 16:13:30 +04:00
struct vattr *vap = ap->a_vap;
1994-06-08 15:22:45 +04:00
vap->va_fsid = ip->i_dev;
vap->va_fileid = ip->i_number;
vap->va_mode = ip->inode.iso_mode & ALLPERMS;
1994-06-08 15:22:45 +04:00
vap->va_nlink = ip->inode.iso_links;
vap->va_uid = ip->inode.iso_uid;
vap->va_gid = ip->inode.iso_gid;
vap->va_atime = ip->inode.iso_atime;
vap->va_mtime = ip->inode.iso_mtime;
vap->va_ctime = ip->inode.iso_ctime;
vap->va_rdev = ip->inode.iso_rdev;
vap->va_size = (u_quad_t) ip->i_size;
if (ip->i_size == 0 && vp->v_type == VLNK) {
struct vop_readlink_args rdlnk;
struct iovec aiov;
struct uio auio;
char *cp;
MALLOC(cp, char *, MAXPATHLEN, M_TEMP, M_WAITOK);
aiov.iov_base = cp;
aiov.iov_len = MAXPATHLEN;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
auio.uio_offset = 0;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_procp = ap->a_p;
auio.uio_resid = MAXPATHLEN;
rdlnk.a_uio = &auio;
rdlnk.a_vp = ap->a_vp;
rdlnk.a_cred = ap->a_cred;
if (cd9660_readlink(&rdlnk) == 0)
vap->va_size = MAXPATHLEN - auio.uio_resid;
FREE(cp, M_TEMP);
}
1994-06-08 15:22:45 +04:00
vap->va_flags = 0;
vap->va_gen = 1;
vap->va_blocksize = ip->i_mnt->logical_block_size;
vap->va_bytes = (u_quad_t) ip->i_size;
vap->va_type = vp->v_type;
return (0);
}
/*
* Vnode op for reading.
*/
int
1996-02-10 00:31:50 +03:00
cd9660_read(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_read_args /* {
struct vnode *a_vp;
struct uio *a_uio;
int a_ioflag;
struct ucred *a_cred;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
1994-06-08 15:22:45 +04:00
struct vnode *vp = ap->a_vp;
2000-03-30 16:13:30 +04:00
struct uio *uio = ap->a_uio;
struct iso_node *ip = VTOI(vp);
struct iso_mnt *imp;
1994-06-08 15:22:45 +04:00
struct buf *bp;
daddr_t lbn, rablock;
1994-06-08 15:22:45 +04:00
off_t diff;
int rasize, error = 0;
long size, n, on;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (uio->uio_resid == 0)
return (0);
if (uio->uio_offset < 0)
return (EINVAL);
2001-09-23 02:44:08 +04:00
if (uio->uio_offset >= ip->i_size)
return 0;
ip->i_flag |= IN_ACCESS;
1994-06-08 15:22:45 +04:00
imp = ip->i_mnt;
if (vp->v_type == VREG) {
error = 0;
while (uio->uio_resid > 0) {
void *win;
vsize_t bytelen = MIN(ip->i_size - uio->uio_offset,
uio->uio_resid);
if (bytelen == 0)
break;
a whole bunch of changes to improve performance and robustness under load: - remove special treatment of pager_map mappings in pmaps. this is required now, since I've removed the globals that expose the address range. pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's no longer any need to special-case it. - eliminate struct uvm_vnode by moving its fields into struct vnode. - rewrite the pageout path. the pager is now responsible for handling the high-level requests instead of only getting control after a bunch of work has already been done on its behalf. this will allow us to UBCify LFS, which needs tighter control over its pages than other filesystems do. writing a page to disk no longer requires making it read-only, which allows us to write wired pages without causing all kinds of havoc. - use a new PG_PAGEOUT flag to indicate that a page should be freed on behalf of the pagedaemon when it's unlocked. this flag is very similar to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the pageout fails due to eg. an indirect-block buffer being locked. this allows us to remove the "version" field from struct vm_page, and together with shrinking "loan_count" from 32 bits to 16, struct vm_page is now 4 bytes smaller. - no longer use PG_RELEASED for swap-backed pages. if the page is busy because it's being paged out, we can't release the swap slot to be reallocated until that write is complete, but unlike with vnodes we don't keep a count of in-progress writes so there's no good way to know when the write is done. instead, when we need to free a busy swap-backed page, just sleep until we can get it busy ourselves. - implement a fast-path for extending writes which allows us to avoid zeroing new pages. this substantially reduces cpu usage. - encapsulate the data used by the genfs code in a struct genfs_node, which must be the first element of the filesystem-specific vnode data for filesystems which use genfs_{get,put}pages(). - eliminate many of the UVM pagerops, since they aren't needed anymore now that the pager "put" operation is a higher-level operation. - enhance the genfs code to allow NFS to use the genfs_{get,put}pages instead of a modified copy. - clean up struct vnode by removing all the fields that used to be used by the vfs_cluster.c code (which we don't use anymore with UBC). - remove kmem_object and mb_object since they were useless. instead of allocating pages to these objects, we now just allocate pages with no object. such pages are mapped in the kernel until they are freed, so we can use the mapping to find the page to free it. this allows us to remove splvm() protection in several places. The sum of all these changes improves write throughput on my decstation 5000/200 to within 1% of the rate of NetBSD 1.5 and reduces the elapsed time for "make release" of a NetBSD 1.5 source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
win = ubc_alloc(&vp->v_uobj, uio->uio_offset,
&bytelen, UBC_READ);
error = uiomove(win, bytelen, uio);
ubc_release(win, 0);
if (error)
break;
}
goto out;
}
1994-06-08 15:22:45 +04:00
do {
lbn = lblkno(imp, uio->uio_offset);
on = blkoff(imp, uio->uio_offset);
n = MIN(imp->logical_block_size - on, uio->uio_resid);
1994-06-08 15:22:45 +04:00
diff = (off_t)ip->i_size - uio->uio_offset;
if (diff <= 0)
return (0);
if (diff < n)
n = diff;
size = blksize(imp, ip, lbn);
1994-06-08 15:22:45 +04:00
rablock = lbn + 1;
a whole bunch of changes to improve performance and robustness under load: - remove special treatment of pager_map mappings in pmaps. this is required now, since I've removed the globals that expose the address range. pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's no longer any need to special-case it. - eliminate struct uvm_vnode by moving its fields into struct vnode. - rewrite the pageout path. the pager is now responsible for handling the high-level requests instead of only getting control after a bunch of work has already been done on its behalf. this will allow us to UBCify LFS, which needs tighter control over its pages than other filesystems do. writing a page to disk no longer requires making it read-only, which allows us to write wired pages without causing all kinds of havoc. - use a new PG_PAGEOUT flag to indicate that a page should be freed on behalf of the pagedaemon when it's unlocked. this flag is very similar to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the pageout fails due to eg. an indirect-block buffer being locked. this allows us to remove the "version" field from struct vm_page, and together with shrinking "loan_count" from 32 bits to 16, struct vm_page is now 4 bytes smaller. - no longer use PG_RELEASED for swap-backed pages. if the page is busy because it's being paged out, we can't release the swap slot to be reallocated until that write is complete, but unlike with vnodes we don't keep a count of in-progress writes so there's no good way to know when the write is done. instead, when we need to free a busy swap-backed page, just sleep until we can get it busy ourselves. - implement a fast-path for extending writes which allows us to avoid zeroing new pages. this substantially reduces cpu usage. - encapsulate the data used by the genfs code in a struct genfs_node, which must be the first element of the filesystem-specific vnode data for filesystems which use genfs_{get,put}pages(). - eliminate many of the UVM pagerops, since they aren't needed anymore now that the pager "put" operation is a higher-level operation. - enhance the genfs code to allow NFS to use the genfs_{get,put}pages instead of a modified copy. - clean up struct vnode by removing all the fields that used to be used by the vfs_cluster.c code (which we don't use anymore with UBC). - remove kmem_object and mb_object since they were useless. instead of allocating pages to these objects, we now just allocate pages with no object. such pages are mapped in the kernel until they are freed, so we can use the mapping to find the page to free it. this allows us to remove splvm() protection in several places. The sum of all these changes improves write throughput on my decstation 5000/200 to within 1% of the rate of NetBSD 1.5 and reduces the elapsed time for "make release" of a NetBSD 1.5 source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
if (lblktosize(imp, rablock) < ip->i_size) {
rasize = blksize(imp, ip, rablock);
error = breadn(vp, lbn, size, &rablock,
&rasize, 1, NOCRED, &bp);
1994-06-08 15:22:45 +04:00
} else {
a whole bunch of changes to improve performance and robustness under load: - remove special treatment of pager_map mappings in pmaps. this is required now, since I've removed the globals that expose the address range. pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's no longer any need to special-case it. - eliminate struct uvm_vnode by moving its fields into struct vnode. - rewrite the pageout path. the pager is now responsible for handling the high-level requests instead of only getting control after a bunch of work has already been done on its behalf. this will allow us to UBCify LFS, which needs tighter control over its pages than other filesystems do. writing a page to disk no longer requires making it read-only, which allows us to write wired pages without causing all kinds of havoc. - use a new PG_PAGEOUT flag to indicate that a page should be freed on behalf of the pagedaemon when it's unlocked. this flag is very similar to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the pageout fails due to eg. an indirect-block buffer being locked. this allows us to remove the "version" field from struct vm_page, and together with shrinking "loan_count" from 32 bits to 16, struct vm_page is now 4 bytes smaller. - no longer use PG_RELEASED for swap-backed pages. if the page is busy because it's being paged out, we can't release the swap slot to be reallocated until that write is complete, but unlike with vnodes we don't keep a count of in-progress writes so there's no good way to know when the write is done. instead, when we need to free a busy swap-backed page, just sleep until we can get it busy ourselves. - implement a fast-path for extending writes which allows us to avoid zeroing new pages. this substantially reduces cpu usage. - encapsulate the data used by the genfs code in a struct genfs_node, which must be the first element of the filesystem-specific vnode data for filesystems which use genfs_{get,put}pages(). - eliminate many of the UVM pagerops, since they aren't needed anymore now that the pager "put" operation is a higher-level operation. - enhance the genfs code to allow NFS to use the genfs_{get,put}pages instead of a modified copy. - clean up struct vnode by removing all the fields that used to be used by the vfs_cluster.c code (which we don't use anymore with UBC). - remove kmem_object and mb_object since they were useless. instead of allocating pages to these objects, we now just allocate pages with no object. such pages are mapped in the kernel until they are freed, so we can use the mapping to find the page to free it. this allows us to remove splvm() protection in several places. The sum of all these changes improves write throughput on my decstation 5000/200 to within 1% of the rate of NetBSD 1.5 and reduces the elapsed time for "make release" of a NetBSD 1.5 source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
error = bread(vp, lbn, size, NOCRED, &bp);
1994-06-08 15:22:45 +04:00
}
n = MIN(n, size - bp->b_resid);
1994-06-08 15:22:45 +04:00
if (error) {
brelse(bp);
return (error);
}
1994-06-15 03:54:44 +04:00
error = uiomove(bp->b_data + on, (int)n, uio);
1994-06-08 15:22:45 +04:00
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
out:
1994-06-08 15:22:45 +04:00
return (error);
}
1994-07-14 05:43:42 +04:00
int
iso_uiodir(idp, dp, off)
1994-06-08 15:22:45 +04:00
struct isoreaddir *idp;
struct dirent *dp;
off_t off;
{
int error;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
dp->d_name[dp->d_namlen] = 0;
dp->d_reclen = DIRENT_SIZE(dp);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (idp->uio->uio_resid < dp->d_reclen) {
idp->eofflag = 0;
return (-1);
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (idp->cookies) {
if (idp->ncookies <= 0) {
idp->eofflag = 0;
return (-1);
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
*idp->cookies++ = off;
--idp->ncookies;
}
1994-06-15 03:54:44 +04:00
if ((error = uiomove((caddr_t)dp, dp->d_reclen, idp->uio)) != 0)
1994-06-08 15:22:45 +04:00
return (error);
idp->uio_off = off;
return (0);
}
1994-07-14 05:43:42 +04:00
int
1994-06-08 15:22:45 +04:00
iso_shipdir(idp)
struct isoreaddir *idp;
{
struct dirent *dp;
int cl, sl, assoc;
int error;
char *cname, *sname;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
cl = idp->current.d_namlen;
cname = idp->current.d_name;
1996-02-10 00:31:50 +03:00
if ((assoc = cl > 1 && *cname == ASSOCCHAR)) {
1994-06-08 15:22:45 +04:00
cl--;
cname++;
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
dp = &idp->saveent;
sname = dp->d_name;
if (!(sl = dp->d_namlen)) {
dp = &idp->assocent;
sname = dp->d_name + 1;
sl = dp->d_namlen - 1;
}
if (sl > 0) {
if (sl != cl
|| memcmp(sname, cname, sl)) {
1994-06-08 15:22:45 +04:00
if (idp->assocent.d_namlen) {
1996-02-10 00:31:50 +03:00
error = iso_uiodir(idp, &idp->assocent,
idp->assocoff);
if (error)
1994-06-08 15:22:45 +04:00
return (error);
idp->assocent.d_namlen = 0;
}
if (idp->saveent.d_namlen) {
1996-02-10 00:31:50 +03:00
error = iso_uiodir(idp, &idp->saveent,
idp->saveoff);
if (error)
1994-06-08 15:22:45 +04:00
return (error);
idp->saveent.d_namlen = 0;
}
}
}
idp->current.d_reclen = DIRENT_SIZE(&idp->current);
1994-06-08 15:22:45 +04:00
if (assoc) {
idp->assocoff = idp->curroff;
memcpy(&idp->assocent, &idp->current, idp->current.d_reclen);
1994-06-08 15:22:45 +04:00
} else {
idp->saveoff = idp->curroff;
memcpy(&idp->saveent, &idp->current, idp->current.d_reclen);
1994-06-08 15:22:45 +04:00
}
return (0);
}
/*
* Vnode op for readdir
*/
int
1996-02-10 00:31:50 +03:00
cd9660_readdir(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_readdir_args /* {
struct vnode *a_vp;
struct uio *a_uio;
struct ucred *a_cred;
int *a_eofflag;
1998-03-01 05:20:01 +03:00
off_t **a_cookies;
int *a_ncookies;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
2000-03-30 16:13:30 +04:00
struct uio *uio = ap->a_uio;
1994-06-08 15:22:45 +04:00
struct isoreaddir *idp;
1994-07-19 19:07:36 +04:00
struct vnode *vdp = ap->a_vp;
struct iso_node *dp;
struct iso_mnt *imp;
struct buf *bp = NULL;
struct iso_directory_record *ep;
1994-06-08 15:22:45 +04:00
int entryoffsetinblock;
1994-07-19 19:07:36 +04:00
doff_t endsearch;
u_long bmask;
1994-06-08 15:22:45 +04:00
int error = 0;
int reclen;
1994-07-19 19:07:36 +04:00
u_short namelen;
1998-03-01 05:20:01 +03:00
off_t *cookies = NULL;
int ncookies = 0;
if (vdp->v_type != VDIR)
return (ENOTDIR);
1994-06-15 03:54:44 +04:00
1994-07-19 19:07:36 +04:00
dp = VTOI(vdp);
imp = dp->i_mnt;
bmask = imp->im_bmask;
1994-06-15 03:54:44 +04:00
1994-07-14 05:43:42 +04:00
MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK);
idp->saveent.d_namlen = idp->assocent.d_namlen = 0;
/*
* XXX
* Is it worth trying to figure out the type?
*/
idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type =
DT_UNKNOWN;
1994-06-08 15:22:45 +04:00
idp->uio = uio;
1998-03-01 05:20:01 +03:00
if (ap->a_ncookies == NULL)
idp->cookies = NULL;
else {
ncookies = uio->uio_resid / 16;
cookies = malloc(ncookies * sizeof(off_t), M_TEMP, M_WAITOK);
1998-03-01 05:20:01 +03:00
idp->cookies = cookies;
idp->ncookies = ncookies;
}
1994-06-08 15:22:45 +04:00
idp->eofflag = 1;
idp->curroff = uio->uio_offset;
1994-06-15 03:54:44 +04:00
1994-07-19 19:07:36 +04:00
if ((entryoffsetinblock = idp->curroff & bmask) &&
(error = VOP_BLKATOFF(vdp, (off_t)idp->curroff, NULL, &bp))) {
FREE(idp, M_TEMP);
return (error);
1994-06-08 15:22:45 +04:00
}
1994-07-19 19:07:36 +04:00
endsearch = dp->i_size;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
while (idp->curroff < endsearch) {
/*
* If offset is on a block boundary,
* read the next directory block.
* Release previous if it exists.
*/
1994-07-19 19:14:07 +04:00
if ((idp->curroff & bmask) == 0) {
1994-06-08 15:22:45 +04:00
if (bp != NULL)
brelse(bp);
1996-02-10 00:31:50 +03:00
error = VOP_BLKATOFF(vdp, (off_t)idp->curroff,
NULL, &bp);
if (error)
1994-06-08 15:22:45 +04:00
break;
entryoffsetinblock = 0;
}
/*
* Get pointer to next entry.
*/
ep = (struct iso_directory_record *)
1994-07-19 19:07:36 +04:00
((char *)bp->b_data + entryoffsetinblock);
1994-06-15 03:54:44 +04:00
1994-07-19 19:07:36 +04:00
reclen = isonum_711(ep->length);
1994-06-08 15:22:45 +04:00
if (reclen == 0) {
/* skip to next block, if any */
idp->curroff =
(idp->curroff & ~bmask) + imp->logical_block_size;
1994-06-08 15:22:45 +04:00
continue;
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (reclen < ISO_DIRECTORY_RECORD_SIZE) {
error = EINVAL;
/* illegal entry, stop */
break;
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (entryoffsetinblock + reclen > imp->logical_block_size) {
error = EINVAL;
/* illegal directory, so stop looking */
break;
}
1994-06-15 03:54:44 +04:00
idp->current.d_namlen = isonum_711(ep->name_len);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) {
error = EINVAL;
/* illegal entry, stop */
break;
}
1994-06-15 03:54:44 +04:00
if (isonum_711(ep->flags)&2)
idp->current.d_fileno = isodirino(ep, imp);
else
idp->current.d_fileno = dbtob(bp->b_blkno) +
entryoffsetinblock;
1994-06-08 15:22:45 +04:00
idp->curroff += reclen;
1994-06-08 15:22:45 +04:00
switch (imp->iso_ftype) {
case ISO_FTYPE_RRIP:
cd9660_rrip_getname(ep, idp->current.d_name, &namelen,
&idp->current.d_fileno, imp);
1994-07-19 19:07:36 +04:00
idp->current.d_namlen = (u_char)namelen;
1994-06-08 15:22:45 +04:00
if (idp->current.d_namlen)
error = iso_uiodir(idp, &idp->current,
idp->curroff);
1994-06-08 15:22:45 +04:00
break;
default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 */
isofntrans(ep->name, idp->current.d_namlen,
idp->current.d_name, &namelen,
imp->iso_ftype == ISO_FTYPE_9660,
(imp->im_flags & ISOFSMNT_NOCASETRANS) == 0,
isonum_711(ep->flags)&4,
imp->im_joliet_level);
switch (idp->current.d_name[0]) {
1994-06-08 15:22:45 +04:00
case 0:
idp->current.d_name[0] = '.';
1994-06-08 15:22:45 +04:00
idp->current.d_namlen = 1;
error = iso_uiodir(idp, &idp->current,
idp->curroff);
1994-06-08 15:22:45 +04:00
break;
case 1:
strlcpy(idp->current.d_name, "..",
sizeof(idp->current.d_name));
1994-06-08 15:22:45 +04:00
idp->current.d_namlen = 2;
error = iso_uiodir(idp, &idp->current,
idp->curroff);
1994-06-08 15:22:45 +04:00
break;
default:
1994-07-19 19:07:36 +04:00
idp->current.d_namlen = (u_char)namelen;
1994-06-08 15:22:45 +04:00
if (imp->iso_ftype == ISO_FTYPE_DEFAULT)
error = iso_shipdir(idp);
else
error = iso_uiodir(idp, &idp->current,
idp->curroff);
1994-06-08 15:22:45 +04:00
break;
}
}
if (error)
break;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
entryoffsetinblock += reclen;
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (!error && imp->iso_ftype == ISO_FTYPE_DEFAULT) {
idp->current.d_namlen = 0;
error = iso_shipdir(idp);
}
if (error < 0)
error = 0;
1994-06-15 03:54:44 +04:00
1998-03-01 05:20:01 +03:00
if (ap->a_ncookies != NULL) {
if (error)
free(cookies, M_TEMP);
1998-03-01 05:20:01 +03:00
else {
/*
* Work out the number of cookies actually used.
*/
*ap->a_ncookies = ncookies - idp->ncookies;
*ap->a_cookies = cookies;
}
}
1994-06-08 15:22:45 +04:00
if (bp)
brelse (bp);
uio->uio_offset = idp->uio_off;
*ap->a_eofflag = idp->eofflag;
1994-06-15 03:54:44 +04:00
1994-07-19 19:07:36 +04:00
FREE(idp, M_TEMP);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
return (error);
}
/*
* Return target name of a symbolic link
* Shouldn't we get the parent vnode and read the data from there?
* This could eventually result in deadlocks in cd9660_lookup.
* But otherwise the block read here is in the block buffer two times.
*/
typedef struct iso_directory_record ISODIR;
typedef struct iso_node ISONODE;
typedef struct iso_mnt ISOMNT;
int
1996-02-10 00:31:50 +03:00
cd9660_readlink(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_readlink_args /* {
struct vnode *a_vp;
struct uio *a_uio;
struct ucred *a_cred;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
1994-06-08 15:22:45 +04:00
ISONODE *ip;
1994-06-15 03:54:44 +04:00
ISODIR *dirp;
1994-06-08 15:22:45 +04:00
ISOMNT *imp;
struct buf *bp;
struct uio *uio;
1994-06-08 15:22:45 +04:00
u_short symlen;
int error;
char *symname;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
ip = VTOI(ap->a_vp);
imp = ip->i_mnt;
uio = ap->a_uio;
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
if (imp->iso_ftype != ISO_FTYPE_RRIP)
return (EINVAL);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
/*
* Get parents directory record block that this inode included.
*/
error = bread(imp->im_devvp,
(ip->i_number >> imp->im_bshift) <<
(imp->im_bshift - DEV_BSHIFT),
imp->logical_block_size, NOCRED, &bp);
1994-06-08 15:22:45 +04:00
if (error) {
brelse(bp);
return (EINVAL);
}
/*
* Setup the directory pointer for this inode
*/
1994-06-15 03:54:44 +04:00
dirp = (ISODIR *)(bp->b_data + (ip->i_number & imp->im_bmask));
1994-06-08 15:22:45 +04:00
/*
* Just make sure, we have a right one....
* 1: Check not cross boundary on block
*/
if ((ip->i_number & imp->im_bmask) + isonum_711(dirp->length)
> imp->logical_block_size) {
brelse(bp);
return (EINVAL);
}
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
/*
* Now get a buffer
* Abuse a namei buffer for now.
*/
if (uio->uio_segflg == UIO_SYSSPACE &&
uio->uio_iov->iov_len >= MAXPATHLEN)
symname = uio->uio_iov->iov_base;
else
MALLOC(symname, char *, MAXPATHLEN, M_NAMEI, M_WAITOK);
1994-06-08 15:22:45 +04:00
/*
* Ok, we just gathering a symbolic name in SL record.
*/
if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) {
if (uio->uio_segflg != UIO_SYSSPACE ||
uio->uio_iov->iov_len < MAXPATHLEN)
FREE(symname, M_NAMEI);
1994-06-08 15:22:45 +04:00
brelse(bp);
return (EINVAL);
}
/*
* Don't forget before you leave from home ;-)
*/
brelse(bp);
1994-06-15 03:54:44 +04:00
1994-06-08 15:22:45 +04:00
/*
* return with the symbolic name to caller's.
*/
if (uio->uio_segflg != UIO_SYSSPACE ||
uio->uio_iov->iov_len < MAXPATHLEN) {
error = uiomove(symname, symlen, uio);
FREE(symname, M_NAMEI);
return (error);
}
uio->uio_resid -= symlen;
2001-11-17 21:56:46 +03:00
uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + symlen;
uio->uio_iov->iov_len -= symlen;
return (0);
1994-06-08 15:22:45 +04:00
}
int
1996-02-10 00:31:50 +03:00
cd9660_link(v)
void *v;
{
struct vop_link_args /* {
struct vnode *a_dvp;
struct vnode *a_vp;
struct componentname *a_cnp;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
vput(ap->a_dvp);
return (EROFS);
}
int
1996-02-10 03:33:53 +03:00
cd9660_symlink(v)
1996-02-10 00:31:50 +03:00
void *v;
{
struct vop_symlink_args /* {
struct vnode *a_dvp;
struct vnode **a_vpp;
struct componentname *a_cnp;
struct vattr *a_vap;
char *a_target;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
vput(ap->a_dvp);
return (EROFS);
}
1994-06-08 15:22:45 +04:00
/*
* Calculate the logical to physical mapping if not done already,
* then call the device strategy routine.
*/
int
1996-02-10 00:31:50 +03:00
cd9660_strategy(v)
void *v;
{
1994-06-08 15:22:45 +04:00
struct vop_strategy_args /* {
struct buf *a_bp;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
2000-03-30 16:13:30 +04:00
struct buf *bp = ap->a_bp;
struct vnode *vp = bp->b_vp;
struct iso_node *ip;
1994-06-08 15:22:45 +04:00
int error;
ip = VTOI(vp);
if (vp->v_type == VBLK || vp->v_type == VCHR)
panic("cd9660_strategy: spec");
if (bp->b_blkno == bp->b_lblkno) {
1996-02-10 00:31:50 +03:00
error = VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL);
if (error) {
1994-06-08 15:22:45 +04:00
bp->b_error = error;
bp->b_flags |= B_ERROR;
biodone(bp);
return (error);
}
if ((long)bp->b_blkno == -1)
clrbuf(bp);
}
if ((long)bp->b_blkno == -1) {
biodone(bp);
return (0);
}
vp = ip->i_devvp;
bp->b_dev = vp->v_rdev;
VOCALL (vp->v_op, VOFFSET(vop_strategy), ap);
return (0);
}
/*
* Print out the contents of an inode.
*/
1996-02-10 00:31:50 +03:00
/*ARGSUSED*/
1994-06-08 15:22:45 +04:00
int
1996-02-10 00:31:50 +03:00
cd9660_print(v)
void *v;
1994-06-08 15:22:45 +04:00
{
1998-03-01 05:20:01 +03:00
1996-10-13 06:28:58 +04:00
printf("tag VT_ISOFS, isofs vnode\n");
1994-06-08 15:22:45 +04:00
return (0);
}
1994-07-20 03:33:59 +04:00
/*
* Return POSIX pathconf information applicable to cd9660 filesystems.
*/
int
1996-02-10 00:31:50 +03:00
cd9660_pathconf(v)
void *v;
{
1994-07-20 03:33:59 +04:00
struct vop_pathconf_args /* {
struct vnode *a_vp;
int a_name;
register_t *a_retval;
1996-02-10 00:31:50 +03:00
} */ *ap = v;
1994-07-20 03:33:59 +04:00
switch (ap->a_name) {
case _PC_LINK_MAX:
*ap->a_retval = 1;
return (0);
case _PC_NAME_MAX:
if (VTOI(ap->a_vp)->i_mnt->iso_ftype == ISO_FTYPE_RRIP)
*ap->a_retval = NAME_MAX;
else
1994-08-03 10:03:12 +04:00
*ap->a_retval = 37;
1994-07-20 03:33:59 +04:00
return (0);
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;
return (0);
case _PC_PIPE_BUF:
*ap->a_retval = PIPE_BUF;
return (0);
case _PC_CHOWN_RESTRICTED:
*ap->a_retval = 1;
return (0);
case _PC_NO_TRUNC:
*ap->a_retval = 1;
return (0);
1998-08-03 18:19:57 +04:00
case _PC_SYNC_IO:
*ap->a_retval = 1;
return (0);
1999-03-22 22:21:07 +03:00
case _PC_FILESIZEBITS:
*ap->a_retval = 32;
return (0);
1994-07-20 03:33:59 +04:00
default:
return (EINVAL);
}
/* NOTREACHED */
}
/*
* Allow changing the size for special files (and fifos).
*/
int
cd9660_setattr(v)
void *v;
{
struct vop_setattr_args /* {
1998-03-01 05:20:01 +03:00
struct vnodeop_desc *a_desc;
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
struct vattr *vap = ap->a_vap;
struct vnode *vp = ap->a_vp;
/*
* Only size is changeable.
*/
if (vap->va_type != VNON
1997-10-17 03:56:57 +04:00
|| vap->va_nlink != (nlink_t)VNOVAL
|| vap->va_fsid != VNOVAL
|| vap->va_fileid != VNOVAL
|| vap->va_blocksize != VNOVAL
1997-10-17 03:56:57 +04:00
|| vap->va_rdev != (dev_t)VNOVAL
|| (int)vap->va_bytes != VNOVAL
|| vap->va_gen != VNOVAL
|| vap->va_flags != VNOVAL
|| vap->va_uid != (uid_t)VNOVAL
|| vap->va_gid != (gid_t)VNOVAL
|| vap->va_atime.tv_sec != VNOVAL
|| vap->va_mtime.tv_sec != VNOVAL
|| vap->va_mode != (mode_t)VNOVAL)
return EOPNOTSUPP;
if (vap->va_size != VNOVAL
&& vp->v_type != VCHR
&& vp->v_type != VBLK
&& vp->v_type != VFIFO
)
return EOPNOTSUPP;
return VOP_TRUNCATE(vp, vap->va_size, 0, ap->a_cred, ap->a_p);
}
1994-06-08 15:22:45 +04:00
/*
* Global vfs data structures for isofs
*/
#define cd9660_create genfs_eopnotsupp
#define cd9660_mknod genfs_eopnotsupp
#define cd9660_write genfs_eopnotsupp
1998-06-26 02:20:39 +04:00
#define cd9660_lease_check genfs_lease_check
#define cd9660_fsync genfs_nullop
#define cd9660_remove genfs_eopnotsupp
#define cd9660_rename genfs_eopnotsupp
#define cd9660_mkdir genfs_eopnotsupp
#define cd9660_rmdir genfs_eopnotsupp
#define cd9660_advlock genfs_einval
#define cd9660_valloc genfs_eopnotsupp
#define cd9660_vfree genfs_nullop
#define cd9660_truncate genfs_eopnotsupp
#define cd9660_update genfs_nullop
#define cd9660_bwrite genfs_eopnotsupp
1998-03-01 05:20:01 +03:00
#define cd9660_revoke genfs_revoke
1994-06-08 15:22:45 +04:00
/*
* Global vfs data structures for cd9660
1994-06-08 15:22:45 +04:00
*/
1996-02-10 00:31:50 +03:00
int (**cd9660_vnodeop_p) __P((void *));
const struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
1994-06-08 15:22:45 +04:00
{ &vop_default_desc, vn_default_error },
{ &vop_lookup_desc, cd9660_lookup }, /* lookup */
{ &vop_create_desc, cd9660_create }, /* create */
{ &vop_mknod_desc, cd9660_mknod }, /* mknod */
{ &vop_open_desc, cd9660_open }, /* open */
{ &vop_close_desc, cd9660_close }, /* close */
{ &vop_access_desc, cd9660_access }, /* access */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
{ &vop_read_desc, cd9660_read }, /* read */
{ &vop_write_desc, cd9660_write }, /* write */
{ &vop_lease_desc, cd9660_lease_check }, /* lease */
{ &vop_fcntl_desc, genfs_fcntl }, /* fcntl */
{ &vop_ioctl_desc, cd9660_ioctl }, /* ioctl */
1996-09-07 16:40:22 +04:00
{ &vop_poll_desc, cd9660_poll }, /* poll */
1998-03-01 05:20:01 +03:00
{ &vop_revoke_desc, cd9660_revoke }, /* revoke */
{ &vop_mmap_desc, cd9660_mmap }, /* mmap */
{ &vop_fsync_desc, cd9660_fsync }, /* fsync */
{ &vop_seek_desc, cd9660_seek }, /* seek */
{ &vop_remove_desc, cd9660_remove }, /* remove */
{ &vop_link_desc, cd9660_link }, /* link */
{ &vop_rename_desc, cd9660_rename }, /* rename */
{ &vop_mkdir_desc, cd9660_mkdir }, /* mkdir */
{ &vop_rmdir_desc, cd9660_rmdir }, /* rmdir */
{ &vop_symlink_desc, cd9660_symlink }, /* symlink */
{ &vop_readdir_desc, cd9660_readdir }, /* readdir */
{ &vop_readlink_desc, cd9660_readlink }, /* readlink */
{ &vop_abortop_desc, cd9660_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive }, /* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, genfs_lock }, /* lock */
{ &vop_unlock_desc, genfs_unlock }, /* unlock */
{ &vop_bmap_desc, cd9660_bmap }, /* bmap */
{ &vop_strategy_desc, cd9660_strategy }, /* strategy */
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, cd9660_pathconf }, /* pathconf */
{ &vop_advlock_desc, cd9660_advlock }, /* advlock */
{ &vop_blkatoff_desc, cd9660_blkatoff }, /* blkatoff */
{ &vop_valloc_desc, cd9660_valloc }, /* valloc */
{ &vop_vfree_desc, cd9660_vfree }, /* vfree */
{ &vop_truncate_desc, cd9660_truncate }, /* truncate */
{ &vop_update_desc, cd9660_update }, /* update */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
{ &vop_getpages_desc, genfs_getpages }, /* getpages */
a whole bunch of changes to improve performance and robustness under load: - remove special treatment of pager_map mappings in pmaps. this is required now, since I've removed the globals that expose the address range. pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's no longer any need to special-case it. - eliminate struct uvm_vnode by moving its fields into struct vnode. - rewrite the pageout path. the pager is now responsible for handling the high-level requests instead of only getting control after a bunch of work has already been done on its behalf. this will allow us to UBCify LFS, which needs tighter control over its pages than other filesystems do. writing a page to disk no longer requires making it read-only, which allows us to write wired pages without causing all kinds of havoc. - use a new PG_PAGEOUT flag to indicate that a page should be freed on behalf of the pagedaemon when it's unlocked. this flag is very similar to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the pageout fails due to eg. an indirect-block buffer being locked. this allows us to remove the "version" field from struct vm_page, and together with shrinking "loan_count" from 32 bits to 16, struct vm_page is now 4 bytes smaller. - no longer use PG_RELEASED for swap-backed pages. if the page is busy because it's being paged out, we can't release the swap slot to be reallocated until that write is complete, but unlike with vnodes we don't keep a count of in-progress writes so there's no good way to know when the write is done. instead, when we need to free a busy swap-backed page, just sleep until we can get it busy ourselves. - implement a fast-path for extending writes which allows us to avoid zeroing new pages. this substantially reduces cpu usage. - encapsulate the data used by the genfs code in a struct genfs_node, which must be the first element of the filesystem-specific vnode data for filesystems which use genfs_{get,put}pages(). - eliminate many of the UVM pagerops, since they aren't needed anymore now that the pager "put" operation is a higher-level operation. - enhance the genfs code to allow NFS to use the genfs_{get,put}pages instead of a modified copy. - clean up struct vnode by removing all the fields that used to be used by the vfs_cluster.c code (which we don't use anymore with UBC). - remove kmem_object and mb_object since they were useless. instead of allocating pages to these objects, we now just allocate pages with no object. such pages are mapped in the kernel until they are freed, so we can use the mapping to find the page to free it. this allows us to remove splvm() protection in several places. The sum of all these changes improves write throughput on my decstation 5000/200 to within 1% of the rate of NetBSD 1.5 and reduces the elapsed time for "make release" of a NetBSD 1.5 source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
{ &vop_putpages_desc, genfs_putpages }, /* putpages */
{ NULL, NULL }
1994-06-08 15:22:45 +04:00
};
const struct vnodeopv_desc cd9660_vnodeop_opv_desc =
1994-06-08 15:22:45 +04:00
{ &cd9660_vnodeop_p, cd9660_vnodeop_entries };
/*
* Special device vnode ops
*/
1996-02-10 00:31:50 +03:00
int (**cd9660_specop_p) __P((void *));
const struct vnodeopv_entry_desc cd9660_specop_entries[] = {
1994-06-08 15:22:45 +04:00
{ &vop_default_desc, vn_default_error },
{ &vop_lookup_desc, spec_lookup }, /* lookup */
{ &vop_create_desc, spec_create }, /* create */
{ &vop_mknod_desc, spec_mknod }, /* mknod */
{ &vop_open_desc, spec_open }, /* open */
{ &vop_close_desc, spec_close }, /* close */
{ &vop_access_desc, cd9660_access }, /* access */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
{ &vop_read_desc, spec_read }, /* read */
{ &vop_write_desc, spec_write }, /* write */
{ &vop_lease_desc, spec_lease_check }, /* lease */
{ &vop_fcntl_desc, genfs_fcntl }, /* fcntl */
{ &vop_ioctl_desc, spec_ioctl }, /* ioctl */
1996-09-07 16:40:22 +04:00
{ &vop_poll_desc, spec_poll }, /* poll */
{ &vop_kqfilter_desc, spec_kqfilter }, /* kqfilter */
1998-03-01 05:20:01 +03:00
{ &vop_revoke_desc, spec_revoke }, /* revoke */
{ &vop_mmap_desc, spec_mmap }, /* mmap */
{ &vop_fsync_desc, spec_fsync }, /* fsync */
{ &vop_seek_desc, spec_seek }, /* seek */
{ &vop_remove_desc, spec_remove }, /* remove */
{ &vop_link_desc, spec_link }, /* link */
{ &vop_rename_desc, spec_rename }, /* rename */
{ &vop_mkdir_desc, spec_mkdir }, /* mkdir */
{ &vop_rmdir_desc, spec_rmdir }, /* rmdir */
{ &vop_symlink_desc, spec_symlink }, /* symlink */
{ &vop_readdir_desc, spec_readdir }, /* readdir */
{ &vop_readlink_desc, spec_readlink }, /* readlink */
{ &vop_abortop_desc, spec_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive }, /* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, genfs_lock }, /* lock */
{ &vop_unlock_desc, genfs_unlock }, /* unlock */
{ &vop_bmap_desc, spec_bmap }, /* bmap */
{ &vop_strategy_desc, spec_strategy }, /* strategy */
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, spec_pathconf }, /* pathconf */
{ &vop_advlock_desc, spec_advlock }, /* advlock */
{ &vop_blkatoff_desc, spec_blkatoff }, /* blkatoff */
{ &vop_valloc_desc, spec_valloc }, /* valloc */
{ &vop_vfree_desc, spec_vfree }, /* vfree */
{ &vop_truncate_desc, spec_truncate }, /* truncate */
{ &vop_update_desc, cd9660_update }, /* update */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
{ &vop_getpages_desc, spec_getpages }, /* getpages */
{ &vop_putpages_desc, spec_putpages }, /* putpages */
{ NULL, NULL }
1994-06-08 15:22:45 +04:00
};
const struct vnodeopv_desc cd9660_specop_opv_desc =
1994-06-08 15:22:45 +04:00
{ &cd9660_specop_p, cd9660_specop_entries };
1996-02-10 00:31:50 +03:00
int (**cd9660_fifoop_p) __P((void *));
const struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
1994-06-08 15:22:45 +04:00
{ &vop_default_desc, vn_default_error },
{ &vop_lookup_desc, fifo_lookup }, /* lookup */
{ &vop_create_desc, fifo_create }, /* create */
{ &vop_mknod_desc, fifo_mknod }, /* mknod */
{ &vop_open_desc, fifo_open }, /* open */
{ &vop_close_desc, fifo_close }, /* close */
{ &vop_access_desc, cd9660_access }, /* access */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
{ &vop_read_desc, fifo_read }, /* read */
{ &vop_write_desc, fifo_write }, /* write */
{ &vop_lease_desc, fifo_lease_check }, /* lease */
{ &vop_fcntl_desc, genfs_fcntl }, /* fcntl */
{ &vop_ioctl_desc, fifo_ioctl }, /* ioctl */
1996-09-07 16:40:22 +04:00
{ &vop_poll_desc, fifo_poll }, /* poll */
{ &vop_kqfilter_desc, fifo_kqfilter }, /* kqfilter */
1998-03-01 05:20:01 +03:00
{ &vop_revoke_desc, fifo_revoke }, /* revoke */
{ &vop_mmap_desc, fifo_mmap }, /* mmap */
{ &vop_fsync_desc, fifo_fsync }, /* fsync */
{ &vop_seek_desc, fifo_seek }, /* seek */
{ &vop_remove_desc, fifo_remove }, /* remove */
{ &vop_link_desc, fifo_link } , /* link */
{ &vop_rename_desc, fifo_rename }, /* rename */
{ &vop_mkdir_desc, fifo_mkdir }, /* mkdir */
{ &vop_rmdir_desc, fifo_rmdir }, /* rmdir */
{ &vop_symlink_desc, fifo_symlink }, /* symlink */
{ &vop_readdir_desc, fifo_readdir }, /* readdir */
{ &vop_readlink_desc, fifo_readlink }, /* readlink */
{ &vop_abortop_desc, fifo_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive }, /* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, genfs_lock }, /* lock */
{ &vop_unlock_desc, genfs_unlock }, /* unlock */
{ &vop_bmap_desc, fifo_bmap }, /* bmap */
{ &vop_strategy_desc, fifo_strategy }, /* strategy */
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, fifo_pathconf }, /* pathconf */
{ &vop_advlock_desc, fifo_advlock }, /* advlock */
{ &vop_blkatoff_desc, fifo_blkatoff }, /* blkatoff */
{ &vop_valloc_desc, fifo_valloc }, /* valloc */
{ &vop_vfree_desc, fifo_vfree }, /* vfree */
{ &vop_truncate_desc, fifo_truncate }, /* truncate */
{ &vop_update_desc, cd9660_update }, /* update */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
2001-09-23 02:49:32 +04:00
{ &vop_putpages_desc, fifo_putpages }, /* putpages */
{ NULL, NULL }
1994-06-08 15:22:45 +04:00
};
const struct vnodeopv_desc cd9660_fifoop_opv_desc =
1994-06-08 15:22:45 +04:00
{ &cd9660_fifoop_p, cd9660_fifoop_entries };