1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
Index: linux-2.6.17/kernel/vserver/namespace.c
===================================================================
--- linux-2.6.17.orig/kernel/vserver/namespace.c
+++ linux-2.6.17/kernel/vserver/namespace.c
@@ -3,10 +3,11 @@
*
* Virtual Server: Context Namespace Support
*
- * Copyright (C) 2003-2005 Herbert P�tzl
+ * Copyright (C) 2003-2006 Herbert P�tzl
*
* V0.01 broken out from context.c 0.07
* V0.02 added task locking for namespace
+ * V0.03 broken out vx_enter_namespace
*
*/
@@ -27,26 +28,7 @@
#include <linux/namespace.h>
-int vx_set_namespace(struct vx_info *vxi, struct namespace *ns, struct fs_struct *fs)
-{
- struct fs_struct *fs_copy;
-
- if (vxi->vx_namespace)
- return -EPERM;
- if (!ns || !fs)
- return -EINVAL;
-
- fs_copy = copy_fs_struct(fs);
- if (!fs_copy)
- return -ENOMEM;
-
- get_namespace(ns);
- vxi->vx_namespace = ns;
- vxi->vx_fs = fs_copy;
- return 0;
-}
-
-int vc_enter_namespace(struct vx_info *vxi, void __user *data)
+int vx_enter_namespace(struct vx_info *vxi)
{
struct fs_struct *old_fs, *fs;
struct namespace *old_ns;
@@ -73,6 +55,30 @@ int vc_enter_namespace(struct vx_info *v
return 0;
}
+int vx_set_namespace(struct vx_info *vxi, struct namespace *ns, struct fs_struct *fs)
+{
+ struct fs_struct *fs_copy;
+
+ if (vxi->vx_namespace)
+ return -EPERM;
+ if (!ns || !fs)
+ return -EINVAL;
+
+ fs_copy = copy_fs_struct(fs);
+ if (!fs_copy)
+ return -ENOMEM;
+
+ get_namespace(ns);
+ vxi->vx_namespace = ns;
+ vxi->vx_fs = fs_copy;
+ return 0;
+}
+
+int vc_enter_namespace(struct vx_info *vxi, void __user *data)
+{
+ return vx_enter_namespace(vxi);
+}
+
int vc_set_namespace(struct vx_info *vxi, void __user *data)
{
struct fs_struct *fs;
|