diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2008-11-24 00:01:21 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2008-11-24 00:01:21 +0000 |
commit | 35bdb8e894a970f8d9794ff1d484cf839ee6d30e (patch) | |
tree | d43e877231a94587cf4bdfec34f4b5fbee8556a0 /sys/ufs | |
parent | d86627c727e4cb0c88895635a6cadd24571bc4a0 (diff) |
styled code is happy code
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 050d4903271..b8ddb76e11a 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.51 2008/11/23 23:52:35 tedu Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.52 2008/11/24 00:01:20 tedu Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -155,11 +155,11 @@ ext2fs_mountroot(void) ump = VFSTOUFS(mp); fs = ump->um_e2fs; bzero(fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt)); - (void) copystr(mp->mnt_stat.f_mntonname, fs->e2fs_fsmnt, + (void)copystr(mp->mnt_stat.f_mntonname, fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt) - 1, 0); if (fs->e2fs.e2fs_rev > E2FS_REV0) { bzero(fs->e2fs.e2fs_fsmnt, sizeof(fs->e2fs.e2fs_fsmnt)); - (void) copystr(mp->mnt_stat.f_mntonname, fs->e2fs.e2fs_fsmnt, + (void)copystr(mp->mnt_stat.f_mntonname, fs->e2fs.e2fs_fsmnt, sizeof(fs->e2fs.e2fs_fsmnt) - 1, 0); } (void)ext2fs_statfs(mp, &mp->mnt_stat, p); @@ -201,10 +201,10 @@ ext2fs_mount(struct mount *mp, const char *path, void *data, flags |= FORCECLOSE; error = ext2fs_flushfiles(mp, flags, p); if (error == 0 && - ext2fs_cgupdate(ump, MNT_WAIT) == 0 && - (fs->e2fs.e2fs_state & E2FS_ERRORS) == 0) { + ext2fs_cgupdate(ump, MNT_WAIT) == 0 && + (fs->e2fs.e2fs_state & E2FS_ERRORS) == 0) { fs->e2fs.e2fs_state = E2FS_ISCLEAN; - (void) ext2fs_sbupdate(ump, MNT_WAIT); + (void)ext2fs_sbupdate(ump, MNT_WAIT); } if (error) return (error); @@ -224,7 +224,7 @@ ext2fs_mount(struct mount *mp, const char *path, void *data, devvp = ump->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, VREAD | VWRITE, - p->p_ucred, p); + p->p_ucred, p); if (error) { VOP_UNLOCK(devvp, 0, p); return (error); @@ -293,16 +293,16 @@ ext2fs_mount(struct mount *mp, const char *path, void *data, } ump = VFSTOUFS(mp); fs = ump->um_e2fs; - (void) copyinstr(path, fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt) - 1, + (void)copyinstr(path, fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt) - 1, &size); bzero(fs->e2fs_fsmnt + size, sizeof(fs->e2fs_fsmnt) - size); if (fs->e2fs.e2fs_rev > E2FS_REV0) { - (void) copystr(mp->mnt_stat.f_mntonname, fs->e2fs.e2fs_fsmnt, + (void)copystr(mp->mnt_stat.f_mntonname, fs->e2fs.e2fs_fsmnt, sizeof(fs->e2fs.e2fs_fsmnt) - 1, &size); bzero(fs->e2fs.e2fs_fsmnt, sizeof(fs->e2fs.e2fs_fsmnt) - size); } bcopy(fs->e2fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN); - (void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void)copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); if (fs->e2fs_fmod != 0) { /* XXX */ @@ -312,7 +312,7 @@ ext2fs_mount(struct mount *mp, const char *path, void *data, else printf("%s: file system not clean; please fsck(8)\n", mp->mnt_stat.f_mntfromname); - (void) ext2fs_cgupdate(ump, MNT_WAIT); + (void)ext2fs_cgupdate(ump, MNT_WAIT); } return (0); } @@ -437,7 +437,7 @@ ext2fs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) fs->e2fs_qbmask = fs->e2fs_bsize - 1; fs->e2fs_bmask = ~fs->e2fs_qbmask; fs->e2fs_ngdb = howmany(fs->e2fs_ncg, - fs->e2fs_bsize / sizeof(struct ext2_gd)); + fs->e2fs_bsize / sizeof(struct ext2_gd)); fs->e2fs_ipb = fs->e2fs_bsize / EXT2_DINODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs.e2fs_ipg/fs->e2fs_ipb; @@ -558,7 +558,7 @@ ext2fs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) m_fs->e2fs_itpg = m_fs->e2fs.e2fs_ipg/m_fs->e2fs_ipb; m_fs->e2fs_gd = malloc(m_fs->e2fs_ngdb * m_fs->e2fs_bsize, - M_UFSMNT, M_WAITOK); + M_UFSMNT, M_WAITOK); for (i=0; i < m_fs->e2fs_ngdb; i++) { error = bread(devvp , fsbtodb(m_fs, ((m_fs->e2fs_bsize>1024)? 0 : 1) + i + 1), @@ -568,8 +568,8 @@ ext2fs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) goto out; } e2fs_cgload((struct ext2_gd*)bp->b_data, - &m_fs->e2fs_gd[ - i * m_fs->e2fs_bsize / sizeof(struct ext2_gd)], + &m_fs->e2fs_gd[i * m_fs->e2fs_bsize + / sizeof(struct ext2_gd)], m_fs->e2fs_bsize); brelse(bp); bp = NULL; @@ -630,7 +630,7 @@ ext2fs_unmount(struct mount *mp, int mntflags, struct proc *p) ump->um_devvp->v_specmountpoint = NULL; vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE, - NOCRED, p); + NOCRED, p); vput(ump->um_devvp); free(fs->e2fs_gd, M_UFSMNT); free(fs, M_UFSMNT); @@ -683,11 +683,10 @@ ext2fs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p) /* * Compute the overhead (FS structures) */ - overhead_per_group = 1 /* block bitmap */ + - 1 /* inode bitmap */ + - fs->e2fs_itpg; + overhead_per_group = 1 /* block bitmap */ + 1 /* inode bitmap */ + + fs->e2fs_itpg; overhead = fs->e2fs.e2fs_first_dblock + - fs->e2fs_ncg * overhead_per_group; + fs->e2fs_ncg * overhead_per_group; if (fs->e2fs.e2fs_rev > E2FS_REV0 && fs->e2fs.e2fs_features_rocompat & EXT2F_ROCOMPAT_SPARSESUPER) { for (i = 0, ngroups = 0; i < fs->e2fs_ncg; i++) { @@ -733,7 +732,7 @@ ext2fs_sync_vnode(struct vnode *vp, void *args) ip = VTOI(vp); if (vp->v_type == VNON || ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && - LIST_EMPTY(&vp->v_dirtyblkhd)) || + LIST_EMPTY(&vp->v_dirtyblkhd)) || esa->waitfor == MNT_LAZY) { return (0); } @@ -861,7 +860,7 @@ ext2fs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) /* Read in the disk contents for the inode, copy into the inode. */ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), - (int)fs->e2fs_bsize, NOCRED, &bp); + (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { /* * The inode does not contain anything useful, so it would @@ -876,7 +875,7 @@ ext2fs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) } dp = (struct ext2fs_dinode *) ((char *)bp->b_data - + EXT2_DINODE_SIZE(fs) * ino_to_fsbo(fs, ino)); + + EXT2_DINODE_SIZE(fs) * ino_to_fsbo(fs, ino)); ip->i_e2din = pool_get(&ext2fs_dinode_pool, PR_WAITOK); e2fs_iload(dp, ip->i_e2din); @@ -954,7 +953,7 @@ ext2fs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) ufhp = (struct ufid *)fhp; fs = VFSTOUFS(mp)->um_e2fs; if ((ufhp->ufid_ino < EXT2_FIRSTINO && ufhp->ufid_ino != EXT2_ROOTINO) || - ufhp->ufid_ino > fs->e2fs_ncg * fs->e2fs.e2fs_ipg) + ufhp->ufid_ino > fs->e2fs_ncg * fs->e2fs.e2fs_ipg) return (ESTALE); if ((error = VFS_VGET(mp, ufhp->ufid_ino, &nvp)) != 0) { @@ -963,7 +962,7 @@ ext2fs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) } ip = VTOI(nvp); if (ip->i_e2fs_mode == 0 || ip->i_e2fs_dtime != 0 || - ip->i_e2fs_gen != ufhp->ufid_gen) { + ip->i_e2fs_gen != ufhp->ufid_gen) { vput(nvp); *vpp = NULLVP; return (ESTALE); |