1 From 616511d039af402670de8500d0e24495113a9cab Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Mon, 22 Jun 2009 15:09:13 -0400
4 Subject: [PATCH 1/5] VFS: Uninline the function put_mnt_ns()
6 In order to allow modules to use it without having to export vfsmount_lock.
8 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
9 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 Acked-by: NeilBrown <neilb@suse.de>
12 fs/namespace.c | 8 ++++++--
13 include/linux/mnt_namespace.h | 9 +--------
14 2 files changed, 7 insertions(+), 10 deletions(-)
18 @@ -2310,10 +2310,14 @@ void __init mnt_init(void)
22 -void __put_mnt_ns(struct mnt_namespace *ns)
23 +void put_mnt_ns(struct mnt_namespace *ns)
25 - struct vfsmount *root = ns->root;
26 + struct vfsmount *root;
27 LIST_HEAD(umount_list);
29 + if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock))
33 spin_unlock(&vfsmount_lock);
34 down_write(&namespace_sem);
35 --- a/include/linux/mnt_namespace.h
36 +++ b/include/linux/mnt_namespace.h
37 @@ -24,14 +24,7 @@ struct proc_mounts {
39 extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
41 -extern void __put_mnt_ns(struct mnt_namespace *ns);
43 -static inline void put_mnt_ns(struct mnt_namespace *ns)
45 - if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
46 - /* releases vfsmount_lock */
49 +extern void put_mnt_ns(struct mnt_namespace *ns);
51 static inline void exit_mnt_ns(struct task_struct *p)