diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-10-18 15:23:41 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-10-18 15:23:41 +0000 |
commit | 94d5321dca831b80b9a3f90afc1426281cbee8a8 (patch) | |
tree | f717ebbe993cae5ea89a164c57bad3d687bf56ae /sys | |
parent | 4ae76d3c60590917a334bf1444ce9daadbd69947 (diff) |
-Wall happieness
Diffstat (limited to 'sys')
-rw-r--r-- | sys/gnu/ext2fs/ext2_alloc.c | 12 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_balloc.c | 22 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_bitops.c | 10 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode.c | 32 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_linux_balloc.c | 12 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_linux_ialloc.c | 9 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_lookup.c | 45 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_subr.c | 4 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 21 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 4 |
10 files changed, 99 insertions, 72 deletions
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c index c4fee2162d1..86072673572 100644 --- a/sys/gnu/ext2fs/ext2_alloc.c +++ b/sys/gnu/ext2fs/ext2_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_alloc.c,v 1.3 1996/07/15 03:39:27 downsj Exp $ */ +/* $OpenBSD: ext2_alloc.c,v 1.4 1996/10/18 15:23:34 mickey Exp $ */ /* * modified for Lites 1.1 @@ -130,7 +130,7 @@ ext2_alloc(ip, lbn, bpref, size, cred, bnp) fs->s_es->s_free_blocks_count < fs->s_es->s_r_blocks_count) goto nospace; #if QUOTA - if (error = chkdq(ip, (long)btodb(size), cred, 0)) + if ((error = chkdq(ip, (long)btodb(size), cred, 0)) != 0) return (error); #endif if (bpref >= fs->s_es->s_blocks_count) @@ -219,14 +219,14 @@ int ext2_reallocblks(v) void *v; { - struct vop_reallocblks_args /* { - struct vnode *a_vp; - struct cluster_save *a_buflist; - } */ *ap = v; #ifndef FANCY_REALLOC /* printf("ext2_reallocblks not implemented\n"); */ return ENOSPC; #else + struct vop_reallocblks_args /* { + struct vnode *a_vp; + struct cluster_save *a_buflist; + } */ *ap = v; struct ext2_sb_info *fs; struct inode *ip; diff --git a/sys/gnu/ext2fs/ext2_balloc.c b/sys/gnu/ext2fs/ext2_balloc.c index 50654bfe210..bbda94e5af1 100644 --- a/sys/gnu/ext2fs/ext2_balloc.c +++ b/sys/gnu/ext2fs/ext2_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_balloc.c,v 1.3 1996/07/15 03:39:28 downsj Exp $ */ +/* $OpenBSD: ext2_balloc.c,v 1.4 1996/10/18 15:23:35 mickey Exp $ */ /* * modified for Lites 1.1 @@ -164,7 +164,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", * Determine the number of levels of indirection. */ pref = 0; - if (error = ufs_getlbns(vp, bn, indirs, &num)) + if ((error = ufs_getlbns(vp, bn, indirs, &num)) != 0) return(error); #if DIAGNOSTIC if (num < 1) @@ -193,8 +193,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); #endif - if (error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, - cred, &newb)) + if ((error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, + cred, &newb)) != 0) return (error); nb = newb; bp = getblk(vp, indirs[1].in_lbn, fs->s_blocksize, 0, 0); @@ -204,7 +204,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", * Write synchronously so that indirect blocks * never point at garbage. */ - if (error = bwrite(bp)) { + if ((error = bwrite(bp)) != 0) { ext2_blkfree(ip, nb, fs->s_blocksize); return (error); } @@ -243,8 +243,9 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", #else pref = ext2_blkpref(ip, lbn, 0, (daddr_t *)0, 0); #endif - if (error = - ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) { + error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, + cred, &newb); + if (error != 0) { brelse(bp); return (error); } @@ -256,7 +257,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", * Write synchronously so that indirect blocks * never point at garbage. */ - if (error = bwrite(nbp)) { + if ((error = bwrite(nbp)) != 0) { ext2_blkfree(ip, nb, fs->s_blocksize); brelse(bp); return (error); @@ -278,8 +279,9 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n", if (nb == 0) { pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], bp->b_lblkno); - if (error = ext2_alloc(ip, - lbn, pref, (int)fs->s_blocksize, cred, &newb)) { + error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, + cred, &newb); + if (error != 0) { brelse(bp); return (error); } diff --git a/sys/gnu/ext2fs/ext2_bitops.c b/sys/gnu/ext2fs/ext2_bitops.c index af7a73f8dcb..8535572eebb 100644 --- a/sys/gnu/ext2fs/ext2_bitops.c +++ b/sys/gnu/ext2fs/ext2_bitops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_bitops.c,v 1.1 1996/07/13 21:21:15 downsj Exp $ */ +/* $OpenBSD: ext2_bitops.c,v 1.2 1996/10/18 15:23:35 mickey Exp $ */ /* * bitops.c --- Bitmap frobbing code. See bitops.h for the inlined @@ -18,6 +18,14 @@ #define INLINE #endif +static INLINE int ext2fs_set_bit __P((int nr, void *addr)); +static INLINE int ext2fs_clear_bit __P((int nr, void *addr)); +static INLINE int ext2fs_change_bit __P((int nr, void *addr)); +static INLINE int ext2fs_test_bit __P((int nr, const void *addr)); +static INLINE int ext2fs_ffzb __P((void *addr, unsigned size)); +static INLINE int ext2fs_fnzb __P((void *addr, int size, int offset)); +static INLINE void *ext2fs_memscan __P((void *addr, int c, size_t size)); + #ifdef alpha /* diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c index 3325170c123..52c6eec3e7f 100644 --- a/sys/gnu/ext2fs/ext2_inode.c +++ b/sys/gnu/ext2fs/ext2_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_inode.c,v 1.3 1996/07/15 03:39:28 downsj Exp $ */ +/* $OpenBSD: ext2_inode.c,v 1.4 1996/10/18 15:23:36 mickey Exp $ */ /* * modified for Lites 1.1 @@ -123,9 +123,9 @@ ext2_update(v) } ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE); fs = ip->i_e2fs; - if (error = bread(ip->i_devvp, - fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp)) { + error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->s_blocksize, NOCRED, &bp); + if (error != 0) { brelse(bp); return (error); } @@ -198,7 +198,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, ap->a_length); return (VOP_UPDATE(ovp, &ts, &ts, 0)); } #if QUOTA - if (error = getinoquota(oip)) + if ((error = getinoquota(oip)) != 0) return (error); #endif vnode_pager_setsize(ovp, (u_long)length); @@ -216,8 +216,9 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, ap->a_length); aflags = B_CLRBUF; if (ap->a_flags & IO_SYNC) aflags |= B_SYNC; - if (error = ext2_balloc(oip, lbn, offset + 1, ap->a_cred, &bp, - aflags)) + error = ext2_balloc(oip, lbn, offset + 1, ap->a_cred, + &bp, aflags); + if (error != 0) return (error); oip->i_size = length; (void) vnode_pager_uncache(ovp); @@ -244,8 +245,9 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, ap->a_length); aflags = B_CLRBUF; if (ap->a_flags & IO_SYNC) aflags |= B_SYNC; - if (error = ext2_balloc(oip, lbn, offset, ap->a_cred, &bp, - aflags)) + error = ext2_balloc(oip, lbn, offset, ap->a_cred, + &bp, aflags); + if (error != 0) return (error); oip->i_size = length; size = blksize(fs, oip, lbn); @@ -283,7 +285,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, ap->a_length); for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - if (error = VOP_UPDATE(ovp, &ts, &ts, MNT_WAIT)) + if ((error = VOP_UPDATE(ovp, &ts, &ts, MNT_WAIT)) != 0) allerror = error; /* * Having written the new inode to disk, save its new configuration @@ -482,8 +484,9 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp) if (nb == 0) continue; if (level > SINGLE) { - if (error = ext2_indirtrunc(ip, nlbn, - fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount)) + error = ext2_indirtrunc(ip, nlbn, + fsbtodb(fs, nb), (daddr_t)-1, level - 1, &blkcount); + if (error != 0) allerror = error; blocksreleased += blkcount; } @@ -498,8 +501,9 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp) last = lastbn % factor; nb = bap[i]; if (nb != 0) { - if (error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb), - last, level - 1, &blkcount)) + error = ext2_indirtrunc(ip, nlbn, fsbtodb(fs, nb), + last, level - 1, &blkcount); + if (error != 0) allerror = error; blocksreleased += blkcount; } diff --git a/sys/gnu/ext2fs/ext2_linux_balloc.c b/sys/gnu/ext2fs/ext2_linux_balloc.c index 356821034bd..1d89f025ff3 100644 --- a/sys/gnu/ext2fs/ext2_linux_balloc.c +++ b/sys/gnu/ext2fs/ext2_linux_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_linux_balloc.c,v 1.2 1996/07/13 21:21:15 downsj Exp $ */ +/* $OpenBSD: ext2_linux_balloc.c,v 1.3 1996/10/18 15:23:36 mickey Exp $ */ /* * modified for Lites 1.1 @@ -65,8 +65,9 @@ static void read_block_bitmap (struct mount * mp, int error; gdp = get_group_desc (mp, block_group, NULL); - if(error = bread (VFSTOUFS(mp)->um_devvp, - fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh)) + error = bread (VFSTOUFS(mp)->um_devvp, + fsbtodb(sb, gdp->bg_block_bitmap),sb->s_blocksize, NOCRED, &bh); + if (error != 0) panic ( "read_block_bitmap: " "Cannot read block bitmap - " "block_group = %d, block_bitmap = %lu", @@ -452,6 +453,7 @@ got_block: return j; } +#if 0 static unsigned long ext2_count_free_blocks (struct mount * mp) { struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs; @@ -485,7 +487,7 @@ static unsigned long ext2_count_free_blocks (struct mount * mp) return sb->s_es->s_free_blocks_count; #endif } - +#endif static INLINE int block_in_use (unsigned long block, struct ext2_sb_info * sb, @@ -495,6 +497,7 @@ static INLINE int block_in_use (unsigned long block, EXT2_BLOCKS_PER_GROUP(sb), map); } +#if 0 static void ext2_check_blocks_bitmap (struct mount * mp) { struct ext2_sb_info *sb = VFSTOUFS(mp)->um_e2fs; @@ -560,6 +563,7 @@ static void ext2_check_blocks_bitmap (struct mount * mp) (unsigned long) es->s_free_blocks_count, bitmap_count); unlock_super (VFSTOUFS(mp)->um_devvp); } +#endif /* * this function is taken from diff --git a/sys/gnu/ext2fs/ext2_linux_ialloc.c b/sys/gnu/ext2fs/ext2_linux_ialloc.c index 99eea107596..dee34c94b2a 100644 --- a/sys/gnu/ext2fs/ext2_linux_ialloc.c +++ b/sys/gnu/ext2fs/ext2_linux_ialloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_linux_ialloc.c,v 1.2 1996/07/13 21:21:16 downsj Exp $ */ +/* $OpenBSD: ext2_linux_ialloc.c,v 1.3 1996/10/18 15:23:37 mickey Exp $ */ /* * modified for Lites 1.1 @@ -110,10 +110,11 @@ static void read_inode_bitmap (struct mount * mp, int error; gdp = get_group_desc (mp, block_group, NULL); - if (error = bread (VFSTOUFS(mp)->um_devvp, + error = bread (VFSTOUFS(mp)->um_devvp, fsbtodb(sb, gdp->bg_inode_bitmap), sb->s_blocksize, - NOCRED, &bh)) + NOCRED, &bh); + if (error != 0) panic ( "read_inode_bitmap:" "Cannot read inode bitmap - " "block_group = %lu, inode_bitmap = %lu", @@ -448,6 +449,7 @@ repeat: return j; } +#if 0 static unsigned long ext2_count_free_inodes (struct mount * mp) { #ifdef EXT2FS_DEBUG @@ -481,6 +483,7 @@ static unsigned long ext2_count_free_inodes (struct mount * mp) return VFSTOUFS(mp)->um_e2fsb->s_free_inodes_count; #endif } +#endif #ifdef LATER void ext2_check_inodes_bitmap (struct mount * mp) diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index de5bc782eb2..1594adc0600 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_lookup.c,v 1.2 1996/07/15 03:39:29 downsj Exp $ */ +/* $OpenBSD: ext2_lookup.c,v 1.3 1996/10/18 15:23:38 mickey Exp $ */ /* * modified for Lites 1.1 @@ -282,7 +282,7 @@ ext2_lookup(v) */ if ((dp->i_mode & IFMT) != IFDIR) 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); /* @@ -292,7 +292,7 @@ ext2_lookup(v) * 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) @@ -330,7 +330,7 @@ ext2_lookup(v) 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); @@ -393,8 +393,8 @@ 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 != 0) return (error); entryoffsetinblock = 0; } @@ -504,7 +504,7 @@ searchloop: * Access for write is interpreted as allowing * creation of files in the directory. */ - if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) return (error); /* * Return an indication of where the new directory @@ -587,7 +587,7 @@ found: /* * Write access to directory required to delete files. */ - if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) return (error); /* * Return pointer to current entry in dp->i_offset, @@ -604,7 +604,7 @@ found: *vpp = vdp; return (0); } - if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) + if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) return (error); /* * If directory is "sticky", then user must own @@ -633,7 +633,7 @@ found: */ if (nameiop == RENAME && wantparent && (flags & ISLASTCN)) { - if (error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) return (error); /* * Careful about locking second inode. @@ -641,7 +641,7 @@ found: */ if (dp->i_number == dp->i_ino) return (EISDIR); - if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) + if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) return (error); *vpp = tdp; cnp->cn_flags |= SAVENAME; @@ -672,12 +672,12 @@ found: pdp = vdp; if (flags & ISDOTDOT) { VOP_UNLOCK(pdp); /* race to get the inode */ - if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) { + if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { VOP_LOCK(pdp); return (error); } if (lockparent && (flags & ISLASTCN) && - (error = VOP_LOCK(pdp))) { + (error = VOP_LOCK(pdp)) != 0) { vput(tdp); return (error); } @@ -686,7 +686,7 @@ found: VREF(vdp); /* we want ourself, ie "." */ *vpp = vdp; } else { - if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) + if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) return (error); if (!lockparent || !(flags & ISLASTCN)) VOP_UNLOCK(pdp); @@ -830,7 +830,7 @@ ext2_direnter(ip, dvp, cnp) /* * Get the block containing the space for the new directory entry. */ - if (error = VOP_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp)) + if ((error = VOP_BLKATOFF(dvp, (off_t)dp->i_offset, &dirbuf, &bp)) != 0) return (error); /* * Find space for the new entry. In the simple case, the entry at @@ -908,8 +908,8 @@ ext2_dirremove(dvp, cnp) /* * First entry in block: set d_ino to zero. */ - if (error = - VOP_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) + error = VOP_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp); + if (error != 0) return (error); ep->inode = 0; error = VOP_BWRITE(bp); @@ -919,8 +919,9 @@ ext2_dirremove(dvp, cnp) /* * Collapse new free space into previous entry. */ - if (error = VOP_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count), - (char **)&ep, &bp)) + error = VOP_BLKATOFF(dvp, (off_t)(dp->i_offset - dp->i_count), + (char **)&ep, &bp); + if (error != 0) return (error); ep->rec_len += dp->i_reclen; error = VOP_BWRITE(bp); @@ -943,7 +944,8 @@ ext2_dirrewrite(dp, ip, cnp) struct vnode *vdp = ITOV(dp); int error; - if (error = VOP_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp)) + error = VOP_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); + if (error != 0) return (error); ep->inode = ip->i_number; error = VOP_BWRITE(bp); @@ -1056,7 +1058,8 @@ ext2_checkpath(source, target, cred) if (dirbuf.dotdot_ino == rootino) break; vput(vp); - if (error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp)) { + error = VFS_VGET(vp->v_mount, dirbuf.dotdot_ino, &vp); + if (error != 0) { vp = NULL; break; } diff --git a/sys/gnu/ext2fs/ext2_subr.c b/sys/gnu/ext2fs/ext2_subr.c index 2c583a1b760..e3ed93e8306 100644 --- a/sys/gnu/ext2fs/ext2_subr.c +++ b/sys/gnu/ext2fs/ext2_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_subr.c,v 1.1 1996/06/24 03:34:58 downsj Exp $ */ +/* $OpenBSD: ext2_subr.c,v 1.2 1996/10/18 15:23:38 mickey Exp $ */ /* * modified for Lites 1.1 @@ -80,7 +80,7 @@ ext2_blkatoff(v) bsize = blksize(fs, ip, lbn); *ap->a_bpp = NULL; - if (error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) { + if ((error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) != 0) { brelse(bp); return (error); } diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index b2ddd43f2df..956a834ba90 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_vfsops.c,v 1.11 1996/07/14 09:45:03 downsj Exp $ */ +/* $OpenBSD: ext2_vfsops.c,v 1.12 1996/10/18 15:23:39 mickey Exp $ */ /* * modified for EXT2FS support in Lites 1.1 @@ -118,6 +118,7 @@ static int compute_sb_data __P((struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs)); +#ifdef notdef /* * Called by main() when ext2fs is going to be mounted as root. * @@ -170,6 +171,7 @@ ext2_mountroot() inittodr(fs->s_es->s_wtime); /* this helps to set the time */ return (0); } +#endif /* * VFS Operations. @@ -254,7 +256,7 @@ ext2_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; @@ -494,7 +496,7 @@ ext2_reload(mountp, cred, p) * Step 2: re-read superblock from disk. * constants have been adjusted for ext2 */ - if (error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) + if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0) return (error); es = (struct ext2_super_block *)bp->b_data; if (es->s_magic != EXT2_SUPER_MAGIC) { @@ -511,7 +513,7 @@ ext2_reload(mountp, cred, p) fs = VFSTOUFS(mountp)->um_e2fs; bcopy(bp->b_data, fs->s_es, sizeof(struct ext2_super_block)); - if(error = compute_sb_data(devvp, es, fs)) { + if ((error = compute_sb_data(devvp, es, fs)) != 0) { brelse(bp); return error; } @@ -542,9 +544,9 @@ loop: * Step 6: re-read inode data for all active vnodes. */ ip = VTOI(vp); - if (error = - bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp)) { + error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->s_blocksize, NOCRED, &bp); + if (error != 0) { vput(vp); return (error); } @@ -882,7 +884,7 @@ loop: continue; if (vget(vp, 1)) goto loop; - if (error = VOP_FSYNC(vp, cred, waitfor, p)) + if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0) allerror = error; vput(vp); } @@ -920,12 +922,11 @@ ext2_vget(mp, ino, vpp) ump = VFSTOUFS(mp); dev = ump->um_dev; -restart: if ((*vpp = ufs_ihashget(dev, ino)) != NULL) return (0); /* Allocate a new vnode/inode. */ - if (error = getnewvnode(VT_EXT2FS, mp, ext2_vnodeop_p, &vp)) { + if ((error = getnewvnode(VT_EXT2FS, mp, ext2_vnodeop_p, &vp)) != 0) { *vpp = NULL; return (error); } diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 0233c2eb328..cf8978e3897 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2_vnops.c,v 1.3 1996/09/23 13:01:45 mickey Exp $ */ +/* $OpenBSD: ext2_vnops.c,v 1.4 1996/10/18 15:23:40 mickey Exp $ */ /* * modified for EXT2FS support in Lites 1.1 @@ -79,6 +79,7 @@ int ext2_reclaim __P((void *)); int ext2_read __P((void *)); int ext2_write __P((void *)); +#ifdef notdef /* Global vfs data structures for ext2fs. */ int (**ext2_vnodeop_p) __P((void *)); static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { @@ -228,6 +229,7 @@ static struct vnodeopv_entry_desc ext2_fifoop_entries[] = { static struct vnodeopv_desc ext2fs_fifoop_opv_desc = { &ext2_fifoop_p, ext2_fifoop_entries }; #endif /* FIFO */ +#endif #ifdef DEBUG #ifndef FFS |