OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2/4] pid: Make next_pidmap static again
[PATCH 2/4] pid: Make next_pidmap static again [message #24955] Wed, 12 December 2007 13:50 Go to next message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Now that we are using kill_pid_ns_info in zap_pid_ns_processes
the only user of next_pidmap is pid.c so we can make
next_pidmap static.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 include/linux/pid.h |    1 -
 kernel/pid.c        |    2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/linux/pid.h b/include/linux/pid.h
index e409cc5..b18c15c 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -118,7 +118,6 @@ extern struct pid *find_pid(int nr);
  */
 extern struct pid *find_get_pid(int nr);
 extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
-int next_pidmap(struct pid_namespace *pid_ns, int last);
 
 extern struct pid *alloc_pid(struct pid_namespace *ns);
 extern void FASTCALL(free_pid(struct pid *pid));
diff --git a/kernel/pid.c b/kernel/pid.c
index 294fc28..5a1f0d0 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -180,7 +180,7 @@ static int alloc_pidmap(struct pid_namespace *pid_ns)
 	return -1;
 }
 
-int next_pidmap(struct pid_namespace *pid_ns, int last)
+static int next_pidmap(struct pid_namespace *pid_ns, int last)
 {
 	int offset;
 	struct pidmap *map, *end;
-- 
1.5.3.rc6.17.g1911

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
[PATCH 3/4] Fix the indentation in cap_set_all to use tabs. [message #24966 is a reply to message #24955] Wed, 12 December 2007 13:52 Go to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
So my next patch is readable...

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 kernel/capability.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/kernel/capability.c b/kernel/capability.c
index 39e8193..652a2c5 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -198,24 +198,24 @@ static inline int cap_set_all(kernel_cap_t *effective,
 			       kernel_cap_t *inheritable,
 			       kernel_cap_t *permitted)
 {
-     struct task_struct *g, *target;
-     int ret = -EPERM;
-     int found = 0;
-
-     do_each_thread(g, target) {
-             if (target == current || is_container_init(target->group_leader))
-                     continue;
-             found = 1;
-	     if (security_capset_check(target, effective, inheritable,
+	struct task_struct *g, *target;
+	int ret = -EPERM;
+	int found = 0;
+
+	do_each_thread(g, target) {
+		if (target == current || is_container_init(target->group_leader))
+			continue;
+		found = 1;
+		if (security_capset_check(target, effective, inheritable,
 						permitted))
-		     continue;
-	     ret = 0;
-	     security_capset_set(target, effective, inheritable, permitted);
-     } while_each_thread(g, target);
-
-     if (!found)
-	     ret = 0;
-     return ret;
+			continue;
+		ret = 0;
+		security_capset_set(target, effective, inheritable, permitted);
+	} while_each_thread(g, target);
+
+	if (!found)
+		ret = 0;
+	return ret;
 }
 
 /**
-- 
1.5.3.rc6.17.g1911

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: capturing init output
Next Topic: [PATCH 4/4] pid: Limit cap_set_all to the current pid namespace
Goto Forum:
  


Current Time: Sun Aug 17 21:26:47 GMT 2025

Total time taken to generate the page: 0.22843 seconds