Date: Mon, 19 Jan 2015 03:30:46 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277354 - head/sys/fs/ext2fs Message-ID: <201501190330.t0J3Ukww038374@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Mon Jan 19 03:30:45 2015 New Revision: 277354 URL: https://svnweb.freebsd.org/changeset/base/277354 Log: ext2: Garbage-collect some unused variables Reported by: clang static analysis MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_bmap.c Mon Jan 19 03:30:45 2015 (r277354) @@ -145,7 +145,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t struct buf *bp; struct ext2mount *ump; struct mount *mp; - struct vnode *devvp; struct indir a[NIADDR+1], *ap; daddr_t daddr; e2fs_lbn_t metalbn; @@ -156,7 +155,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t ip = VTOI(vp); mp = vp->v_mount; ump = VFSTOEXT2(mp); - devvp = ump->um_devvp; bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Jan 19 03:30:45 2015 (r277354) @@ -131,13 +131,11 @@ struct ext4_extent_path * ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *ip, daddr_t lbn, struct ext4_extent_path *path) { - struct vnode *vp; struct ext4_extent_header *ehp; uint16_t i; int error, size; daddr_t nblk; - vp = ITOV(ip); ehp = (struct ext4_extent_header *)(char *)ip->i_db; if (ehp->eh_magic != EXT4_EXT_MAGIC) Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_htree.c Mon Jan 19 03:30:45 2015 (r277354) @@ -395,7 +395,7 @@ ext2_htree_append_block(struct vnode *vp int error; cursize = roundup(dp->i_size, blksize); - newsize = roundup(dp->i_size, blksize) + blksize; + newsize = cursize + blksize; auio.uio_offset = cursize; auio.uio_resid = blksize; @@ -771,7 +771,7 @@ ext2_htree_add_entry(struct vnode *dvp, dst_node->h_fake_dirent.e2d_reclen = blksize; cursize = roundup(ip->i_size, blksize); - dirsize = roundup(ip->i_size, blksize) + blksize; + dirsize = cursize + blksize; blknum = dirsize / blksize - 1; error = ext2_htree_append_block(dvp, newidxblock, Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_inode.c Mon Jan 19 03:30:45 2015 (r277354) @@ -115,7 +115,6 @@ ext2_truncate(struct vnode *vp, off_t le struct inode *oip; int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; uint32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; - struct bufobj *bo; struct m_ext2fs *fs; struct buf *bp; int offset, size, level; @@ -124,7 +123,6 @@ ext2_truncate(struct vnode *vp, off_t le off_t osize; oip = VTOI(ovp); - bo = &ovp->v_bufobj; ASSERT_VOP_LOCKED(vp, "ext2_truncate"); Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_lookup.c Mon Jan 19 03:30:45 2015 (r277354) @@ -343,7 +343,6 @@ restart: * we watch for a place to put the new file in * case it doesn't already exist. */ - ino = 0; i_diroff = dp->i_diroff; ss.slotstatus = FOUND; ss.slotfreespace = ss.slotsize = ss.slotneeded = 0; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Jan 19 03:30:45 2015 (r277354) @@ -902,7 +902,6 @@ ext2_vget(struct mount *mp, ino_t ino, i struct ext2mount *ump; struct buf *bp; struct vnode *vp; - struct cdev *dev; struct thread *td; int i, error; int used_blocks; @@ -913,7 +912,6 @@ ext2_vget(struct mount *mp, ino_t ino, i return (error); ump = VFSTOEXT2(mp); - dev = ump->um_dev; ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 19 02:22:03 2015 (r277353) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Jan 19 03:30:45 2015 (r277354) @@ -1223,7 +1223,6 @@ ext2_rmdir(struct vop_rmdir_args *ap) * the current directory and thus be * non-empty.) */ - error = 0; if (ip->i_nlink != 2 || !ext2_dirempty(ip, dp->i_number, cnp->cn_cred)) { error = ENOTEMPTY; goto out; @@ -1329,12 +1328,10 @@ ext2_strategy(struct vop_strategy_args * { struct buf *bp = ap->a_bp; struct vnode *vp = ap->a_vp; - struct inode *ip; struct bufobj *bo; daddr_t blkno; int error; - ip = VTOI(vp); if (vp->v_type == VBLK || vp->v_type == VCHR) panic("ext2_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501190330.t0J3Ukww038374>