Skip to contentSkip to conversation

mnt: Remove dead code which might prevent from building

PATCH Applied Andy Shevchenko 2 participants 2 messages Oct 24, 2025 – Oct 29, 2025 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mnt: Remove dead code which might prevent from building

Clang, in particular, is not happy about dead code:

fs/namespace.c:135:37: error: unused function 'node_to_mnt_ns' [-Werror,-Wunused-function]
135 | static inline struct mnt_namespace *node_to_mnt_ns(const struct rb_node *node)

      |                                     ^~~~~~~~~~~~~~

1 error generated.

Remove a leftover from the previous cleanup.

Fixes 7d7d16498958 ("mnt: support ns lookup")
---
 fs/namespace.c | 10 ----------
 1 file changed, 10 deletions(-)
fs/namespace.c +0 -10
index d82910f33dc4..9145bb02e9b7 100644
@@ -132,16 +132,6 @@ EXPORT_SYMBOL_GPL(fs_kobj);
  */
 __cacheline_aligned_in_smp DEFINE_SEQLOCK(mount_lock);
 
-static inline struct mnt_namespace *node_to_mnt_ns(const struct rb_node *node)
-{
-	struct ns_common *ns;
-
-	if (!node)
-		return NULL;
-	ns = rb_entry(node, struct ns_common, ns_tree_node);
-	return container_of(ns, struct mnt_namespace, ns);
-}
-
 static void mnt_ns_release(struct mnt_namespace *ns)
 {
 	/* keep alive for {list,stat}mount() */
Signature · 1 line
2.50.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Andy Shevchenko

Clang, in particular, is not happy about dead code:

fs/namespace.c:135:37: error: unused function 'node_to_mnt_ns' [-Werror,-Wunused-function]
135 | static inline struct mnt_namespace *node_to_mnt_ns(const struct rb_node *node)

      |                                     ^~~~~~~~~~~~~~

1 error generated.

[...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] mnt: Remove dead code which might prevent from building

      https://git.kernel.org/vfs/vfs/c/9db8d46712d2