summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-22 15:09:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-22 21:28:25 -0700
commit616511d039af402670de8500d0e24495113a9cab (patch)
tree825a34ab670dedc463ba7252a177793746c010c7
parent31950eb66ff47c946fd9c65c2f8c94b6b7ba13fc (diff)
downloadop-kernel-dev-616511d039af402670de8500d0e24495113a9cab.zip
op-kernel-dev-616511d039af402670de8500d0e24495113a9cab.tar.gz
VFS: Uninline the function put_mnt_ns()
In order to allow modules to use it without having to export vfsmount_lock. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/namespace.c8
-rw-r--r--include/linux/mnt_namespace.h9
2 files changed, 7 insertions, 10 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 2dd333b..6645846 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2246,10 +2246,14 @@ void __init mnt_init(void)
init_mount_tree();
}
-void __put_mnt_ns(struct mnt_namespace *ns)
+void put_mnt_ns(struct mnt_namespace *ns)
{
- struct vfsmount *root = ns->root;
+ struct vfsmount *root;
LIST_HEAD(umount_list);
+
+ if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock))
+ return;
+ root = ns->root;
ns->root = NULL;
spin_unlock(&vfsmount_lock);
down_write(&namespace_sem);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 3a05929..299d11a 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -26,14 +26,7 @@ struct fs_struct;
extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
struct fs_struct *);
-extern void __put_mnt_ns(struct mnt_namespace *ns);
-
-static inline void put_mnt_ns(struct mnt_namespace *ns)
-{
- if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
- /* releases vfsmount_lock */
- __put_mnt_ns(ns);
-}
+extern void put_mnt_ns(struct mnt_namespace *ns);
static inline void exit_mnt_ns(struct task_struct *p)
{
OpenPOWER on IntegriCloud