summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-05-29 13:24:17 +0000
committerkib <kib@FreeBSD.org>2015-05-29 13:24:17 +0000
commite2f56205b5cb974ce90bb8e1753845d84f4401cf (patch)
treec8c8cba4f0c624f3f4b5849c24f18e203d98409e /sys/ufs
parenta1e13e9e590c569e31b8bf4ccd7679b392a2d815 (diff)
downloadFreeBSD-src-e2f56205b5cb974ce90bb8e1753845d84f4401cf.zip
FreeBSD-src-e2f56205b5cb974ce90bb8e1753845d84f4401cf.tar.gz
Remove several write-only variables, all reported by the gcc 4.9
buildkernel run. Some of them were write-only under some kernel options, e.g. variables keeping values only used by CTR() macros. It costs nothing to the code readability and correctness to eliminate the warnings in those cases too by removing the local cached values used only for single-access. Review: https://reviews.freebsd.org/D2665 Reviewed by: rodrigc Looked at by: bjk Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c6
-rw-r--r--sys/ufs/ffs/ffs_suspend.c2
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c10
-rw-r--r--sys/ufs/ffs/ffs_vnops.c14
-rw-r--r--sys/ufs/ufs/ufs_bmap.c2
-rw-r--r--sys/ufs/ufs/ufs_dirhash.c4
6 files changed, 2 insertions, 36 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index b0005f1..515857d 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -4691,12 +4691,10 @@ softdep_setup_dotdot_link(dp, ip)
struct inodedep *inodedep;
struct jaddref *jaddref;
struct vnode *dvp;
- struct vnode *vp;
KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
("softdep_setup_dotdot_link called on non-softdep filesystem"));
dvp = ITOV(dp);
- vp = ITOV(ip);
jaddref = NULL;
/*
* We don't set MKDIR_PARENT as this is not tied to a mkdir and
@@ -7052,7 +7050,6 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
struct bufobj *bo;
struct vnode *vp;
struct buf *bp;
- struct fs *fs;
int blkoff;
/*
@@ -7061,7 +7058,6 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
* Once they are all there, walk the list and get rid of
* any dependencies.
*/
- fs = ip->i_fs;
vp = ITOV(ip);
bo = &vp->v_bufobj;
BO_LOCK(bo);
@@ -9493,12 +9489,10 @@ handle_written_sbdep(sbdep, bp)
struct buf *bp;
{
struct inodedep *inodedep;
- struct mount *mp;
struct fs *fs;
LOCK_OWNED(sbdep->sb_ump);
fs = sbdep->sb_fs;
- mp = UFSTOVFS(sbdep->sb_ump);
/*
* If the superblock doesn't match the in-memory list start over.
*/
diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c
index b50fadc..450282c 100644
--- a/sys/ufs/ffs/ffs_suspend.c
+++ b/sys/ufs/ffs/ffs_suspend.c
@@ -177,7 +177,6 @@ out:
static int
ffs_susp_suspend(struct mount *mp)
{
- struct fs *fs;
struct ufsmount *ump;
int error;
@@ -189,7 +188,6 @@ ffs_susp_suspend(struct mount *mp)
return (EBUSY);
ump = VFSTOUFS(mp);
- fs = ump->um_fs;
/*
* Make sure the calling thread is permitted to access the mounted
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2a368bd..ce43bcd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1486,7 +1486,7 @@ ffs_sync(mp, waitfor)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
- int error, count, wait, lockreq, allerror = 0;
+ int error, count, lockreq, allerror = 0;
int suspend;
int suspended;
int secondary_writes;
@@ -1495,7 +1495,6 @@ ffs_sync(mp, waitfor)
int softdep_accdeps;
struct bufobj *bo;
- wait = 0;
suspend = 0;
suspended = 0;
td = curthread;
@@ -1517,10 +1516,8 @@ ffs_sync(mp, waitfor)
suspend = 1;
waitfor = MNT_WAIT;
}
- if (waitfor == MNT_WAIT) {
- wait = 1;
+ if (waitfor == MNT_WAIT)
lockreq = LK_EXCLUSIVE;
- }
lockreq |= LK_INTERLOCK | LK_SLEEPFAIL;
loop:
/* Grab snapshot of secondary write counts */
@@ -2024,7 +2021,6 @@ static int
ffs_bufwrite(struct buf *bp)
{
struct buf *newbp;
- int oldflags;
CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags);
if (bp->b_flags & B_INVAL) {
@@ -2032,8 +2028,6 @@ ffs_bufwrite(struct buf *bp)
return (0);
}
- oldflags = bp->b_flags;
-
if (!BUF_ISLOCKED(bp))
panic("bufwrite: buffer is not busy???");
/*
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 6b34a40..80f3269 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1366,11 +1366,6 @@ struct vop_openextattr_args {
};
*/
{
- struct inode *ip;
- struct fs *fs;
-
- ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1394,11 +1389,6 @@ struct vop_closeextattr_args {
};
*/
{
- struct inode *ip;
- struct fs *fs;
-
- ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1512,13 +1502,11 @@ vop_getextattr {
*/
{
struct inode *ip;
- struct fs *fs;
u_char *eae, *p;
unsigned easize;
int error, ealen;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1567,14 +1555,12 @@ vop_listextattr {
*/
{
struct inode *ip;
- struct fs *fs;
u_char *eae, *p, *pe, *pn;
unsigned easize;
uint32_t ul;
int error, ealen;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 22887c8..9819ef5 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -114,7 +114,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
struct buf *bp;
struct ufsmount *ump;
struct mount *mp;
- struct vnode *devvp;
struct indir a[NIADDR+1], *ap;
ufs2_daddr_t daddr;
ufs_lbn_t metalbn;
@@ -125,7 +124,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
ip = VTOI(vp);
mp = vp->v_mount;
ump = VFSTOUFS(mp);
- devvp = ump->um_devvp;
if (runp) {
maxrun = mp->mnt_iosize_max / mp->mnt_stat.f_iosize - 1;
diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c
index 39f29d0..766fe54 100644
--- a/sys/ufs/ufs/ufs_dirhash.c
+++ b/sys/ufs/ufs/ufs_dirhash.c
@@ -190,9 +190,7 @@ ufsdirhash_create(struct inode *ip)
struct dirhash *ndh;
struct dirhash *dh;
struct vnode *vp;
- int error;
- error = 0;
ndh = dh = NULL;
vp = ip->i_vnode;
for (;;) {
@@ -274,11 +272,9 @@ static struct dirhash *
ufsdirhash_acquire(struct inode *ip)
{
struct dirhash *dh;
- struct vnode *vp;
ASSERT_VOP_ELOCKED(ip->i_vnode, __FUNCTION__);
- vp = ip->i_vnode;
dh = ip->i_dirhash;
if (dh == NULL)
return (NULL);
OpenPOWER on IntegriCloud