diff options
Diffstat (limited to 'include/linux/taskstats_kern.h')
-rw-r--r-- | include/linux/taskstats_kern.h | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 6562a2050a25..7e9680f4afdd 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
@@ -12,64 +12,27 @@ | |||
12 | #include <net/genetlink.h> | 12 | #include <net/genetlink.h> |
13 | 13 | ||
14 | #ifdef CONFIG_TASKSTATS | 14 | #ifdef CONFIG_TASKSTATS |
15 | extern kmem_cache_t *taskstats_cache; | 15 | extern struct kmem_cache *taskstats_cache; |
16 | extern struct mutex taskstats_exit_mutex; | 16 | extern struct mutex taskstats_exit_mutex; |
17 | 17 | ||
18 | static inline void taskstats_exit_free(struct taskstats *tidstats) | ||
19 | { | ||
20 | if (tidstats) | ||
21 | kmem_cache_free(taskstats_cache, tidstats); | ||
22 | } | ||
23 | |||
24 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 18 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
25 | { | 19 | { |
26 | sig->stats = NULL; | 20 | sig->stats = NULL; |
27 | } | 21 | } |
28 | 22 | ||
29 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) | ||
30 | { | ||
31 | struct signal_struct *sig = tsk->signal; | ||
32 | struct taskstats *stats; | ||
33 | |||
34 | if (sig->stats != NULL) | ||
35 | return; | ||
36 | |||
37 | /* No problem if kmem_cache_zalloc() fails */ | ||
38 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | ||
39 | |||
40 | spin_lock_irq(&tsk->sighand->siglock); | ||
41 | if (!sig->stats) { | ||
42 | sig->stats = stats; | ||
43 | stats = NULL; | ||
44 | } | ||
45 | spin_unlock_irq(&tsk->sighand->siglock); | ||
46 | |||
47 | if (stats) | ||
48 | kmem_cache_free(taskstats_cache, stats); | ||
49 | } | ||
50 | |||
51 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 23 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
52 | { | 24 | { |
53 | if (sig->stats) | 25 | if (sig->stats) |
54 | kmem_cache_free(taskstats_cache, sig->stats); | 26 | kmem_cache_free(taskstats_cache, sig->stats); |
55 | } | 27 | } |
56 | 28 | ||
57 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); | 29 | extern void taskstats_exit(struct task_struct *, int group_dead); |
58 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); | ||
59 | extern void taskstats_init_early(void); | 30 | extern void taskstats_init_early(void); |
60 | #else | 31 | #else |
61 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | 32 | static inline void taskstats_exit(struct task_struct *tsk, int group_dead) |
62 | {} | ||
63 | static inline void taskstats_exit_free(struct taskstats *ptidstats) | ||
64 | {} | ||
65 | static inline void taskstats_exit_send(struct task_struct *tsk, | ||
66 | struct taskstats *tidstats, | ||
67 | int group_dead, unsigned int cpu) | ||
68 | {} | 33 | {} |
69 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 34 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
70 | {} | 35 | {} |
71 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) | ||
72 | {} | ||
73 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 36 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
74 | {} | 37 | {} |
75 | static inline void taskstats_init_early(void) | 38 | static inline void taskstats_init_early(void) |