[Devel] [patch -mm 03/17] namespace : export unshare of namespace and fs_struct
clg at fr.ibm.com
clg at fr.ibm.com
Tue Dec 5 02:27:55 PST 2006
From: Cedric Le Goater <clg at fr.ibm.com>
This is needed by the unshare_ns syscall.
Signed-off-by: Cedric Le Goater <clg at fr.ibm.com>
---
include/linux/mnt_namespace.h | 4 ++++
kernel/fork.c | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
Index: 2.6.19-rc6-mm2/include/linux/mnt_namespace.h
===================================================================
--- 2.6.19-rc6-mm2.orig/include/linux/mnt_namespace.h
+++ 2.6.19-rc6-mm2/include/linux/mnt_namespace.h
@@ -14,6 +14,10 @@ struct mnt_namespace {
int event;
};
+extern int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp);
+extern int unshare_mnt_ns(unsigned long unshare_flags,
+ struct mnt_namespace **new_nsp,
+ struct fs_struct *new_fs);
extern int copy_mnt_ns(int, struct task_struct *);
extern void __put_mnt_ns(struct mnt_namespace *ns);
extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
Index: 2.6.19-rc6-mm2/kernel/fork.c
===================================================================
--- 2.6.19-rc6-mm2.orig/kernel/fork.c
+++ 2.6.19-rc6-mm2/kernel/fork.c
@@ -1498,7 +1498,7 @@ static int unshare_thread(unsigned long
/*
* Unshare the filesystem structure if it is being shared
*/
-static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
+extern int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
{
struct fs_struct *fs = current->fs;
@@ -1515,7 +1515,7 @@ static int unshare_fs(unsigned long unsh
/*
* Unshare the mnt_namespace structure if it is being shared
*/
-static int unshare_mnt_namespace(unsigned long unshare_flags,
+extern int unshare_mnt_ns(unsigned long unshare_flags,
struct mnt_namespace **new_nsp, struct fs_struct *new_fs)
{
struct mnt_namespace *ns = current->nsproxy->mnt_ns;
@@ -1634,7 +1634,7 @@ asmlinkage long sys_unshare(unsigned lon
goto bad_unshare_out;
if ((err = unshare_fs(unshare_flags, &new_fs)))
goto bad_unshare_cleanup_thread;
- if ((err = unshare_mnt_namespace(unshare_flags, &new_ns, new_fs)))
+ if ((err = unshare_mnt_ns(unshare_flags, &new_ns, new_fs)))
goto bad_unshare_cleanup_fs;
if ((err = unshare_sighand(unshare_flags, &new_sigh)))
goto bad_unshare_cleanup_ns;
--
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
More information about the Devel
mailing list