Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95246
b: refs/heads/master
c: b7127aa
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 30, 2008
1 parent cf29ba1 commit 09aba59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 718a916338e821a10961e6a7a17430c18e5e58d9
refs/heads/master: b7127aa4547d8cc8a5b569631e2b6ef613af1bb7
13 changes: 7 additions & 6 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ EXPORT_SYMBOL(is_container_init);

static __cacheline_aligned_in_smp DEFINE_SPINLOCK(pidmap_lock);

static void free_pidmap(struct pid_namespace *pid_ns, int pid)
static void free_pidmap(struct upid *upid)
{
struct pidmap *map = pid_ns->pidmap + pid / BITS_PER_PAGE;
int offset = pid & BITS_PER_PAGE_MASK;
int nr = upid->nr;
struct pidmap *map = upid->ns->pidmap + nr / BITS_PER_PAGE;
int offset = nr & BITS_PER_PAGE_MASK;

clear_bit(offset, map->page);
atomic_inc(&map->nr_free);
Expand Down Expand Up @@ -232,7 +233,7 @@ void free_pid(struct pid *pid)
spin_unlock_irqrestore(&pidmap_lock, flags);

for (i = 0; i <= pid->level; i++)
free_pidmap(pid->numbers[i].ns, pid->numbers[i].nr);
free_pidmap(pid->numbers + i);

call_rcu(&pid->rcu, delayed_put_pid);
}
Expand Down Expand Up @@ -278,8 +279,8 @@ struct pid *alloc_pid(struct pid_namespace *ns)
return pid;

out_free:
for (i++; i <= ns->level; i++)
free_pidmap(pid->numbers[i].ns, pid->numbers[i].nr);
while (++i <= ns->level)
free_pidmap(pid->numbers + i);

kmem_cache_free(ns->pid_cachep, pid);
pid = NULL;
Expand Down

0 comments on commit 09aba59

Please sign in to comment.