]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
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() | |
5 | ||
6 | In order to allow modules to use it without having to export vfsmount_lock. | |
7 | ||
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> | |
11 | --- | |
12 | fs/namespace.c | 8 ++++++-- | |
13 | include/linux/mnt_namespace.h | 9 +-------- | |
14 | 2 files changed, 7 insertions(+), 10 deletions(-) | |
15 | ||
16 | --- a/fs/namespace.c | |
17 | +++ b/fs/namespace.c | |
18 | @@ -2310,10 +2310,14 @@ void __init mnt_init(void) | |
19 | init_mount_tree(); | |
20 | } | |
21 | ||
22 | -void __put_mnt_ns(struct mnt_namespace *ns) | |
23 | +void put_mnt_ns(struct mnt_namespace *ns) | |
24 | { | |
25 | - struct vfsmount *root = ns->root; | |
26 | + struct vfsmount *root; | |
27 | LIST_HEAD(umount_list); | |
28 | + | |
29 | + if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | |
30 | + return; | |
31 | + root = ns->root; | |
32 | ns->root = NULL; | |
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 { | |
38 | ||
39 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, | |
40 | struct fs_struct *); | |
41 | -extern void __put_mnt_ns(struct mnt_namespace *ns); | |
42 | - | |
43 | -static inline void put_mnt_ns(struct mnt_namespace *ns) | |
44 | -{ | |
45 | - if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | |
46 | - /* releases vfsmount_lock */ | |
47 | - __put_mnt_ns(ns); | |
48 | -} | |
49 | +extern void put_mnt_ns(struct mnt_namespace *ns); | |
50 | ||
51 | static inline void exit_mnt_ns(struct task_struct *p) | |
52 | { |