Skip to contentSkip to conversation

mount: Make function to_mnt_ns static

PATCH In review Mathieu Malaterre 1 participant 2 messages Dec 7, 2018 – Jan 16, 2019 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount: Make function to_mnt_ns static

In commit 58be28256d98 ("make mntns ->get()/->put()/->install()/->inum() work with &mnt_ns->ns"), a new function to_mnt_ns was introduced. Since this function can be made static, make it so.

Fix warning when compiling with W=1:

fs/namespace.c:1693:23: warning: no previous prototype for ‘to_mnt_ns’ [-Wmissing-prototypes]

---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namespace.c +1 -1
index a7f91265ea67..f0cf252d9aa3 100644
@@ -1690,7 +1690,7 @@ static bool is_mnt_ns_file(struct dentry *dentry)
 	       dentry->d_fsdata == &mntns_operations;
 }
 
-struct mnt_namespace *to_mnt_ns(struct ns_common *ns)
+static struct mnt_namespace *to_mnt_ns(struct ns_common *ns)
 {
 	return container_of(ns, struct mnt_namespace, ns);
 }
Signature · 1 line
2.19.2
#1 lore raw

ping ?

Quoted 30 lines · Mathieu Malaterre

In commit 58be28256d98 ("make mntns ->get()/->put()/->install()/->inum() work with &mnt_ns->ns"), a new function to_mnt_ns was introduced. Since this function can be made static, make it so.

Fix warning when compiling with W=1:

fs/namespace.c:1693:23: warning: no previous prototype for ‘to_mnt_ns’ [-Wmissing-prototypes]

---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namespace.c +1 -2
index a7f91265ea67..f0cf252d9aa3 100644
@@ -1690,7 +1690,7 @@ static bool is_mnt_ns_file(struct dentry *dentry)
               dentry->d_fsdata == &mntns_operations;
 }
 
-struct mnt_namespace *to_mnt_ns(struct ns_common *ns)
+static struct mnt_namespace *to_mnt_ns(struct ns_common *ns)
 {
        return container_of(ns, struct mnt_namespace, ns);
 }
--

2.19.2