Skip to content

Commit

Permalink
[PATCH] remove __put_task_struct_cb export again
Browse files Browse the repository at this point in the history
The patch '[PATCH] RCU signal handling' [1] added an export for
__put_task_struct_cb, a put_task_struct helper newly introduced in that
patch.  But the put_task_struct couldn't be used modular previously as
__put_task_struct wasn't exported.  There are not callers of it in modular
code, and it shouldn't be exported because we don't want drivers to hold
references to task_structs.

This patch removes the export and folds __put_task_struct into
__put_task_struct_cb as there's no other caller.

[1] http://www2.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e56d090310d7625ecb43a1eeebd479f04affb48b

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Mar 11, 2006
1 parent 27d162e commit 7cd9013
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ static inline int pid_alive(struct task_struct *p)
}

extern void free_task(struct task_struct *tsk);
extern void __put_task_struct(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);
Expand Down
4 changes: 3 additions & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ void free_task(struct task_struct *tsk)
}
EXPORT_SYMBOL(free_task);

void __put_task_struct(struct task_struct *tsk)
void __put_task_struct_cb(struct rcu_head *rhp)
{
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 Down
7 changes: 0 additions & 7 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ static unsigned int task_timeslice(task_t *p)
#define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran) \
< (long long) (sd)->cache_hot_time)

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

EXPORT_SYMBOL_GPL(__put_task_struct_cb);

/*
* These are the runqueue data structures:
*/
Expand Down

0 comments on commit 7cd9013

Please sign in to comment.