diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-29 10:12:31 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-29 10:12:31 +0000 |
commit | e0ebb2a241212ffac2e99d36a352ae3c80c88216 (patch) | |
tree | 5b3adcea300ddb9124959b68fbe8225ed294ef08 /sys/isofs/cd9660 | |
parent | 236ff0b91447f3ca43d97ac33e3181bd9ac3c910 (diff) |
From NetBSD: merge with 960217
Diffstat (limited to 'sys/isofs/cd9660')
-rw-r--r-- | sys/isofs/cd9660/cd9660_bmap.c | 10 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_lookup.c | 43 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_node.c | 34 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_node.h | 54 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_rrip.c | 120 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_util.c | 5 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vfsops.c | 64 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 315 | ||||
-rw-r--r-- | sys/isofs/cd9660/iso.h | 43 |
9 files changed, 395 insertions, 293 deletions
diff --git a/sys/isofs/cd9660/cd9660_bmap.c b/sys/isofs/cd9660/cd9660_bmap.c index fdadd3ac028..e88810b1d38 100644 --- a/sys/isofs/cd9660/cd9660_bmap.c +++ b/sys/isofs/cd9660/cd9660_bmap.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_bmap.c,v 1.5 1994/12/13 22:33:12 mycroft Exp $ */ +/* $OpenBSD: cd9660_bmap.c,v 1.2 1996/02/29 10:12:14 niklas Exp $ */ +/* $NetBSD: cd9660_bmap.c,v 1.6 1996/02/09 21:31:50 christos Exp $ */ /*- * Copyright (c) 1994 @@ -56,15 +57,16 @@ * number to index into the data block (extent) for the file. */ int -cd9660_bmap(ap) +cd9660_bmap(v) + void *v; +{ struct vop_bmap_args /* { struct vnode *a_vp; daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; - } */ *ap; -{ + } */ *ap = v; struct iso_node *ip = VTOI(ap->a_vp); daddr_t lblkno = ap->a_bn; int bshift; diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c index e468290fe80..68ee77511a9 100644 --- a/sys/isofs/cd9660/cd9660_lookup.c +++ b/sys/isofs/cd9660/cd9660_lookup.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_lookup.c,v 1.13 1994/12/24 15:30:03 cgd Exp $ */ +/* $OpenBSD: cd9660_lookup.c,v 1.2 1996/02/29 10:12:17 niklas Exp $ */ +/* $NetBSD: cd9660_lookup.c,v 1.14 1996/02/09 21:31:56 christos Exp $ */ /*- * Copyright (c) 1989, 1993, 1994 @@ -48,6 +49,7 @@ #include <sys/file.h> #include <sys/vnode.h> #include <sys/mount.h> +#include <sys/systm.h> #include <isofs/cd9660/iso.h> #include <isofs/cd9660/cd9660_node.h> @@ -92,20 +94,22 @@ struct nchstats iso_nchstats; * NOTE: (LOOKUP | LOCKPARENT) currently returns the parent inode unlocked. */ int -cd9660_lookup(ap) +cd9660_lookup(v) + void *v; +{ struct vop_lookup_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vdp; /* vnode for directory being searched */ register struct iso_node *dp; /* inode for directory being searched */ register struct iso_mnt *imp; /* file system that directory is in */ struct buf *bp; /* a buffer of directory entries */ - struct iso_directory_record *ep;/* the current directory entry */ + struct iso_directory_record *ep = NULL; + /* the current directory entry */ int entryoffsetinblock; /* offset of ep in bp's buffer */ - int saveoffset; /* offset of last directory entry in dir */ + int saveoffset = -1; /* offset of last directory entry in dir */ int numdirpasses; /* strategy for directory search */ doff_t endsearch; /* offset to end directory search */ struct vnode *pdp; /* saved dp during symlink work */ @@ -140,7 +144,7 @@ cd9660_lookup(ap) */ if (vdp->v_type != VDIR) return (ENOTDIR); - if (error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) + if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)) != 0) return (error); /* @@ -150,7 +154,7 @@ cd9660_lookup(ap) * check the name cache to see if the directory/name pair * we are looking for is known already. */ - if (error = cache_lookup(vdp, vpp, cnp)) { + if ((error = cache_lookup(vdp, vpp, cnp)) != 0) { int vpid; /* capability number of vnode */ if (error == ENOENT) @@ -192,7 +196,7 @@ cd9660_lookup(ap) if (lockparent && pdp != vdp && (flags & ISLASTCN)) VOP_UNLOCK(pdp); } - if (error = VOP_LOCK(pdp)) + if ((error = VOP_LOCK(pdp)) != 0) return (error); vdp = pdp; dp = VTOI(pdp); @@ -204,7 +208,8 @@ cd9660_lookup(ap) /* * A leading `=' means, we are looking for an associated file */ - if (assoc = (imp->iso_ftype != ISO_FTYPE_RRIP && *name == ASSOCCHAR)) { + assoc = (imp->iso_ftype != ISO_FTYPE_RRIP && *name == ASSOCCHAR); + if (assoc) { len--; name++; } @@ -246,8 +251,9 @@ searchloop: if ((dp->i_offset & bmask) == 0) { if (bp != NULL) brelse(bp); - if (error = - VOP_BLKATOFF(vdp, (off_t)dp->i_offset, NULL, &bp)) + error = VOP_BLKATOFF(vdp, (off_t)dp->i_offset, + NULL, &bp); + if (error) return (error); entryoffsetinblock = 0; } @@ -342,8 +348,8 @@ foundino: lblkno(imp, saveoffset)) { if (bp != NULL) brelse(bp); - if (error = VOP_BLKATOFF(vdp, - (off_t)saveoffset, NULL, &bp)) + if ((error = VOP_BLKATOFF(vdp, + (off_t)saveoffset, NULL, &bp)) != 0) return (error); } entryoffsetinblock = saveoffset & bmask; @@ -456,14 +462,15 @@ found: * remaining space in the directory. */ int -cd9660_blkatoff(ap) +cd9660_blkatoff(v) + void *v; +{ struct vop_blkatoff_args /* { struct vnode *a_vp; off_t a_offset; char **a_res; struct buf **a_bpp; - } */ *ap; -{ + } */ *ap = v; struct iso_node *ip; register struct iso_mnt *imp; struct buf *bp; @@ -475,7 +482,7 @@ cd9660_blkatoff(ap) lbn = lblkno(imp, ap->a_offset); bsize = blksize(imp, ip, lbn); - if (error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) { + if ((error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) != 0) { brelse(bp); *ap->a_bpp = NULL; return (error); diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c index 03cd40bebd9..9ad3690f5ba 100644 --- a/sys/isofs/cd9660/cd9660_node.c +++ b/sys/isofs/cd9660/cd9660_node.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_node.c,v 1.13 1994/12/24 15:30:07 cgd Exp $ */ +/* $OpenBSD: cd9660_node.c,v 1.2 1996/02/29 10:12:19 niklas Exp $ */ +/* $NetBSD: cd9660_node.c,v 1.15 1996/02/09 21:31:58 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1994 @@ -47,6 +48,7 @@ #include <sys/file.h> #include <sys/buf.h> #include <sys/vnode.h> +#include <sys/namei.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/stat.h> @@ -70,10 +72,12 @@ u_long idvhash; int prtactive; /* 1 => print out reclaim of active vnodes */ +static u_int cd9660_chars2ui __P((u_char *, int)); + /* * Initialize hash links for inodes and dnodes. */ -int +void cd9660_init() { @@ -180,7 +184,7 @@ cd9660_ihashins(ip) struct iso_node **ipp, *iq; ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)]; - if (iq = *ipp) + if ((iq = *ipp) != NULL) iq->i_prev = &ip->i_next; ip->i_next = iq; ip->i_prev = ipp; @@ -203,7 +207,7 @@ cd9660_ihashrem(ip) { register struct iso_node *iq; - if (iq = ip->i_next) + if ((iq = ip->i_next) != NULL) iq->i_prev = ip->i_prev; *ip->i_prev = iq; #ifdef DIAGNOSTIC @@ -217,11 +221,12 @@ cd9660_ihashrem(ip) * truncate and deallocate the file. */ int -cd9660_inactive(ap) +cd9660_inactive(v) + void *v; +{ struct vop_inactive_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); int error = 0; @@ -243,11 +248,12 @@ cd9660_inactive(ap) * Reclaim an inode so that it can be used for other purposes. */ int -cd9660_reclaim(ap) +cd9660_reclaim(v) + void *v; +{ struct vop_reclaim_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); @@ -392,8 +398,8 @@ cd9660_tstamp_conv7(pi,pu) tz = pi[6]; if (y < 1970) { - pu->ts_sec = 0; - pu->ts_nsec = 0; + pu->tv_sec = 0; + pu->tv_nsec = 0; return 0; } else { #ifdef ORIGINAL @@ -413,8 +419,8 @@ cd9660_tstamp_conv7(pi,pu) if (-48 <= tz && tz <= 52) crtime -= tz * 15 * 60; } - pu->ts_sec = crtime; - pu->ts_nsec = 0; + pu->tv_sec = crtime; + pu->tv_nsec = 0; return 1; } diff --git a/sys/isofs/cd9660/cd9660_node.h b/sys/isofs/cd9660/cd9660_node.h index 534006f6d53..08490035ad0 100644 --- a/sys/isofs/cd9660/cd9660_node.h +++ b/sys/isofs/cd9660/cd9660_node.h @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_node.h,v 1.10 1994/12/24 15:30:09 cgd Exp $ */ +/* $OpenBSD: cd9660_node.h,v 1.2 1996/02/29 10:12:21 niklas Exp $ */ +/* $NetBSD: cd9660_node.h,v 1.11 1996/02/09 21:32:00 christos Exp $ */ /*- * Copyright (c) 1994 @@ -109,29 +110,32 @@ struct iso_node { /* * Prototypes for ISOFS vnode operations */ -int cd9660_lookup __P((struct vop_lookup_args *)); -int cd9660_open __P((struct vop_open_args *)); -int cd9660_close __P((struct vop_close_args *)); -int cd9660_access __P((struct vop_access_args *)); -int cd9660_getattr __P((struct vop_getattr_args *)); -int cd9660_read __P((struct vop_read_args *)); -int cd9660_ioctl __P((struct vop_ioctl_args *)); -int cd9660_select __P((struct vop_select_args *)); -int cd9660_mmap __P((struct vop_mmap_args *)); -int cd9660_seek __P((struct vop_seek_args *)); -int cd9660_readdir __P((struct vop_readdir_args *)); -int cd9660_readlink __P((struct vop_readlink_args *)); -int cd9660_abortop __P((struct vop_abortop_args *)); -int cd9660_inactive __P((struct vop_inactive_args *)); -int cd9660_reclaim __P((struct vop_reclaim_args *)); -int cd9660_bmap __P((struct vop_bmap_args *)); -int cd9660_lock __P((struct vop_lock_args *)); -int cd9660_unlock __P((struct vop_unlock_args *)); -int cd9660_strategy __P((struct vop_strategy_args *)); -int cd9660_print __P((struct vop_print_args *)); -int cd9660_islocked __P((struct vop_islocked_args *)); -int cd9660_pathconf __P((struct vop_pathconf_args *)); -int cd9660_blkatoff __P((struct vop_blkatoff_args *)); +int cd9660_enotsupp __P((void *)); +int cd9660_lookup __P((void *)); +int cd9660_open __P((void *)); +int cd9660_close __P((void *)); +int cd9660_access __P((void *)); +int cd9660_getattr __P((void *)); +int cd9660_read __P((void *)); +int cd9660_ioctl __P((void *)); +int cd9660_select __P((void *)); +int cd9660_mmap __P((void *)); +int cd9660_seek __P((void *)); +int cd9660_readdir __P((void *)); +int cd9660_readlink __P((void *)); +int cd9660_abortop __P((void *)); +int cd9660_inactive __P((void *)); +int cd9660_reclaim __P((void *)); +int cd9660_link __P((void *)); +int cd9660_symlink __P((void *)); +int cd9660_bmap __P((void *)); +int cd9660_lock __P((void *)); +int cd9660_unlock __P((void *)); +int cd9660_strategy __P((void *)); +int cd9660_print __P((void *)); +int cd9660_islocked __P((void *)); +int cd9660_pathconf __P((void *)); +int cd9660_blkatoff __P((void *)); void cd9660_defattr __P((struct iso_directory_record *, struct iso_node *, struct buf *)); @@ -142,6 +146,8 @@ void cd9660_ihashins __P((struct iso_node *)); void cd9660_ihashrem __P((struct iso_node *)); int cd9660_tstamp_conv7 __P((u_char *, struct timespec *)); int cd9660_tstamp_conv17 __P((u_char *, struct timespec *)); +int cd9660_vget_internal __P((struct mount *, ino_t, struct vnode **, int, + struct iso_directory_record *)); ino_t isodirino __P((struct iso_directory_record *, struct iso_mnt *)); #ifdef ISODEVMAP struct iso_dnode *iso_dmap __P((dev_t, ino_t, int)); diff --git a/sys/isofs/cd9660/cd9660_rrip.c b/sys/isofs/cd9660/cd9660_rrip.c index 39e34af4e59..347671f3246 100644 --- a/sys/isofs/cd9660/cd9660_rrip.c +++ b/sys/isofs/cd9660/cd9660_rrip.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_rrip.c,v 1.11 1994/12/24 15:30:10 cgd Exp $ */ +/* $OpenBSD: cd9660_rrip.c,v 1.2 1996/02/29 10:12:22 niklas Exp $ */ +/* $NetBSD: cd9660_rrip.c,v 1.12 1996/02/09 21:32:02 christos Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -58,14 +59,38 @@ #include <isofs/cd9660/cd9660_rrip.h> #include <isofs/cd9660/iso_rrip.h> +typedef struct { + char type[2]; + int (*func) __P((void *, ISO_RRIP_ANALYZE *)); + void (*func2) __P((void *, ISO_RRIP_ANALYZE *)); + int result; +} RRIP_TABLE; + +static int cd9660_rrip_attr __P((void *, ISO_RRIP_ANALYZE *)); +static void cd9660_rrip_defattr __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_slink __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_altname __P((void *, ISO_RRIP_ANALYZE *)); +static void cd9660_rrip_defname __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_pclink __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_reldir __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_tstamp __P((void *, ISO_RRIP_ANALYZE *)); +static void cd9660_rrip_deftstamp __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_device __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_idflag __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_cont __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_stop __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_extref __P((void *, ISO_RRIP_ANALYZE *)); +static int cd9660_rrip_loop __P((struct iso_directory_record *, + ISO_RRIP_ANALYZE *, RRIP_TABLE *)); /* * POSIX file attribute */ static int -cd9660_rrip_attr(p,ana) - ISO_RRIP_ATTR *p; +cd9660_rrip_attr(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_ATTR *p = v; ana->inop->inode.iso_mode = isonum_733(p->mode); ana->inop->inode.iso_uid = isonum_733(p->uid); ana->inop->inode.iso_gid = isonum_733(p->gid); @@ -75,10 +100,11 @@ cd9660_rrip_attr(p,ana) } static void -cd9660_rrip_defattr(isodir,ana) - struct iso_directory_record *isodir; +cd9660_rrip_defattr(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + struct iso_directory_record *isodir = v; /* But this is a required field! */ printf("RRIP without PX field?\n"); cd9660_defattr(isodir,ana->inop,NULL); @@ -88,17 +114,19 @@ cd9660_rrip_defattr(isodir,ana) * Symbolic Links */ static int -cd9660_rrip_slink(p,ana) - ISO_RRIP_SLINK *p; +cd9660_rrip_slink(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_SLINK *p = v; register ISO_RRIP_SLINK_COMPONENT *pcomp; register ISO_RRIP_SLINK_COMPONENT *pcompe; int len, wlen, cont; char *outbuf, *inbuf; pcomp = (ISO_RRIP_SLINK_COMPONENT *)p->component; - pcompe = (ISO_RRIP_SLINK_COMPONENT *)((char *)p + isonum_711(p->h.length)); + pcompe = (ISO_RRIP_SLINK_COMPONENT *) + ((char *)p + isonum_711(p->h.length)); len = *ana->outlen; outbuf = ana->outbuf; cont = ana->cont; @@ -199,10 +227,11 @@ cd9660_rrip_slink(p,ana) * Alternate name */ static int -cd9660_rrip_altname(p,ana) - ISO_RRIP_ALTNAME *p; +cd9660_rrip_altname(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_ALTNAME *p = v; char *inbuf; int wlen; int cont; @@ -262,10 +291,11 @@ cd9660_rrip_altname(p,ana) } static void -cd9660_rrip_defname(isodir,ana) - struct iso_directory_record *isodir; +cd9660_rrip_defname(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + struct iso_directory_record *isodir = v; strcpy(ana->outbuf,".."); switch (*isodir->name) { default: @@ -286,10 +316,11 @@ cd9660_rrip_defname(isodir,ana) * Parent or Child Link */ static int -cd9660_rrip_pclink(p,ana) - ISO_RRIP_CLINK *p; +cd9660_rrip_pclink(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_CLINK *p = v; *ana->inump = isonum_733(p->dir_loc) << ana->imp->im_bshift; ana->fields &= ~(ISO_SUSP_CLINK|ISO_SUSP_PLINK); return *p->h.type == 'C' ? ISO_SUSP_CLINK : ISO_SUSP_PLINK; @@ -298,9 +329,10 @@ cd9660_rrip_pclink(p,ana) /* * Relocated directory */ +/*ARGSUSED*/ static int -cd9660_rrip_reldir(p,ana) - ISO_RRIP_RELDIR *p; +cd9660_rrip_reldir(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { /* special hack to make caller aware of RE field */ @@ -310,10 +342,11 @@ cd9660_rrip_reldir(p,ana) } static int -cd9660_rrip_tstamp(p,ana) - ISO_RRIP_TSTAMP *p; +cd9660_rrip_tstamp(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_TSTAMP *p = v; u_char *ptime; ptime = p->time; @@ -367,10 +400,11 @@ cd9660_rrip_tstamp(p,ana) } static void -cd9660_rrip_deftstamp(isodir,ana) - struct iso_directory_record *isodir; +cd9660_rrip_deftstamp(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + struct iso_directory_record *isodir = v; cd9660_deftstamp(isodir,ana->inop,NULL); } @@ -378,10 +412,11 @@ cd9660_rrip_deftstamp(isodir,ana) * POSIX device modes */ static int -cd9660_rrip_device(p,ana) - ISO_RRIP_DEVICE *p; +cd9660_rrip_device(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_DEVICE *p = v; u_int high, low; high = isonum_733(p->dev_t_high); @@ -399,10 +434,11 @@ cd9660_rrip_device(p,ana) * Flag indicating */ static int -cd9660_rrip_idflag(p,ana) - ISO_RRIP_IDFLAG *p; +cd9660_rrip_idflag(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_IDFLAG *p = v; ana->fields &= isonum_711(p->flags)|~0xff; /* don't touch high bits */ /* special handling of RE field */ if (ana->fields&ISO_SUSP_RELDIR) @@ -415,10 +451,11 @@ cd9660_rrip_idflag(p,ana) * Continuation pointer */ static int -cd9660_rrip_cont(p,ana) - ISO_RRIP_CONT *p; +cd9660_rrip_cont(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_CONT *p = v; ana->iso_ce_blk = isonum_733(p->location); ana->iso_ce_off = isonum_733(p->offset); ana->iso_ce_len = isonum_733(p->length); @@ -429,8 +466,8 @@ cd9660_rrip_cont(p,ana) * System Use end */ static int -cd9660_rrip_stop(p,ana) - ISO_SUSP_HEADER *p; +cd9660_rrip_stop(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { return ISO_SUSP_STOP; @@ -440,10 +477,11 @@ cd9660_rrip_stop(p,ana) * Extension reference */ static int -cd9660_rrip_extref(p,ana) - ISO_RRIP_EXTREF *p; +cd9660_rrip_extref(v, ana) + void *v; ISO_RRIP_ANALYZE *ana; { + ISO_RRIP_EXTREF *p = v; if (isonum_711(p->len_id) != 10 || bcmp((char *)p + 8,"RRIP_1991A",10) || isonum_711(p->version) != 1) @@ -452,12 +490,6 @@ cd9660_rrip_extref(p,ana) return ISO_SUSP_EXTREF; } -typedef struct { - char type[2]; - int (*func)(); - void (*func2)(); - int result; -} RRIP_TABLE; static int cd9660_rrip_loop(isodir,ana,table) @@ -563,7 +595,7 @@ static RRIP_TABLE rrip_table_analyze[] = { }; int -cd9660_rrip_analyze(isodir,inop,imp) +cd9660_rrip_analyze(isodir, inop, imp) struct iso_directory_record *isodir; struct iso_node *inop; struct iso_mnt *imp; @@ -650,14 +682,15 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) analyze.imp = imp; analyze.fields = ISO_SUSP_SLINK; - return (cd9660_rrip_loop(isodir,&analyze,rrip_table_getsymname)&ISO_SUSP_SLINK); + return (cd9660_rrip_loop(isodir, &analyze, rrip_table_getsymname) & + ISO_SUSP_SLINK); } static RRIP_TABLE rrip_table_extref[] = { - { "ER", cd9660_rrip_extref, 0, ISO_SUSP_EXTREF }, - { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, - { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, - { "", 0, 0, 0 } + { "ER", cd9660_rrip_extref, 0, ISO_SUSP_EXTREF }, + { "CE", cd9660_rrip_cont, 0, ISO_SUSP_CONT }, + { "ST", cd9660_rrip_stop, 0, ISO_SUSP_STOP }, + { "", 0, 0, 0 } }; /* @@ -684,7 +717,8 @@ cd9660_rrip_offset(isodir,imp) analyze.imp = imp; analyze.fields = ISO_SUSP_EXTREF; - if (!(cd9660_rrip_loop(isodir,&analyze,rrip_table_extref)&ISO_SUSP_EXTREF)) + if (!(cd9660_rrip_loop(isodir, &analyze, rrip_table_extref) + & ISO_SUSP_EXTREF)) return -1; return isonum_711(p->skip); diff --git a/sys/isofs/cd9660/cd9660_util.c b/sys/isofs/cd9660/cd9660_util.c index 6ef8bedc8e7..762bf65d110 100644 --- a/sys/isofs/cd9660/cd9660_util.c +++ b/sys/isofs/cd9660/cd9660_util.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_util.c,v 1.8 1994/12/13 22:33:25 mycroft Exp $ */ +/* $OpenBSD: cd9660_util.c,v 1.2 1996/02/29 10:12:24 niklas Exp $ */ +/* $NetBSD: cd9660_util.c,v 1.9 1996/02/09 21:32:06 christos Exp $ */ /*- * Copyright (c) 1994 @@ -91,7 +92,7 @@ isofncmp(fn, fnlen, isofn, isolen) for (j = 0; --isolen >= 0; j = j * 10 + *isofn++ - '0'); return i - j; } - if (c != *fn) { + if (((u_char) c) != *fn) { if (c >= 'A' && c <= 'Z') { if (c + ('a' - 'A') != *fn) { if (*fn >= 'a' && *fn <= 'z') diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 9bd974daac2..dd8988fa99c 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.19 1995/06/18 14:47:01 cgd Exp $ */ +/* $OpenBSD: cd9660_vfsops.c,v 1.2 1996/02/29 10:12:26 niklas Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.20 1996/02/09 21:32:08 christos Exp $ */ /*- * Copyright (c) 1994 @@ -60,8 +61,6 @@ #include <isofs/cd9660/iso_rrip.h> #include <isofs/cd9660/cd9660_node.h> -extern int enodev (); - struct vfsops cd9660_vfsops = { MOUNT_CD9660, cd9660_mount, @@ -94,7 +93,6 @@ cd9660_mountroot() extern struct vnode *rootvp; struct proc *p = curproc; /* XXX */ struct iso_mnt *imp; - register struct fs *fs; size_t size; int error; struct iso_args args; @@ -111,11 +109,11 @@ cd9660_mountroot() mp->mnt_flag = MNT_RDONLY; LIST_INIT(&mp->mnt_vnodelist); args.flags = ISOFSMNT_ROOT; - if (error = iso_mountfs(rootvp, mp, p, &args)) { + if ((error = iso_mountfs(rootvp, mp, p, &args)) != 0) { free(mp, M_MOUNT); return (error); } - if (error = vfs_lock(mp)) { + if ((error = vfs_lock(mp)) != 0) { (void)cd9660_unmount(mp, 0, p); free(mp, M_MOUNT); return (error); @@ -151,9 +149,10 @@ cd9660_mount(mp, path, data, ndp, p) struct iso_args args; size_t size; int error; - struct iso_mnt *imp; + struct iso_mnt *imp = NULL; - if (error = copyin(data, (caddr_t)&args, sizeof (struct iso_args))) + error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)); + if (error) return (error); if ((mp->mnt_flag & MNT_RDONLY) == 0) @@ -173,7 +172,7 @@ cd9660_mount(mp, path, data, ndp, p) * and verify that it refers to a sensible block device. */ NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p); - if (error = namei(ndp)) + if ((error = namei(ndp)) != 0) return (error); devvp = ndp->ni_vp; @@ -219,7 +218,7 @@ iso_mountfs(devvp, mp, p, argp) register struct iso_mnt *isomp = (struct iso_mnt *)0; struct buf *bp = NULL; dev_t dev = devvp->v_rdev; - int error = EINVAL, i, size; + int error = EINVAL; int needclose = 0; int ronly = (mp->mnt_flag & MNT_RDONLY) != 0; extern struct vnode *rootvp; @@ -239,14 +238,15 @@ iso_mountfs(devvp, mp, p, argp) * (except for root, which might share swap device for miniroot). * Flush out any old buffers remaining from a previous use. */ - if (error = vfs_mountedon(devvp)) + if ((error = vfs_mountedon(devvp)) != 0) return error; if (vcount(devvp) > 1 && devvp != rootvp) return EBUSY; - if (error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) + if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0) return (error); - if (error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); + if (error) return error; needclose = 1; @@ -257,8 +257,8 @@ iso_mountfs(devvp, mp, p, argp) iso_bsize = ISO_DEFAULT_BLOCK_SIZE; for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) { - if (error = bread(devvp, iso_blknum * btodb(iso_bsize), - iso_bsize, NOCRED, &bp)) + if ((error = bread(devvp, iso_blknum * btodb(iso_bsize), + iso_bsize, NOCRED, &bp)) != 0) goto out; vdp = (struct iso_volume_descriptor *)bp->b_data; @@ -324,10 +324,11 @@ iso_mountfs(devvp, mp, p, argp) /* Check the Rock Ridge Extention support */ if (!(argp->flags & ISOFSMNT_NORRIP)) { - if (error = bread(isomp->im_devvp, - (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << - (isomp->im_bshift - DEV_BSHIFT), - isomp->logical_block_size, NOCRED, &bp)) + if ((error = bread(isomp->im_devvp, + (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << + (isomp->im_bshift - DEV_BSHIFT), + isomp->logical_block_size, NOCRED, + &bp)) != 0) goto out; rootp = (struct iso_directory_record *)bp->b_data; @@ -405,7 +406,7 @@ cd9660_unmount(mp, mntflags, p) if (mntinvalbuf(mp)) return EBUSY; #endif - if (error = vflush(mp, NULLVP, flags)) + if ((error = vflush(mp, NULLVP, flags)) != 0) return (error); isomp = VFSTOISOFS(mp); @@ -442,7 +443,7 @@ cd9660_root(mp, vpp) * Simply tell vget, that it's a relocated directory. */ return (cd9660_vget_internal(mp, ino, vpp, - imp->iso_ftype == ISO_FTYPE_RRIP, dp)); + imp->iso_ftype == ISO_FTYPE_RRIP, dp)); } /* @@ -553,7 +554,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) if (np == NULL) return (EACCES); - if (error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) { + if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) { *vpp = NULLVP; return (error); } @@ -584,11 +585,11 @@ cd9660_vget(mp, ino, vpp) */ return (cd9660_vget_internal(mp, ino, vpp, #if 0 - VFSTOISOFS(mp)->iso_ftype == ISO_FTYPE_RRIP, + VFSTOISOFS(mp)->iso_ftype == ISO_FTYPE_RRIP, #else - 0, + 0, #endif - (struct iso_directory_entry *)0)); + NULL)); } int @@ -612,7 +613,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) return (0); /* Allocate a new vnode/iso_node. */ - if (error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) { + if ((error = getnewvnode(VT_ISOFS, mp, cd9660_vnodeop_p, &vp)) != 0) { *vpp = NULLVP; return (error); } @@ -698,7 +699,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) ip->iso_start = ino >> imp->im_bshift; if (bp != 0) brelse(bp); - if (error = VOP_BLKATOFF(vp, (off_t)0, NULL, &bp)) { + if ((error = VOP_BLKATOFF(vp, (off_t)0, NULL, &bp)) != 0) { vput(vp); return (error); } @@ -760,7 +761,7 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) ip->inode.iso_rdev = dp->d_dev; #endif vp->v_op = cd9660_specop_p; - if (nvp = checkalias(vp, ip->inode.iso_rdev, mp)) { + if ((nvp = checkalias(vp, ip->inode.iso_rdev, mp)) != NULL) { /* * Discard unneeded vnode, but save its iso_node. */ @@ -779,6 +780,13 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) cd9660_ihashins(ip); } break; + case VLNK: + case VNON: + case VSOCK: + case VDIR: + case VBAD: + case VREG: + break; } if (ip->iso_extent == imp->root_extent) diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 73297218f70..6044452856d 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: cd9660_vnops.c,v 1.26 1995/12/01 00:47:33 pk Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.3 1996/02/29 10:12:28 niklas Exp $ */ +/* $NetBSD: cd9660_vnops.c,v 1.29 1996/02/10 00:33:53 christos Exp $ */ /*- * Copyright (c) 1994 @@ -61,11 +62,32 @@ #include <isofs/cd9660/cd9660_node.h> #include <isofs/cd9660/iso_rrip.h> +/* + * 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; + u_long *cookies; + int ncookies; +}; + +int iso_uiodir __P((struct isoreaddir *, struct dirent *, off_t)); +int iso_shipdir __P((struct isoreaddir *)); + #if 0 /* * Mknod vnode call * Actually remap the device number */ +int cd9660_mknod(ndp, vap, cred, p) struct nameidata *ndp; struct ucred *cred; @@ -125,13 +147,8 @@ cd9660_mknod(ndp, vap, cred, p) */ /* ARGSUSED */ int -cd9660_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +cd9660_open(v) + void *v; { return (0); } @@ -143,13 +160,8 @@ cd9660_open(ap) */ /* ARGSUSED */ int -cd9660_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +cd9660_close(v) + void *v; { return (0); } @@ -159,16 +171,16 @@ cd9660_close(ap) * The mode is shifted to select the owner/group/other fields. The * super user is granted all permissions. */ -/* ARGSUSED */ int -cd9660_access(ap) +cd9660_access(v) + void *v; +{ struct vop_access_args /* { struct vnode *a_vp; int a_mode; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; struct iso_node *ip = VTOI(ap->a_vp); return (vaccess(ip->inode.iso_mode, ip->inode.iso_uid, @@ -176,15 +188,15 @@ cd9660_access(ap) } int -cd9660_getattr(ap) +cd9660_getattr(v) + void *v; +{ struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; struct proc *a_p; - } */ *ap; - -{ + } */ *ap = v; struct vnode *vp = ap->a_vp; register struct vattr *vap = ap->a_vap; register struct iso_node *ip = VTOI(vp); @@ -247,14 +259,15 @@ extern int doclusterread; * Vnode op for reading. */ int -cd9660_read(ap) +cd9660_read(v) + void *v; +{ struct vop_read_args /* { struct vnode *a_vp; struct uio *a_uio; int a_ioflag; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; struct vnode *vp = ap->a_vp; register struct uio *uio = ap->a_uio; register struct iso_node *ip = VTOI(vp); @@ -313,15 +326,8 @@ cd9660_read(ap) /* ARGSUSED */ int -cd9660_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +cd9660_ioctl(v) + void *v; { printf("You did ioctl for isofs !!\n"); return (ENOTTY); @@ -329,16 +335,9 @@ cd9660_ioctl(ap) /* ARGSUSED */ int -cd9660_select(ap) - struct vop_select_args /* { - struct vnode *a_vp; - int a_which; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +cd9660_select(v) + void *v; { - /* * We should really check to see if I/O is possible. */ @@ -352,13 +351,8 @@ cd9660_select(ap) */ /* ARGSUSED */ int -cd9660_mmap(ap) - struct vop_mmap_args /* { - struct vnode *a_vp; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +cd9660_mmap(v) + void *v; { return (EINVAL); @@ -371,34 +365,12 @@ cd9660_mmap(ap) */ /* ARGSUSED */ int -cd9660_seek(ap) - struct vop_seek_args /* { - struct vnode *a_vp; - off_t a_oldoff; - off_t a_newoff; - struct ucred *a_cred; - } */ *ap; +cd9660_seek(v) + void *v; { - return (0); } -/* - * 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; - u_long *cookies; - int ncookies; -}; int iso_uiodir(idp,dp,off) @@ -426,7 +398,7 @@ iso_uiodir(idp,dp,off) --idp->ncookies; } - if (error = uiomove(dp,dp->d_reclen,idp->uio)) + if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0) return (error); idp->uio_off = off; return (0); @@ -443,7 +415,8 @@ iso_shipdir(idp) cl = idp->current.d_namlen; cname = idp->current.d_name; - if (assoc = cl > 1 && *cname == ASSOCCHAR) { + + if ((assoc = (cl > 1)) && *cname == ASSOCCHAR) { cl--; cname++; } @@ -459,12 +432,16 @@ iso_shipdir(idp) if (sl != cl || bcmp(sname,cname,sl)) { if (idp->assocent.d_namlen) { - if (error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) + error = iso_uiodir(idp, &idp->assocent, + idp->assocoff); + if (error) return (error); idp->assocent.d_namlen = 0; } if (idp->saveent.d_namlen) { - if (error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) + error = iso_uiodir(idp, &idp->saveent, + idp->saveoff); + if (error) return (error); idp->saveent.d_namlen = 0; } @@ -485,7 +462,9 @@ iso_shipdir(idp) * Vnode op for readdir */ int -cd9660_readdir(ap) +cd9660_readdir(v) + void *v; +{ struct vop_readdir_args /* { struct vnode *a_vp; struct uio *a_uio; @@ -493,8 +472,7 @@ cd9660_readdir(ap) int *a_eofflag; u_long *a_cookies; int a_ncookies; - } */ *ap; -{ + } */ *ap = v; register struct uio *uio = ap->a_uio; struct isoreaddir *idp; struct vnode *vdp = ap->a_vp; @@ -543,8 +521,9 @@ cd9660_readdir(ap) if ((idp->curroff & bmask) == 0) { if (bp != NULL) brelse(bp); - if (error = - VOP_BLKATOFF(vdp, (off_t)idp->curroff, NULL, &bp)) + error = VOP_BLKATOFF(vdp, (off_t)idp->curroff, + NULL, &bp); + if (error) break; entryoffsetinblock = 0; } @@ -656,13 +635,14 @@ typedef struct iso_directory_record ISODIR; typedef struct iso_node ISONODE; typedef struct iso_mnt ISOMNT; int -cd9660_readlink(ap) +cd9660_readlink(v) + void *v; +{ struct vop_readlink_args /* { struct vnode *a_vp; struct uio *a_uio; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; ISONODE *ip; ISODIR *dirp; ISOMNT *imp; @@ -743,17 +723,50 @@ cd9660_readlink(ap) return (0); } +int +cd9660_link(v) + void *v; +{ + struct vop_link_args /* { + struct vnode *a_dvp; + struct vnode *a_vp; + struct componentname *a_cnp; + } */ *ap = v; + + VOP_ABORTOP(ap->a_dvp, ap->a_cnp); + vput(ap->a_dvp); + return (EROFS); +} + +int +cd9660_symlink(v) + 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; + } */ *ap = v; + + VOP_ABORTOP(ap->a_dvp, ap->a_cnp); + vput(ap->a_dvp); + return (EROFS); +} + /* * Ufs abort op, called after namei() when a CREATE/DELETE isn't actually * done. If a buffer has been saved in anticipation of a CREATE, delete it. */ int -cd9660_abortop(ap) +cd9660_abortop(v) + void *v; +{ struct vop_abortop_args /* { struct vnode *a_dvp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) FREE(ap->a_cnp->cn_pnbuf, M_NAMEI); return (0); @@ -763,14 +776,17 @@ cd9660_abortop(ap) * Lock an inode. */ int -cd9660_lock(ap) +cd9660_lock(v) + void *v; +{ struct vop_lock_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct iso_node *ip; +#ifdef DIAGNOSTIC struct proc *p = curproc; /* XXX */ +#endif start: while (vp->v_flag & VXLOCK) { @@ -812,15 +828,17 @@ start: * Unlock an inode. */ int -cd9660_unlock(ap) +cd9660_unlock(v) + void *v; +{ struct vop_unlock_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct iso_node *ip = VTOI(ap->a_vp); - struct proc *p = curproc; /* XXX */ #ifdef DIAGNOSTIC + struct proc *p = curproc; /* XXX */ + if ((ip->i_flag & IN_LOCKED) == 0) { vprint("ufs_unlock: unlocked inode", ap->a_vp); panic("ufs_unlock NOT LOCKED"); @@ -844,11 +862,12 @@ cd9660_unlock(ap) * then call the device strategy routine. */ int -cd9660_strategy(ap) +cd9660_strategy(v) + void *v; +{ struct vop_strategy_args /* { struct buf *a_bp; - } */ *ap; -{ + } */ *ap = v; register struct buf *bp = ap->a_bp; register struct vnode *vp = bp->b_vp; register struct iso_node *ip; @@ -858,8 +877,8 @@ cd9660_strategy(ap) if (vp->v_type == VBLK || vp->v_type == VCHR) panic("cd9660_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { - if (error = - VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL)) { + error = VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL); + if (error) { bp->b_error = error; bp->b_flags |= B_ERROR; biodone(bp); @@ -881,13 +900,11 @@ cd9660_strategy(ap) /* * Print out the contents of an inode. */ +/*ARGSUSED*/ int -cd9660_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; +cd9660_print(v) + void *v; { - printf("tag VT_ISOFS, isofs vnode\n"); return (0); } @@ -896,11 +913,12 @@ cd9660_print(ap) * Check for a locked inode. */ int -cd9660_islocked(ap) +cd9660_islocked(v) + void *v; +{ struct vop_islocked_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; if (VTOI(ap->a_vp)->i_flag & IN_LOCKED) return (1); @@ -911,14 +929,14 @@ cd9660_islocked(ap) * Return POSIX pathconf information applicable to cd9660 filesystems. */ int -cd9660_pathconf(ap) +cd9660_pathconf(v) + void *v; +{ struct vop_pathconf_args /* { struct vnode *a_vp; int a_name; register_t *a_retval; - } */ *ap; -{ - + } */ *ap = v; switch (ap->a_name) { case _PC_LINK_MAX: *ap->a_retval = 1; @@ -950,8 +968,10 @@ cd9660_pathconf(ap) /* * Unsupported operation */ +/*ARGSUSED*/ int -cd9660_enotsupp() +cd9660_enotsupp(v) + void *v; { return (EOPNOTSUPP); @@ -960,47 +980,32 @@ cd9660_enotsupp() /* * Global vfs data structures for isofs */ -#define cd9660_create \ - ((int (*) __P((struct vop_create_args *)))cd9660_enotsupp) -#define cd9660_mknod ((int (*) __P((struct vop_mknod_args *)))cd9660_enotsupp) -#define cd9660_setattr \ - ((int (*) __P((struct vop_setattr_args *)))cd9660_enotsupp) -#define cd9660_write ((int (*) __P((struct vop_write_args *)))cd9660_enotsupp) -#ifdef NFSSERVER -int lease_check __P((struct vop_lease_args *)); -#define cd9660_lease_check lease_check +#define cd9660_create cd9660_enotsupp +#define cd9660_mknod cd9660_enotsupp +#define cd9660_setattr cd9660_enotsupp +#define cd9660_write cd9660_enotsupp +#ifdef NFSSERVER +int lease_check __P((void *)); +#define cd9660_lease_check lease_check #else -#define cd9660_lease_check ((int (*) __P((struct vop_lease_args *)))nullop) +#define cd9660_lease_check nullop #endif -#define cd9660_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) -#define cd9660_remove \ - ((int (*) __P((struct vop_remove_args *)))cd9660_enotsupp) -#define cd9660_link ((int (*) __P((struct vop_link_args *)))cd9660_enotsupp) -#define cd9660_rename \ - ((int (*) __P((struct vop_rename_args *)))cd9660_enotsupp) -#define cd9660_mkdir ((int (*) __P((struct vop_mkdir_args *)))cd9660_enotsupp) -#define cd9660_rmdir ((int (*) __P((struct vop_rmdir_args *)))cd9660_enotsupp) -#define cd9660_symlink \ - ((int (*) __P((struct vop_symlink_args *)))cd9660_enotsupp) -#define cd9660_advlock \ - ((int (*) __P((struct vop_advlock_args *)))cd9660_enotsupp) -#define cd9660_valloc ((int(*) __P(( \ - struct vnode *pvp, \ - int mode, \ - struct ucred *cred, \ - struct vnode **vpp))) cd9660_enotsupp) -#define cd9660_vfree ((int (*) __P((struct vop_vfree_args *)))cd9660_enotsupp) -#define cd9660_truncate \ - ((int (*) __P((struct vop_truncate_args *)))cd9660_enotsupp) -#define cd9660_update \ - ((int (*) __P((struct vop_update_args *)))cd9660_enotsupp) -#define cd9660_bwrite \ - ((int (*) __P((struct vop_bwrite_args *)))cd9660_enotsupp) +#define cd9660_fsync nullop +#define cd9660_remove cd9660_enotsupp +#define cd9660_rename cd9660_enotsupp +#define cd9660_mkdir cd9660_enotsupp +#define cd9660_rmdir cd9660_enotsupp +#define cd9660_advlock cd9660_enotsupp +#define cd9660_valloc cd9660_enotsupp +#define cd9660_vfree cd9660_enotsupp +#define cd9660_truncate cd9660_enotsupp +#define cd9660_update cd9660_enotsupp +#define cd9660_bwrite cd9660_enotsupp /* * Global vfs data structures for cd9660 */ -int (**cd9660_vnodeop_p)(); +int (**cd9660_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, cd9660_lookup }, /* lookup */ @@ -1044,7 +1049,7 @@ struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_truncate_desc, cd9660_truncate },/* truncate */ { &vop_update_desc, cd9660_update }, /* update */ { &vop_bwrite_desc, vn_bwrite }, - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc cd9660_vnodeop_opv_desc = { &cd9660_vnodeop_p, cd9660_vnodeop_entries }; @@ -1052,7 +1057,7 @@ struct vnodeopv_desc cd9660_vnodeop_opv_desc = /* * Special device vnode ops */ -int (**cd9660_specop_p)(); +int (**cd9660_specop_p) __P((void *)); struct vnodeopv_entry_desc cd9660_specop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, spec_lookup }, /* lookup */ @@ -1096,13 +1101,13 @@ struct vnodeopv_entry_desc cd9660_specop_entries[] = { { &vop_truncate_desc, spec_truncate }, /* truncate */ { &vop_update_desc, cd9660_update }, /* update */ { &vop_bwrite_desc, vn_bwrite }, - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc cd9660_specop_opv_desc = { &cd9660_specop_p, cd9660_specop_entries }; #ifdef FIFO -int (**cd9660_fifoop_p)(); +int (**cd9660_fifoop_p) __P((void *)); struct vnodeopv_entry_desc cd9660_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ @@ -1146,7 +1151,7 @@ struct vnodeopv_entry_desc cd9660_fifoop_entries[] = { { &vop_truncate_desc, fifo_truncate }, /* truncate */ { &vop_update_desc, cd9660_update }, /* update */ { &vop_bwrite_desc, vn_bwrite }, - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc cd9660_fifoop_opv_desc = { &cd9660_fifoop_p, cd9660_fifoop_entries }; diff --git a/sys/isofs/cd9660/iso.h b/sys/isofs/cd9660/iso.h index 526a0428846..783a0527148 100644 --- a/sys/isofs/cd9660/iso.h +++ b/sys/isofs/cd9660/iso.h @@ -1,4 +1,5 @@ -/* $NetBSD: iso.h,v 1.9 1995/01/18 09:23:19 mycroft Exp $ */ +/* $OpenBSD: iso.h,v 1.2 1996/02/29 10:12:30 niklas Exp $ */ +/* $NetBSD: iso.h,v 1.10 1996/02/09 21:32:11 christos Exp $ */ /*- * Copyright (c) 1994 @@ -178,26 +179,34 @@ int cd9660_vget __P((struct mount *, ino_t, struct vnode **)); int cd9660_fhtovp __P((struct mount *, struct fid *, struct mbuf *, struct vnode **, int *, struct ucred **)); int cd9660_vptofh __P((struct vnode *, struct fid *)); -int cd9660_init __P(()); +void cd9660_init __P((void)); int cd9660_mountroot __P((void)); -extern int (**cd9660_vnodeop_p)(); -extern int (**cd9660_specop_p)(); +extern int (**cd9660_vnodeop_p) __P((void *)); +extern int (**cd9660_specop_p) __P((void *)); #ifdef FIFO -extern int (**cd9660_fifoop_p)(); +extern int (**cd9660_fifoop_p) __P((void *)); #endif static __inline int +#if __STDC__ +isonum_711(u_char *p) +#else isonum_711(p) u_char *p; +#endif { return *p; } static __inline int +#if __STDC__ +isonum_712(char *p) +#else isonum_712(p) char *p; +#endif { return *p; } @@ -205,15 +214,23 @@ isonum_712(p) #ifndef UNALIGNED_ACCESS static __inline int +#if __STDC__ +isonum_723(u_char *p) +#else isonum_723(p) u_char *p; +#endif { return *p|(p[1] << 8); } static __inline int +#if __STDC__ +isonum_733(u_char *p) +#else isonum_733(p) u_char *p; +#endif { return *p|(p[1] << 8)|(p[2] << 16)|(p[3] << 24); } @@ -223,15 +240,23 @@ isonum_733(p) #if BYTE_ORDER == LITTLE_ENDIAN static __inline int +#if __STDC__ +isonum_723(u_char *p) +#else isonum_723(p) u_char *p +#endif { return *(u_int16t *)p; } static __inline int +#if __STDC__ +isonum_733(u_char *p) +#else isonum_733(p) u_char *p; +#endif { return *(u_int32t *)p; } @@ -241,15 +266,23 @@ isonum_733(p) #if BYTE_ORDER == BIG_ENDIAN static __inline int +#if __STDC__ +isonum_723(u_char *p) +#else isonum_723(p) u_char *p +#endif { return *(u_int16t *)(p + 2); } static __inline int +#if __STDC__ +isonum_733(u_char *p) +#else isonum_733(p) u_char *p; +#endif { return *(u_int32t *)(p + 4); } |