]> git.hungrycats.org Git - linux/commitdiff
[PATCH] unline most of put_namespace()
authorAndrew Morton <akpm@osdl.org>
Fri, 18 Jul 2003 02:26:41 +0000 (19:26 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 18 Jul 2003 02:26:41 +0000 (19:26 -0700)
It has five callsites, and is big.

fs/namespace.c
include/linux/namespace.h

index 12a8c814682955eefaa46d708cc44f6eb89da924..8a3552bd666034d0595b1b504267e5877e414bd7 100644 (file)
@@ -1158,3 +1158,13 @@ void __init mnt_init(unsigned long mempages)
        init_rootfs();
        init_mount_tree();
 }
+
+void __put_namespace(struct namespace *namespace)
+{
+       down_write(&namespace->sem);
+       spin_lock(&vfsmount_lock);
+       umount_tree(namespace->root);
+       spin_unlock(&vfsmount_lock);
+       up_write(&namespace->sem);
+       kfree(namespace);
+}
index b5699538afac57f6e6f165c0a2de8c3c33a17656..fdd8abb07386b8750d96676c5312825a06da182c 100644 (file)
@@ -14,17 +14,12 @@ struct namespace {
 
 extern void umount_tree(struct vfsmount *);
 extern int copy_namespace(int, struct task_struct *);
+void __put_namespace(struct namespace *namespace);
 
 static inline void put_namespace(struct namespace *namespace)
 {
-       if (atomic_dec_and_test(&namespace->count)) {
-               down_write(&namespace->sem);
-               spin_lock(&vfsmount_lock);
-               umount_tree(namespace->root);
-               spin_unlock(&vfsmount_lock);
-               up_write(&namespace->sem);
-               kfree(namespace);
-       }
+       if (atomic_dec_and_test(&namespace->count))
+               __put_namespace(namespace);
 }
 
 static inline void exit_namespace(struct task_struct *p)