aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/cd9660
diff options
context:
space:
mode:
authorGary Palmer <gpalmer@FreeBSD.org>1994-09-26 00:32:59 +0000
committerGary Palmer <gpalmer@FreeBSD.org>1994-09-26 00:32:59 +0000
commit1295d82e6c5298aed8ac9ca8b820b7f96622ea59 (patch)
treee141aa67b37cc294a671e531124c74da9ad5f7aa /sys/fs/cd9660
parent8c0390626ee6de0163b03938c3ee0c7070b0ab67 (diff)
downloadsrc-1295d82e6c5298aed8ac9ca8b820b7f96622ea59.tar.gz
src-1295d82e6c5298aed8ac9ca8b820b7f96622ea59.zip
Alterations to silence gcc -Wall. Some unused variables deleted.
Reviewed by: davidg
Notes
Notes: svn path=/head/; revision=3106
Diffstat (limited to 'sys/fs/cd9660')
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c23
-rw-r--r--sys/fs/cd9660/cd9660_node.c18
-rw-r--r--sys/fs/cd9660/cd9660_rrip.c3
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c40
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c23
5 files changed, 49 insertions, 58 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index f529a0d39e6c..800a9da8be3e 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -38,7 +38,7 @@
* from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
*
* @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_lookup.c,v 1.3 1994/08/02 07:41:17 davidg Exp $
+ * $Id: cd9660_lookup.c,v 1.4 1994/09/15 19:45:58 bde Exp $
*/
#include <sys/param.h>
@@ -139,7 +139,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)))
return (error);
/*
@@ -149,7 +149,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))) {
int vpid; /* capability number of vnode */
if (error == ENOENT)
@@ -202,7 +202,8 @@ cd9660_lookup(ap)
/*
* A leading `=' means, we are looking for an associated file
*/
- if (assoc = (imp->iso_ftype != ISO_FTYPE_RRIP && *name == ASSOCCHAR)) {
+ if ((assoc = (imp->iso_ftype != ISO_FTYPE_RRIP && *name == ASSOCCHAR)))
+ {
len--;
name++;
}
@@ -227,7 +228,7 @@ cd9660_lookup(ap)
dp->i_offset = dp->i_diroff;
entryoffsetinblock = iso_blkoff(imp, dp->i_offset);
if (entryoffsetinblock != 0) {
- if (error = iso_blkatoff(dp, dp->i_offset, &bp))
+ if ((error = iso_blkatoff(dp, dp->i_offset, &bp)))
return (error);
}
numdirpasses = 2;
@@ -245,7 +246,7 @@ searchloop:
if (iso_blkoff(imp, dp->i_offset) == 0) {
if (bp != NULL)
brelse(bp);
- if (error = iso_blkatoff(dp, dp->i_offset, &bp))
+ if ((error = iso_blkatoff(dp, dp->i_offset, &bp)))
return (error);
entryoffsetinblock = 0;
}
@@ -341,7 +342,7 @@ foundino:
!= iso_lblkno(imp,saveoffset)) {
if (bp != NULL)
brelse(bp);
- if (error = iso_blkatoff(dp, saveoffset, &bp))
+ if ((error = iso_blkatoff(dp, saveoffset, &bp)))
return (error);
}
ep = (struct iso_directory_record *)(bp->b_un.b_addr
@@ -412,9 +413,9 @@ found:
*/
if (flags & ISDOTDOT) {
ISO_IUNLOCK(pdp); /* race to get the inode */
- if (error = iso_iget(dp,dp->i_ino,
+ if ((error = iso_iget(dp,dp->i_ino,
dp->i_ino != ino,
- &tdp,ep)) {
+ &tdp,ep))) {
ISO_ILOCK(pdp);
return (error);
}
@@ -425,7 +426,7 @@ found:
VREF(vdp); /* we want ourself, ie "." */
*vpp = vdp;
} else {
- if (error = iso_iget(dp,dp->i_ino,dp->i_ino!=ino,&tdp,ep))
+ if ((error = iso_iget(dp,dp->i_ino,dp->i_ino!=ino,&tdp,ep)))
return (error);
if (!lockparent || !(flags & ISLASTCN))
ISO_IUNLOCK(pdp);
@@ -458,7 +459,7 @@ iso_blkatoff(ip, offset, bpp)
struct buf *bp;
int error;
- if (error = bread(ITOV(ip),lbn,bsize,NOCRED,&bp)) {
+ if ((error = bread(ITOV(ip),lbn,bsize,NOCRED,&bp))) {
brelse(bp);
*bpp = 0;
return (error);
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index aa6cd748b5b7..770fa7ef3cab 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_node.c,v 1.4 1994/09/15 19:45:59 bde Exp $
+ * $Id: cd9660_node.c,v 1.5 1994/09/22 19:37:43 wollman Exp $
*/
#include <sys/param.h>
@@ -178,14 +178,14 @@ iso_iget(xp, ino, relocated, ipp, isodir)
struct mount *mntp = ITOV(xp)->v_mount;
register struct iso_node *ip, *iq;
register struct vnode *vp;
+#ifdef ISODEVMAP
register struct iso_dnode *dp;
+#endif
struct vnode *nvp;
struct buf *bp = NULL, *bp2 = NULL;
union iso_ihead *ih;
- union iso_dhead *dh;
- int i, error, result;
+ int error, result;
struct iso_mnt *imp;
- ino_t defino;
ih = &iso_ihead[INOHASH(dev, ino)];
loop:
@@ -207,7 +207,7 @@ loop:
/*
* Allocate a new vnode/iso_node.
*/
- if (error = getnewvnode(VT_ISOFS, mntp, cd9660_vnodeop_p, &nvp)) {
+ if ((error = getnewvnode(VT_ISOFS, mntp, cd9660_vnodeop_p, &nvp))) {
*ipp = 0;
return error;
}
@@ -243,7 +243,7 @@ loop:
* read the `.' entry out of a dir.
*/
ip->iso_start = ino >> imp->im_bshift;
- if (error = iso_blkatoff(ip,0,&bp)) {
+ if ((error = iso_blkatoff(ip,0,&bp))) {
vrele(ip->i_devvp);
remque(ip);
ip->i_forw = ip;
@@ -302,7 +302,7 @@ loop:
ip->inode.iso_rdev = dp->d_dev;
#endif
vp->v_op = cd9660_specop_p;
- if (nvp = checkalias(vp, ip->inode.iso_rdev, mntp)) {
+ if ((nvp = checkalias(vp, ip->inode.iso_rdev, mntp))) {
/*
* Reinitialize aliased inode.
*/
@@ -361,7 +361,7 @@ cd9660_inactive(ap)
{
struct vnode *vp = ap->a_vp;
register struct iso_node *ip = VTOI(vp);
- int mode, error = 0;
+ int error = 0;
if (prtactive && vp->v_usecount != 0)
vprint("cd9660_inactive: pushing active", vp);
@@ -387,7 +387,6 @@ cd9660_reclaim(ap)
{
register struct vnode *vp = ap->a_vp;
register struct iso_node *ip = VTOI(vp);
- int i;
if (prtactive && vp->v_usecount != 0)
vprint("cd9660_reclaim: pushing active", vp);
@@ -558,7 +557,6 @@ cd9660_tstamp_conv7(pi,pu)
char *pi;
struct timespec *pu;
{
- int i;
int crtime, days;
int y, m, d, hour, minute, second, tz;
diff --git a/sys/fs/cd9660/cd9660_rrip.c b/sys/fs/cd9660/cd9660_rrip.c
index 4ba2fa636ee4..2659b0dc8dee 100644
--- a/sys/fs/cd9660/cd9660_rrip.c
+++ b/sys/fs/cd9660/cd9660_rrip.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_rrip.c,v 1.3 1994/09/09 11:10:58 dfr Exp $
+ * $Id: cd9660_rrip.c,v 1.4 1994/09/15 19:46:01 bde Exp $
*/
#include <sys/param.h>
@@ -471,7 +471,6 @@ cd9660_rrip_loop(isodir,ana,table)
register ISO_SUSP_HEADER *phead;
register ISO_SUSP_HEADER *pend;
struct buf *bp = NULL;
- int i;
char *pwhead;
int result;
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 48037cbe5c42..cc1b752a1979 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vfsops.c 8.3 (Berkeley) 1/31/94
- * $Id: cd9660_vfsops.c,v 1.6 1994/09/15 19:46:02 bde Exp $
+ * $Id: cd9660_vfsops.c,v 1.7 1994/09/21 03:46:34 wollman Exp $
*/
#include <sys/param.h>
@@ -90,7 +90,6 @@ cd9660_mountroot()
register struct mount *mp;
struct proc *p = curproc; /* XXX */
struct iso_mnt *imp;
- register struct fs *fs;
u_int size;
int error;
struct iso_args args;
@@ -106,11 +105,11 @@ cd9660_mountroot()
mp->mnt_op = &cd9660_vfsops;
mp->mnt_flag = MNT_RDONLY;
args.flags = ISOFSMNT_ROOT;
- if (error = iso_mountfs(rootvp, mp, p, &args)) {
+ if ((error = iso_mountfs(rootvp, mp, p, &args))) {
free(mp, M_MOUNT);
return (error);
}
- if (error = vfs_lock(mp)) {
+ if ((error = vfs_lock(mp))) {
(void)cd9660_unmount(mp, 0, p);
free(mp, M_MOUNT);
return (error);
@@ -155,7 +154,7 @@ cd9660_mount(mp, path, data, ndp, p)
int error;
struct iso_mnt *imp = 0;
- if (error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)))
+ if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args))))
return (error);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
@@ -175,7 +174,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)))
return (error);
devvp = ndp->ni_vp;
@@ -224,12 +223,9 @@ 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;
- caddr_t base, space;
- int havepart = 0, blks;
- int error = EINVAL, i, size;
+ int error = EINVAL;
int needclose = 0;
int ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
- int j;
int iso_bsize;
int iso_blknum;
struct iso_volume_descriptor *vdp;
@@ -246,14 +242,14 @@ 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)))
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)))
return (error);
- if (error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p))
+ if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)))
return error;
needclose = 1;
@@ -264,8 +260,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, btodb(iso_blknum * iso_bsize),
- iso_bsize, NOCRED, &bp))
+ if ((error = bread (devvp, btodb(iso_blknum * iso_bsize),
+ iso_bsize, NOCRED, &bp)))
goto out;
vdp = (struct iso_volume_descriptor *)bp->b_un.b_addr;
@@ -331,10 +327,10 @@ iso_mountfs(devvp, mp, p, argp)
/* Check the Rock Ridge Extention support */
if (!(argp->flags & ISOFSMNT_NORRIP)) {
- if (error = bread (isomp->im_devvp,
+ if ((error = bread (isomp->im_devvp,
(isomp->root_extent + isonum_711(rootp->ext_attr_length))
* isomp->logical_block_size / DEV_BSIZE,
- isomp->logical_block_size,NOCRED,&bp))
+ isomp->logical_block_size,NOCRED,&bp)))
goto out;
rootp = (struct iso_directory_record *)bp->b_un.b_addr;
@@ -403,7 +399,7 @@ cd9660_unmount(mp, mntflags, p)
struct proc *p;
{
register struct iso_mnt *isomp;
- int i, error, ronly, flags = 0;
+ int error, flags = 0;
if (mntflags & MNT_FORCE) {
if (!iso_doforce)
@@ -415,7 +411,7 @@ cd9660_unmount(mp, mntflags, p)
if (mntinvalbuf(mp))
return EBUSY;
#endif
- if (error = vflush(mp, NULLVP, flags))
+ if ((error = vflush(mp, NULLVP, flags)))
return (error);
isomp = VFSTOISOFS(mp);
@@ -497,7 +493,6 @@ cd9660_statfs(mp, sbp, p)
struct proc *p;
{
register struct iso_mnt *isomp;
- register struct fs *fs;
isomp = VFSTOISOFS(mp);
@@ -628,7 +623,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
if (isonum_733(dirp->extent) + isonum_711(dirp->ext_attr_length) !=
ifhp->ifid_start) {
brelse(bp);
- printf("fhtovp: file start miss %d vs %d\n",
+ printf("fhtovp: file start miss %d vs %ld\n",
isonum_733(dirp->extent)+isonum_711(dirp->ext_attr_length),
ifhp->ifid_start);
return (ESTALE);
@@ -640,7 +635,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
tvp.v_data = ip;
ip->i_vnode = &tvp;
ip->i_dev = imp->im_dev;
- if (error = iso_iget(ip, ifhp->ifid_ino, 0, &nip, dirp)) {
+ if ((error = iso_iget(ip, ifhp->ifid_ino, 0, &nip, dirp))) {
*vpp = NULLVP;
printf("fhtovp: failed to get inode\n");
return (error);
@@ -672,7 +667,6 @@ cd9660_vptofh(vp, fhp)
{
register struct iso_node *ip = VTOI(vp);
register struct ifid *ifhp;
- register struct iso_mnt *mp = ip->i_mnt;
ifhp = (struct ifid *)fhp;
ifhp->ifid_len = sizeof(struct ifid);
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 9ca3ed5effd6..eaac2a872aba 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94
- * $Id: cd9660_vnops.c,v 1.7 1994/09/21 03:46:35 wollman Exp $
+ * $Id: cd9660_vnops.c,v 1.8 1994/09/22 19:37:46 wollman Exp $
*/
#include <sys/param.h>
@@ -183,7 +183,6 @@ cd9660_getattr(ap)
struct vnode *vp = ap->a_vp;
register struct vattr *vap = ap->a_vap;
register struct iso_node *ip = VTOI(vp);
- int i;
vap->va_fsid = ip->i_dev;
vap->va_fileid = ip->i_number;
@@ -234,7 +233,7 @@ cd9660_read(ap)
register struct iso_node *ip = VTOI(vp);
register struct iso_mnt *imp;
struct buf *bp;
- daddr_t lbn, bn, rablock;
+ daddr_t lbn, rablock;
off_t diff;
int rasize, error = 0;
long size, n, on;
@@ -400,7 +399,7 @@ iso_uiodir(idp,dp,off)
--idp->ncookies;
}
- if (error = uiomove((caddr_t)dp,dp->d_reclen,idp->uio))
+ if ((error = uiomove((caddr_t)dp,dp->d_reclen,idp->uio)))
return error;
idp->uio_off = off;
return 0;
@@ -417,7 +416,8 @@ iso_shipdir(idp)
cl = idp->current.d_namlen;
cname = idp->current.d_name;
- if (assoc = cl > 1 && *cname == ASSOCCHAR) {
+assoc = (cl > 1) && (*cname == ASSOCCHAR);
+ if (assoc) {
cl--;
cname++;
}
@@ -433,12 +433,12 @@ iso_shipdir(idp)
if (sl != cl
|| bcmp(sname,cname,sl)) {
if (idp->assocent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->assocent,idp->assocoff))
+ if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)))
return error;
idp->assocent.d_namlen = 0;
}
if (idp->saveent.d_namlen) {
- if (error = iso_uiodir(idp,&idp->saveent,idp->saveoff))
+ if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)))
return error;
idp->saveent.d_namlen = 0;
}
@@ -499,7 +499,7 @@ cd9660_readdir(ap)
entryoffsetinblock = iso_blkoff(imp, idp->curroff);
if (entryoffsetinblock != 0) {
- if (error = iso_blkatoff(ip, idp->curroff, &bp)) {
+ if ((error = iso_blkatoff(ip, idp->curroff, &bp))) {
FREE(idp,M_TEMP);
return (error);
}
@@ -517,7 +517,7 @@ cd9660_readdir(ap)
if (iso_blkoff(imp, idp->curroff) == 0) {
if (bp != NULL)
brelse(bp);
- if (error = iso_blkatoff(ip, idp->curroff, &bp))
+ if ((error = iso_blkatoff(ip, idp->curroff, &bp)))
break;
entryoffsetinblock = 0;
}
@@ -648,7 +648,6 @@ cd9660_readlink(ap)
u_short symlen;
int error;
char *symname;
- ino_t ino;
ip = VTOI(ap->a_vp);
imp = ip->i_mnt;
@@ -806,8 +805,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)) {
+ if ((error =
+ VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL))) {
bp->b_error = error;
bp->b_flags |= B_ERROR;
biodone(bp);