summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-02-02 15:52:11 +0000
committerpfg <pfg@FreeBSD.org>2015-02-02 15:52:11 +0000
commitc6be6095bb848c7f98e661d0bf3a00d35ef23361 (patch)
treecf2bf2dc214ded76d0b093a60726cc497f05cdd8 /sys/fs/ext2fs
parentba803d12f9dc33b4deaad98edb996907e62705da (diff)
downloadFreeBSD-src-c6be6095bb848c7f98e661d0bf3a00d35ef23361.zip
FreeBSD-src-c6be6095bb848c7f98e661d0bf3a00d35ef23361.tar.gz
MFC r277354, r277365:
ext2: Garbage-collect some unused variables Reported by: clang static analysis
Diffstat (limited to 'sys/fs/ext2fs')
-rw-r--r--sys/fs/ext2fs/ext2_bmap.c2
-rw-r--r--sys/fs/ext2fs/ext2_extents.c2
-rw-r--r--sys/fs/ext2fs/ext2_htree.c4
-rw-r--r--sys/fs/ext2fs/ext2_inode.c6
-rw-r--r--sys/fs/ext2fs/ext2_lookup.c1
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c2
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c3
7 files changed, 7 insertions, 13 deletions
diff --git a/sys/fs/ext2fs/ext2_bmap.c b/sys/fs/ext2fs/ext2_bmap.c
index 12f9560..d144e92 100644
--- a/sys/fs/ext2fs/ext2_bmap.c
+++ b/sys/fs/ext2fs/ext2_bmap.c
@@ -145,7 +145,6 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb)
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 bn, daddr_t *bnp, int *runp, int *runb)
ip = VTOI(vp);
mp = vp->v_mount;
ump = VFSTOEXT2(mp);
- devvp = ump->um_devvp;
bsize = EXT2_BLOCK_SIZE(ump->um_e2fs);
diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c
index 26e6a22..68704bb 100644
--- a/sys/fs/ext2fs/ext2_extents.c
+++ b/sys/fs/ext2fs/ext2_extents.c
@@ -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)
diff --git a/sys/fs/ext2fs/ext2_htree.c b/sys/fs/ext2fs/ext2_htree.c
index 33e4c0f..70a2f47 100644
--- a/sys/fs/ext2fs/ext2_htree.c
+++ b/sys/fs/ext2fs/ext2_htree.c
@@ -395,7 +395,7 @@ ext2_htree_append_block(struct vnode *vp, char *data,
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, struct ext2fs_direct_2 *entry,
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,
diff --git a/sys/fs/ext2fs/ext2_inode.c b/sys/fs/ext2fs/ext2_inode.c
index 43b0fc9..36768fb 100644
--- a/sys/fs/ext2fs/ext2_inode.c
+++ b/sys/fs/ext2fs/ext2_inode.c
@@ -115,16 +115,20 @@ ext2_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred,
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;
e4fs_daddr_t count, nblocks, blocksreleased = 0;
int error, i, allerror;
off_t osize;
+#ifdef INVARIANTS
+ struct bufobj *bo;
+#endif
oip = VTOI(ovp);
+#ifdef INVARIANTS
bo = &ovp->v_bufobj;
+#endif
ASSERT_VOP_LOCKED(vp, "ext2_truncate");
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
index 2eec708..65e9b95 100644
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -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;
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
index b97356d..6879e42 100644
--- a/sys/fs/ext2fs/ext2_vfsops.c
+++ b/sys/fs/ext2fs/ext2_vfsops.c
@@ -902,7 +902,6 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
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, int flags, struct vnode **vpp)
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. */
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 719d57a..f5dc3b2 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -1224,7 +1224,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;
@@ -1330,12 +1329,10 @@ ext2_strategy(struct vop_strategy_args *ap)
{
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) {
OpenPOWER on IntegriCloud