repair: remove the ip variable in ensure_rtgroup_file
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.
Signed-off-by Christoph Hellwig <[email protected]>
--- repair/phase6.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
repair/phase6.c +3 -5
@@ -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
Quoted 5 lines · Christoph Hellwig
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 <[email protected]>
Looks good to me
Reviewed-by Andrey Albershteyn <[email protected]>
Signature · 1 line
- Andrey