Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334596
b: refs/heads/master
c: bbc2e3e
h: refs/heads/master
v: v3
  • Loading branch information
Cyrill Gorcunov authored and Linus Torvalds committed Oct 19, 2012
1 parent f28a285 commit dad9d21
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc36d7e7cd422d69b15e7ec7cc1f021f581a6b6d
refs/heads/master: bbc2e3ef87851bc5430b2b4cf4ca3a2f29baeda6
8 changes: 1 addition & 7 deletions trunk/include/linux/pid_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,9 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
}

extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
extern void free_pid_ns(struct kref *kref);
extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);

static inline void put_pid_ns(struct pid_namespace *ns)
{
if (ns != &init_pid_ns)
kref_put(&ns->kref, free_pid_ns);
}
extern void put_pid_ns(struct pid_namespace *ns);

#else /* !CONFIG_PID_NS */
#include <linux/err.h>
Expand Down
21 changes: 14 additions & 7 deletions trunk/kernel/pid_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,26 @@ struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old
return create_pid_namespace(old_ns);
}

void free_pid_ns(struct kref *kref)
static void free_pid_ns(struct kref *kref)
{
struct pid_namespace *ns, *parent;
struct pid_namespace *ns;

ns = container_of(kref, struct pid_namespace, kref);

parent = ns->parent;
destroy_pid_namespace(ns);
}

if (parent != NULL)
put_pid_ns(parent);
void put_pid_ns(struct pid_namespace *ns)
{
struct pid_namespace *parent;

while (ns != &init_pid_ns) {
parent = ns->parent;
if (!kref_put(&ns->kref, free_pid_ns))
break;
ns = parent;
}
}
EXPORT_SYMBOL_GPL(free_pid_ns);
EXPORT_SYMBOL_GPL(put_pid_ns);

void zap_pid_ns_processes(struct pid_namespace *pid_ns)
{
Expand Down

0 comments on commit dad9d21

Please sign in to comment.