#include <linux/taskstats.h>
#include <linux/sched.h>
-
-enum {
- TASKSTATS_MSG_UNICAST, /* send data only to requester */
- TASKSTATS_MSG_MULTICAST, /* send data to a group */
-};
+#include <net/genetlink.h>
#ifdef CONFIG_TASKSTATS
-extern kmem_cache_t *taskstats_cache;
+extern struct kmem_cache *taskstats_cache;
+extern struct mutex taskstats_exit_mutex;
-static inline void taskstats_exit_alloc(struct taskstats **ptidstats,
- struct taskstats **ptgidstats)
+static inline void taskstats_tgid_init(struct signal_struct *sig)
{
- *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
- *ptgidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
+ sig->stats = NULL;
}
-static inline void taskstats_exit_free(struct taskstats *tidstats,
- struct taskstats *tgidstats)
+static inline void taskstats_tgid_free(struct signal_struct *sig)
{
- if (tidstats)
- kmem_cache_free(taskstats_cache, tidstats);
- if (tgidstats)
- kmem_cache_free(taskstats_cache, tgidstats);
+ if (sig->stats)
+ kmem_cache_free(taskstats_cache, sig->stats);
}
-extern void taskstats_exit_send(struct task_struct *, struct taskstats *,
- struct taskstats *);
+extern void taskstats_exit(struct task_struct *, int group_dead);
extern void taskstats_init_early(void);
-
#else
-static inline void taskstats_exit_alloc(struct taskstats **ptidstats,
- struct taskstats **ptgidstats)
+static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
{}
-static inline void taskstats_exit_free(struct taskstats *ptidstats,
- struct taskstats *ptgidstats)
+static inline void taskstats_tgid_init(struct signal_struct *sig)
{}
-static inline void taskstats_exit_send(struct task_struct *tsk,
- struct taskstats *tidstats,
- struct taskstats *tgidstats)
+static inline void taskstats_tgid_free(struct signal_struct *sig)
{}
static inline void taskstats_init_early(void)
{}