patch-2.4.19 linux-2.4.19/kernel/kmod.c
Next file: linux-2.4.19/kernel/ksyms.c
Previous file: linux-2.4.19/kernel/fork.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Fri Aug 2 17:39:46 2002
- Orig file:
linux-2.4.18/kernel/kmod.c
- Orig date:
Tue Jul 17 18:23:50 2001
diff -urN linux-2.4.18/kernel/kmod.c linux-2.4.19/kernel/kmod.c
@@ -24,6 +24,8 @@
#include <linux/unistd.h>
#include <linux/kmod.h>
#include <linux/smp_lock.h>
+#include <linux/slab.h>
+#include <linux/namespace.h>
#include <linux/completion.h>
#include <asm/uaccess.h>
@@ -36,6 +38,7 @@
struct fs_struct *our_fs, *init_fs;
struct dentry *root, *pwd;
struct vfsmount *rootmnt, *pwdmnt;
+ struct namespace *our_ns, *init_ns;
/*
* Make modprobe's fs context be a copy of init's.
@@ -55,6 +58,11 @@
*/
init_fs = init_task.fs;
+ init_ns = init_task.namespace;
+ get_namespace(init_ns);
+ our_ns = current->namespace;
+ current->namespace = init_ns;
+ put_namespace(our_ns);
read_lock(&init_fs->lock);
rootmnt = mntget(init_fs->rootmnt);
root = dget(init_fs->root);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)