Skip to contentSkip to conversation

xfs: Remove unused function xrep_dir_self_parent

PATCH In review Jiapeng Chong 2 participants 2 messages Apr 24, 2024 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: Remove unused function xrep_dir_self_parent

The function are defined in the dir_repair.c file, but not called elsewhere, so delete the unused function.

fs/xfs/scrub/dir_repair.c:186:1: warning: unused function 'xrep_dir_self_parent'.

---
 fs/xfs/scrub/dir_repair.c | 21 ---------------------
 1 file changed, 21 deletions(-)
fs/xfs/scrub/dir_repair.c +0 -21
index 38957da26b94..f8450c7f99f4 100644
@@ -176,27 +176,6 @@ xrep_setup_directory(
 	return 0;
 }
 
-/*
- * If we're the root of a directory tree, we are our own parent.  If we're an
- * unlinked directory, the parent /won't/ have a link to us.  Set the parent
- * directory to the root for both cases.  Returns NULLFSINO if we don't know
- * what to do.
- */
-static inline xfs_ino_t
-xrep_dir_self_parent(
-	struct xrep_dir		*rd)
-{
-	struct xfs_scrub	*sc = rd->sc;
-
-	if (sc->ip->i_ino == sc->mp->m_sb.sb_rootino)
-		return sc->mp->m_sb.sb_rootino;
-
-	if (VFS_I(sc->ip)->i_nlink == 0)
-		return sc->mp->m_sb.sb_rootino;
-
-	return NULLFSINO;
-}
-
 /*
  * Look up the dotdot entry and confirm that it's really the parent.
  * Returns NULLFSINO if we don't know what to do.
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jiapeng Chong

The function are defined in the dir_repair.c file, but not called elsewhere, so delete the unused function.

fs/xfs/scrub/dir_repair.c:186:1: warning: unused function 'xrep_dir_self_parent'.

Yep, not used anywhere in my patchsets. Thank you for catching this and cleaning it up.

--D

Quoted 40 lines
---
 fs/xfs/scrub/dir_repair.c | 21 ---------------------
 1 file changed, 21 deletions(-)
fs/xfs/scrub/dir_repair.c +0 -21
index 38957da26b94..f8450c7f99f4 100644
@@ -176,27 +176,6 @@ xrep_setup_directory(
 	return 0;
 }
 
-/*
- * If we're the root of a directory tree, we are our own parent.  If we're an
- * unlinked directory, the parent /won't/ have a link to us.  Set the parent
- * directory to the root for both cases.  Returns NULLFSINO if we don't know
- * what to do.
- */
-static inline xfs_ino_t
-xrep_dir_self_parent(
-	struct xrep_dir		*rd)
-{
-	struct xfs_scrub	*sc = rd->sc;
-
-	if (sc->ip->i_ino == sc->mp->m_sb.sb_rootino)
-		return sc->mp->m_sb.sb_rootino;
-
-	if (VFS_I(sc->ip)->i_nlink == 0)
-		return sc->mp->m_sb.sb_rootino;
-
-	return NULLFSINO;
-}
-
 /*
  * Look up the dotdot entry and confirm that it's really the parent.
  * Returns NULLFSINO if we don't know what to do.
Signature · 1 line
2.20.1.7.g153144c