public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] VFS: Uninline the function put_mnt_ns()
Date: Mon, 22 Jun 2009 15:09:13 -0400	[thread overview]
Message-ID: <20090622190913.27923.64996.stgit@heimdal.trondhjem.org> (raw)
In-Reply-To: <20090622190913.27923.31665.stgit@heimdal.trondhjem.org>

In order to allow modules to use it without having to export vfsmount_lock.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/namespace.c                |    8 ++++++--
 include/linux/mnt_namespace.h |    9 +--------
 2 files changed, 7 insertions(+), 10 deletions(-)


diff --git a/fs/namespace.c b/fs/namespace.c
index 2dd333b..2465c05 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -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);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 3a05929..299d11a 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -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)
 {


  reply	other threads:[~2009-06-22 19:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 19:09 [PATCH 0/5] NFS private namespace patchset Trond Myklebust
2009-06-22 19:09 ` Trond Myklebust [this message]
     [not found] ` <20090622190913.27923.31665.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-22 19:09   ` [PATCH 2/5] VFS: Add VFS helper functions for setting up private namespaces Trond Myklebust
     [not found]     ` <20090622190913.27923.61549.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-23 20:13       ` Serge E. Hallyn
2009-06-23 21:29         ` Trond Myklebust
2009-06-23 22:32           ` Serge E. Hallyn
2009-06-24  2:51             ` Linus Torvalds
2009-06-22 19:09   ` [PATCH 5/5] NFS: Correct the NFS mount path when following a referral Trond Myklebust
     [not found]     ` <20090622190914.27923.84173.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-23 20:42       ` Serge E. Hallyn
2009-06-23 21:15         ` Trond Myklebust
2009-06-22 19:09   ` [PATCH 4/5] NFS: Fix nfs_path() to always return a '/' at the beginning of the path Trond Myklebust
2009-06-22 19:09 ` [PATCH 3/5] NFSv4: Replace nfs4_path_walk() with VFS path lookup in a private namespace Trond Myklebust
2009-06-22 19:40 ` [PATCH 0/5] NFS private namespace patchset Linus Torvalds
2009-06-23 21:33   ` Al Viro
2009-06-23 21:40     ` Linus Torvalds
2009-06-23 23:22       ` Al Viro
2009-06-24 12:58         ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090622190913.27923.64996.stgit@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox