Skip to contentSkip to conversation

repair: remove the ip variable in ensure_rtgroup_file

PATCH In review Christoph Hellwig 2 participants 2 messages Sep 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 repair: remove the ip variable in ensure_rtgroup_file

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.

---
 repair/phase6.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
repair/phase6.c +3 -5
index 326fdfa3afb4..f3951a3d0709 100644
@@ -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;
 }
 
Signature · 1 line
2.53.0