Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: aalbersh@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH] repair: remove the ip variable in ensure_rtgroup_file
Date: Fri, 11 Sep 2026 09:05:48 +0200	[thread overview]
Message-ID: <20260911070548.1760348-1-hch@lst.de> (raw)

The values is never used after the first initialization, and only twice
after the second one.  Open code the dereferences for those to remove
the dead assignment and to keep the code simple.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 repair/phase6.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/repair/phase6.c b/repair/phase6.c
index 326fdfa3afb4..f3951a3d0709 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -622,7 +622,6 @@ ensure_rtgroup_file(
 	enum xfs_rtg_inodes	type)
 {
 	struct xfs_mount	*mp = rtg_mount(rtg);
-	struct xfs_inode	*ip = rtg->rtg_inodes[type];
 	const char		*name = libxfs_rtginode_name(type);
 	int			error;
 
@@ -651,11 +650,10 @@ ensure_rtgroup_file(
 _("Couldn't create rtgroup %u %s inode, error %d\n"),
 			rtg_rgno(rtg), name, error);
 
-	ip = rtg->rtg_inodes[type];
-
 	/* Mark the inode in use. */
-	mark_ino_inuse(mp, I_INO(ip), S_IFREG, I_INO(mp->m_rtdirip));
-	mark_ino_metadata(mp, I_INO(ip));
+	mark_ino_inuse(mp, I_INO(rtg->rtg_inodes[type]), S_IFREG,
+			I_INO(mp->m_rtdirip));
+	mark_ino_metadata(mp, I_INO(rtg->rtg_inodes[type]));
 	return true;
 }
 
-- 
2.53.0


             reply	other threads:[~2026-09-11  7:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  7:05 Christoph Hellwig [this message]
2026-09-11 11:06 ` [PATCH] repair: remove the ip variable in ensure_rtgroup_file Andrey Albershteyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260911070548.1760348-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=aalbersh@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox