Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758018AbZFVTVu (ORCPT ); Mon, 22 Jun 2009 15:21:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756898AbZFVTVF (ORCPT ); Mon, 22 Jun 2009 15:21:05 -0400 Received: from mx2.netapp.com ([216.240.18.37]:6263 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbZFVTU6 (ORCPT ); Mon, 22 Jun 2009 15:20:58 -0400 X-IronPort-AV: E=Sophos;i="4.42,270,1243839600"; d="scan'208";a="194527923" From: Trond Myklebust Subject: [PATCH 1/5] VFS: Uninline the function put_mnt_ns() To: Linus Torvalds Cc: Al Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 22 Jun 2009 15:09:13 -0400 Message-ID: <20090622190913.27923.64996.stgit@heimdal.trondhjem.org> In-Reply-To: <20090622190913.27923.31665.stgit@heimdal.trondhjem.org> References: <20090622190913.27923.31665.stgit@heimdal.trondhjem.org> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: Evolution 2.26.1 X-OriginalArrivalTime: 22 Jun 2009 19:20:59.0953 (UTC) FILETIME=[93458A10:01C9F36E] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1735 Lines: 57 In order to allow modules to use it without having to export vfsmount_lock. Signed-off-by: Trond Myklebust --- 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) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/