Skip to content

Commit

Permalink
VFS: Uninline the function put_mnt_ns()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Jun 23, 2009
1 parent 31950eb commit 616511d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 6 additions & 2 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 1 addition & 8 deletions include/linux/mnt_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 616511d

Please sign in to comment.