Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24926
b: refs/heads/master
c: 158d9eb
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 31, 2006
1 parent ce09e10 commit a540d77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 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: 390e2ff07712468ce6600a43aa91e897b056ce12
refs/heads/master: 158d9ebd19280582da172626ad3edda1a626dace
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)

extern void __put_task_struct_cb(struct rcu_head *rhp);
extern void __put_task_struct(struct task_struct *t);

static inline void put_task_struct(struct task_struct *t)
{
Expand Down
10 changes: 7 additions & 3 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ void free_task(struct task_struct *tsk)
}
EXPORT_SYMBOL(free_task);

void __put_task_struct_cb(struct rcu_head *rhp)
void __put_task_struct(struct task_struct *tsk)
{
struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);

WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE)));
WARN_ON(atomic_read(&tsk->usage));
WARN_ON(tsk == current);
Expand All @@ -126,6 +124,12 @@ void __put_task_struct_cb(struct rcu_head *rhp)
free_task(tsk);
}

void __put_task_struct_cb(struct rcu_head *rhp)
{
struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);
__put_task_struct(tsk);
}

void __init fork_init(unsigned long mempages)
{
#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
Expand Down

0 comments on commit a540d77

Please sign in to comment.