Commit 16096694 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] unline most of put_namespace()

It has five callsites, and is big.
parent 909cc4ae
...@@ -1158,3 +1158,13 @@ void __init mnt_init(unsigned long mempages) ...@@ -1158,3 +1158,13 @@ void __init mnt_init(unsigned long mempages)
init_rootfs(); init_rootfs();
init_mount_tree(); 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);
}
...@@ -14,17 +14,12 @@ struct namespace { ...@@ -14,17 +14,12 @@ struct namespace {
extern void umount_tree(struct vfsmount *); extern void umount_tree(struct vfsmount *);
extern int copy_namespace(int, struct task_struct *); extern int copy_namespace(int, struct task_struct *);
void __put_namespace(struct namespace *namespace);
static inline void put_namespace(struct namespace *namespace) static inline void put_namespace(struct namespace *namespace)
{ {
if (atomic_dec_and_test(&namespace->count)) { if (atomic_dec_and_test(&namespace->count))
down_write(&namespace->sem); __put_namespace(namespace);
spin_lock(&vfsmount_lock);
umount_tree(namespace->root);
spin_unlock(&vfsmount_lock);
up_write(&namespace->sem);
kfree(namespace);
}
} }
static inline void exit_namespace(struct task_struct *p) static inline void exit_namespace(struct task_struct *p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment