Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2021 00:45:18 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c026e9c5d3cd - stable/13 - ufs: remove write-only variables
Message-ID:  <202110270045.19R0jIgq011185@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c026e9c5d3cdc80ca31e25173783678ebdc844ea

commit c026e9c5d3cdc80ca31e25173783678ebdc844ea
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-20 01:42:31 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-10-27 00:24:40 +0000

    ufs: remove write-only variables
    
    (cherry picked from commit 2030ee0e1b17e45a162bba6a636e07886a9eb67c)
---
 sys/ufs/ffs/ffs_inode.c   |  6 ++----
 sys/ufs/ffs/ffs_softdep.c | 12 ++++--------
 sys/ufs/ffs/ffs_vfsops.c  |  5 ++---
 sys/ufs/ffs/ffs_vnops.c   |  4 ----
 4 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index b78f46ae4ba0..4b2b2989fb81 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -244,8 +244,8 @@ ffs_truncate(vp, length, flags, cred)
 	ufs2_daddr_t bn, lbn, lastblock, lastiblock[UFS_NIADDR];
 	ufs2_daddr_t indir_lbn[UFS_NIADDR], oldblks[UFS_NDADDR + UFS_NIADDR];
 	ufs2_daddr_t newblks[UFS_NDADDR + UFS_NIADDR];
-	ufs2_daddr_t count, blocksreleased = 0, datablocks, blkno;
-	struct bufobj *bo;
+	ufs2_daddr_t count, blocksreleased = 0, blkno;
+	struct bufobj *bo __diagused;
 	struct fs *fs;
 	struct buf *bp;
 	struct ufsmount *ump;
@@ -297,10 +297,8 @@ ffs_truncate(vp, length, flags, cred)
 	if (journaltrunc == 0 && DOINGSOFTDEP(vp) && length == 0)
 		softdeptrunc = !softdep_slowdown(vp);
 	extblocks = 0;
-	datablocks = DIP(ip, i_blocks);
 	if (fs->fs_magic == FS_UFS2_MAGIC && ip->i_din2->di_extsize > 0) {
 		extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize));
-		datablocks -= extblocks;
 	}
 	if ((flags & IO_EXT) && extblocks > 0) {
 		if (length != 0)
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 27d1cc8b0537..0d2de850bd3e 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -5066,7 +5066,7 @@ softdep_setup_create(dp, ip)
 	struct inode *ip;
 {
 	struct inodedep *inodedep;
-	struct jaddref *jaddref;
+	struct jaddref *jaddref __diagused;
 	struct vnode *dvp;
 
 	KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
@@ -5207,11 +5207,9 @@ softdep_setup_rmdir(dp, ip)
 	struct inode *dp;
 	struct inode *ip;
 {
-	struct vnode *dvp;
 
 	KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
 	    ("softdep_setup_rmdir called on non-softdep filesystem"));
-	dvp = ITOV(dp);
 	ACQUIRE_LOCK(ITOUMP(dp));
 	(void) inodedep_lookup_ip(ip);
 	(void) inodedep_lookup_ip(dp);
@@ -5227,11 +5225,9 @@ softdep_setup_unlink(dp, ip)
 	struct inode *dp;
 	struct inode *ip;
 {
-	struct vnode *dvp;
 
 	KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
 	    ("softdep_setup_unlink called on non-softdep filesystem"));
-	dvp = ITOV(dp);
 	ACQUIRE_LOCK(ITOUMP(dp));
 	(void) inodedep_lookup_ip(ip);
 	(void) inodedep_lookup_ip(dp);
@@ -6426,7 +6422,7 @@ setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)
 	struct allocindir *aip;	/* allocindir allocated by the above routines */
 	ufs_lbn_t lbn;		/* Logical block number for this block. */
 {
-	struct fs *fs;
+	struct fs *fs __diagused;
 	struct indirdep *indirdep;
 	struct allocindir *oldaip;
 	struct freefrag *freefrag;
@@ -10628,7 +10624,7 @@ initiate_write_inodeblock_ufs1(inodedep, bp)
 #ifdef INVARIANTS
 	ufs_lbn_t prevlbn = 0;
 #endif
-	int deplist;
+	int deplist __diagused;
 
 	if (inodedep->id_state & IOSTARTED)
 		panic("initiate_write_inodeblock_ufs1: already started");
@@ -10800,7 +10796,7 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
 #ifdef INVARIANTS
 	ufs_lbn_t prevlbn = 0;
 #endif
-	int deplist;
+	int deplist __diagused;
 
 	if (inodedep->id_state & IOSTARTED)
 		panic("initiate_write_inodeblock_ufs2: already started");
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index fb00218f5d3a..0b96edff12ff 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -374,7 +374,8 @@ ffs_mount(struct mount *mp)
 	struct thread *td;
 	struct ufsmount *ump = NULL;
 	struct fs *fs;
-	int error, error1, flags;
+	int error, flags;
+	int error1 __diagused;
 	uint64_t mntorflags, saved_mnt_flag;
 	accmode_t accmode;
 	struct nameidata ndp;
@@ -1646,11 +1647,9 @@ ffs_sync_lazy(mp)
 {
 	struct vnode *mvp, *vp;
 	struct inode *ip;
-	struct thread *td;
 	int allerror, error;
 
 	allerror = 0;
-	td = curthread;
 	if ((mp->mnt_flag & MNT_NOATIME) != 0) {
 #ifdef QUOTA
 		qsync(mp);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 7b2c70af54c9..ceea2237c94e 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1399,7 +1399,6 @@ static int
 ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td)
 {
 	struct inode *ip;
-	struct ufs2_dinode *dp;
 	int error;
 
 	ip = VTOI(vp);
@@ -1410,7 +1409,6 @@ ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td)
 		ffs_unlock_ea(vp);
 		return (0);
 	}
-	dp = ip->i_din2;
 	error = ffs_rdextattr(&ip->i_ea_area, vp, td);
 	if (error) {
 		ffs_unlock_ea(vp);
@@ -1994,7 +1992,6 @@ ffs_vput_pair(struct vop_vput_pair_args *ap)
 	struct inode *dp, *ip;
 	ino_t ip_ino;
 	u_int64_t ip_gen;
-	off_t old_size;
 	int error, vp_locked;
 
 	dvp = ap->a_dvp;
@@ -2031,7 +2028,6 @@ ffs_vput_pair(struct vop_vput_pair_args *ap)
 		VNASSERT(I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size, dvp,
 		    ("IN_ENDOFF set but I_ENDOFF() is not"));
 		dp->i_flag &= ~IN_ENDOFF;
-		old_size = dp->i_size;
 		error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL |
 		    (DOINGASYNC(dvp) ? 0 : IO_SYNC), curthread->td_ucred);
 		if (error != 0 && error != ERELOOKUP) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110270045.19R0jIgq011185>