From e2c0448bf81085cbfab8e83c330de5be88c29afb Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Fri, 18 Oct 1996 14:46:25 +0000 Subject: -Wall happieness --- sys/ufs/lfs/lfs.h | 16 ++++++++-------- sys/ufs/lfs/lfs_balloc.c | 22 ++++++++++++++++------ sys/ufs/lfs/lfs_segment.c | 4 +++- 3 files changed, 27 insertions(+), 15 deletions(-) (limited to 'sys') diff --git a/sys/ufs/lfs/lfs.h b/sys/ufs/lfs/lfs.h index c39bbc85abf..b049b4b6e61 100644 --- a/sys/ufs/lfs/lfs.h +++ b/sys/ufs/lfs/lfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs.h,v 1.4 1996/07/01 11:07:34 downsj Exp $ */ +/* $OpenBSD: lfs.h,v 1.5 1996/10/18 14:46:22 mickey Exp $ */ /* $NetBSD: lfs.h,v 1.7 1996/02/09 22:28:45 christos Exp $ */ /*- @@ -248,8 +248,8 @@ struct segsum { ((int)((loc) & (fs)->lfs_ffmask)) #define fsbtodb(fs, b) ((b) << (fs)->lfs_fsbtodb) #define dbtofsb(fs, b) ((b) >> (fs)->lfs_fsbtodb) -#define fragstodb(fs, b) ((b) << (fs)->lfs_fsbtodb - (fs)->lfs_fbshift) -#define dbtofrags(fs, b) ((b) >> (fs)->lfs_fsbtodb - (fs)->lfs_fbshift) +#define fragstodb(fs, b) ((b) << ((fs)->lfs_fsbtodb - (fs)->lfs_fbshift)) +#define dbtofrags(fs, b) ((b) >> ((fs)->lfs_fsbtodb - (fs)->lfs_fbshift)) #define lblkno(fs, loc) ((loc) >> (fs)->lfs_bshift) #define lblktosize(fs, blk) ((blk) << (fs)->lfs_bshift) #define numfrags(fs, loc) /* calculates (loc / fs->lfs_fsize) */ \ @@ -289,9 +289,9 @@ struct segsum { #define LFS_IENTRY(IP, F, IN, BP) { \ int _e; \ VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \ - if (_e = bread((F)->lfs_ivnode, \ + if ((_e = bread((F)->lfs_ivnode, \ (IN) / (F)->lfs_ifpb + (F)->lfs_cleansz + (F)->lfs_segtabsz,\ - (F)->lfs_bsize, NOCRED, &(BP))) \ + (F)->lfs_bsize, NOCRED, &(BP))) != 0) \ panic("lfs: ifile read %d", _e); \ (IP) = (IFILE *)(BP)->b_data + (IN) % (F)->lfs_ifpb; \ } @@ -300,11 +300,11 @@ struct segsum { #define LFS_SEGENTRY(SP, F, IN, BP) { \ int _e; \ VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \ - if (_e = bread((F)->lfs_ivnode, \ + if ((_e = bread((F)->lfs_ivnode, \ ((IN) >> (F)->lfs_sushift) + (F)->lfs_cleansz, \ - (F)->lfs_bsize, NOCRED, &(BP))) \ + (F)->lfs_bsize, NOCRED, &(BP))) != 0) \ panic("lfs: ifile read: %d", _e); \ - (SP) = (SEGUSE *)(BP)->b_data + ((IN) & (F)->lfs_sepb - 1); \ + (SP) = (SEGUSE *)(BP)->b_data + ((IN) & ((F)->lfs_sepb - 1)); \ } /* diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c index f00ee4b9203..05efd03b9e4 100644 --- a/sys/ufs/lfs/lfs_balloc.c +++ b/sys/ufs/lfs/lfs_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_balloc.c,v 1.3 1996/07/01 07:41:48 downsj Exp $ */ +/* $OpenBSD: lfs_balloc.c,v 1.4 1996/10/18 14:46:23 mickey Exp $ */ /* $NetBSD: lfs_balloc.c,v 1.3 1996/02/09 22:28:48 christos Exp $ */ /* @@ -54,6 +54,13 @@ #include #include +#include +#include /* for vnode_pager_setsize() */ + +int lfs_fragextend __P((struct vnode *vp, int osize, int nsize, daddr_t lbn, + struct buf **bpp)); + + int lfs_balloc(vp, offset, iosize, lbn, bpp) struct vnode *vp; @@ -96,8 +103,9 @@ lfs_balloc(vp, offset, iosize, lbn, bpp) if (lastblock < NDADDR && lastblock < lbn) { osize = blksize(fs, ip, lastblock); if (osize < fs->lfs_bsize && osize > 0) { - if (error = lfs_fragextend(vp, osize, fs->lfs_bsize, - lastblock, &bp)) + error = lfs_fragextend(vp, osize, fs->lfs_bsize, + lastblock, &bp); + if (error != 0) return(error); ip->i_size = (lastblock + 1) * fs->lfs_bsize; vnode_pager_setsize(vp, (u_long)ip->i_size); @@ -124,7 +132,7 @@ lfs_balloc(vp, offset, iosize, lbn, bpp) ip->i_blocks += bb; ip->i_lfs->lfs_bfree -= bb; clrbuf(ibp); - if(error = VOP_BWRITE(ibp)) + if((error = VOP_BWRITE(ibp)) != 0) return(error); } } @@ -146,8 +154,9 @@ lfs_balloc(vp, offset, iosize, lbn, bpp) *bpp = bp = getblk(vp, lbn, nsize, 0, 0); else { /* Extend existing block */ - if (error = lfs_fragextend(vp, (int)blksize(fs, ip, lbn), - nsize, lbn, &bp)) + error = lfs_fragextend(vp, (int)blksize(fs, ip, lbn), + nsize, lbn, &bp); + if (error != 0) return(error); *bpp = bp; } @@ -195,6 +204,7 @@ lfs_balloc(vp, offset, iosize, lbn, bpp) return (0); } +int lfs_fragextend(vp, osize, nsize, lbn, bpp) struct vnode *vp; int osize; diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index c163df7e804..21834daaa74 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_segment.c,v 1.4 1996/07/01 07:41:52 downsj Exp $ */ +/* $OpenBSD: lfs_segment.c,v 1.5 1996/10/18 14:46:24 mickey Exp $ */ /* $NetBSD: lfs_segment.c,v 1.4 1996/02/09 22:28:54 christos Exp $ */ /* @@ -223,7 +223,9 @@ lfs_segwrite(mp, flags) struct mount *mp; int flags; /* Do a checkpoint. */ { +#if 0 struct proc *p = curproc; /* XXX */ +#endif struct buf *bp; struct inode *ip; struct lfs *fs; -- cgit v1.2.3