From nobody Wed Oct 27 00:45:18 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C829518183FB; Wed, 27 Oct 2021 00:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hf92l3HLzz3kYc; Wed, 27 Oct 2021 00:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 889A2268B7; Wed, 27 Oct 2021 00:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19R0jIZQ011186; Wed, 27 Oct 2021 00:45:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19R0jIgq011185; Wed, 27 Oct 2021 00:45:18 GMT (envelope-from git) Date: Wed, 27 Oct 2021 00:45:18 GMT Message-Id: <202110270045.19R0jIgq011185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c026e9c5d3cd - stable/13 - ufs: remove write-only variables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c026e9c5d3cdc80ca31e25173783678ebdc844ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c026e9c5d3cdc80ca31e25173783678ebdc844ea commit c026e9c5d3cdc80ca31e25173783678ebdc844ea Author: Konstantin Belousov AuthorDate: 2021-10-20 01:42:31 +0000 Commit: Konstantin Belousov 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) {