aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/pid.h2
-rw-r--r--include/linux/sched.h51
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/slab.h1
5 files changed, 24 insertions, 34 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 92146f3b7423..41ecbb847f32 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -62,6 +62,8 @@
62 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ 62 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
63 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ 63 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
64 .rlim = INIT_RLIMITS, \ 64 .rlim = INIT_RLIMITS, \
65 .pgrp = 1, \
66 .session = 1, \
65} 67}
66 68
67#define INIT_SIGHAND(sighand) { \ 69#define INIT_SIGHAND(sighand) { \
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 5b2fcb19d2da..5b9082cc600f 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -4,7 +4,6 @@
4enum pid_type 4enum pid_type
5{ 5{
6 PIDTYPE_PID, 6 PIDTYPE_PID,
7 PIDTYPE_TGID,
8 PIDTYPE_PGID, 7 PIDTYPE_PGID,
9 PIDTYPE_SID, 8 PIDTYPE_SID,
10 PIDTYPE_MAX 9 PIDTYPE_MAX
@@ -38,7 +37,6 @@ extern struct pid *FASTCALL(find_pid(enum pid_type, int));
38 37
39extern int alloc_pidmap(void); 38extern int alloc_pidmap(void);
40extern void FASTCALL(free_pidmap(int)); 39extern void FASTCALL(free_pidmap(int));
41extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thread);
42 40
43#define do_each_task_pid(who, type, task) \ 41#define do_each_task_pid(who, type, task) \
44 if ((task = find_task_by_pid_type(type, who))) { \ 42 if ((task = find_task_by_pid_type(type, who))) { \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 20b4f0372e44..d04186d8cc68 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -355,16 +355,8 @@ struct sighand_struct {
355 atomic_t count; 355 atomic_t count;
356 struct k_sigaction action[_NSIG]; 356 struct k_sigaction action[_NSIG];
357 spinlock_t siglock; 357 spinlock_t siglock;
358 struct rcu_head rcu;
359}; 358};
360 359
361extern void sighand_free_cb(struct rcu_head *rhp);
362
363static inline void sighand_free(struct sighand_struct *sp)
364{
365 call_rcu(&sp->rcu, sighand_free_cb);
366}
367
368/* 360/*
369 * NOTE! "signal_struct" does not have it's own 361 * NOTE! "signal_struct" does not have it's own
370 * locking, because a shared signal_struct always 362 * locking, because a shared signal_struct always
@@ -760,6 +752,7 @@ struct task_struct {
760 752
761 /* PID/PID hash table linkage. */ 753 /* PID/PID hash table linkage. */
762 struct pid pids[PIDTYPE_MAX]; 754 struct pid pids[PIDTYPE_MAX];
755 struct list_head thread_group;
763 756
764 struct completion *vfork_done; /* for vfork() */ 757 struct completion *vfork_done; /* for vfork() */
765 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 758 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
@@ -1101,7 +1094,6 @@ extern void force_sig_specific(int, struct task_struct *);
1101extern int send_sig(int, struct task_struct *, int); 1094extern int send_sig(int, struct task_struct *, int);
1102extern void zap_other_threads(struct task_struct *p); 1095extern void zap_other_threads(struct task_struct *p);
1103extern int kill_pg(pid_t, int, int); 1096extern int kill_pg(pid_t, int, int);
1104extern int kill_sl(pid_t, int, int);
1105extern int kill_proc(pid_t, int, int); 1097extern int kill_proc(pid_t, int, int);
1106extern struct sigqueue *sigqueue_alloc(void); 1098extern struct sigqueue *sigqueue_alloc(void);
1107extern void sigqueue_free(struct sigqueue *); 1099extern void sigqueue_free(struct sigqueue *);
@@ -1158,10 +1150,8 @@ extern void flush_thread(void);
1158extern void exit_thread(void); 1150extern void exit_thread(void);
1159 1151
1160extern void exit_files(struct task_struct *); 1152extern void exit_files(struct task_struct *);
1161extern void exit_signal(struct task_struct *); 1153extern void __cleanup_signal(struct signal_struct *);
1162extern void __exit_signal(struct task_struct *); 1154extern void __cleanup_sighand(struct sighand_struct *);
1163extern void exit_sighand(struct task_struct *);
1164extern void __exit_sighand(struct task_struct *);
1165extern void exit_itimers(struct signal_struct *); 1155extern void exit_itimers(struct signal_struct *);
1166 1156
1167extern NORET_TYPE void do_group_exit(int); 1157extern NORET_TYPE void do_group_exit(int);
@@ -1185,19 +1175,7 @@ extern void wait_task_inactive(task_t * p);
1185#endif 1175#endif
1186 1176
1187#define remove_parent(p) list_del_init(&(p)->sibling) 1177#define remove_parent(p) list_del_init(&(p)->sibling)
1188#define add_parent(p, parent) list_add_tail(&(p)->sibling,&(parent)->children) 1178#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)
1189
1190#define REMOVE_LINKS(p) do { \
1191 if (thread_group_leader(p)) \
1192 list_del_init(&(p)->tasks); \
1193 remove_parent(p); \
1194 } while (0)
1195
1196#define SET_LINKS(p) do { \
1197 if (thread_group_leader(p)) \
1198 list_add_tail(&(p)->tasks,&init_task.tasks); \
1199 add_parent(p, (p)->parent); \
1200 } while (0)
1201 1179
1202#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) 1180#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks)
1203#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) 1181#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)
@@ -1215,20 +1193,22 @@ extern void wait_task_inactive(task_t * p);
1215#define while_each_thread(g, t) \ 1193#define while_each_thread(g, t) \
1216 while ((t = next_thread(t)) != g) 1194 while ((t = next_thread(t)) != g)
1217 1195
1218extern task_t * FASTCALL(next_thread(const task_t *p));
1219
1220#define thread_group_leader(p) (p->pid == p->tgid) 1196#define thread_group_leader(p) (p->pid == p->tgid)
1221 1197
1198static inline task_t *next_thread(task_t *p)
1199{
1200 return list_entry(rcu_dereference(p->thread_group.next),
1201 task_t, thread_group);
1202}
1203
1222static inline int thread_group_empty(task_t *p) 1204static inline int thread_group_empty(task_t *p)
1223{ 1205{
1224 return list_empty(&p->pids[PIDTYPE_TGID].pid_list); 1206 return list_empty(&p->thread_group);
1225} 1207}
1226 1208
1227#define delay_group_leader(p) \ 1209#define delay_group_leader(p) \
1228 (thread_group_leader(p) && !thread_group_empty(p)) 1210 (thread_group_leader(p) && !thread_group_empty(p))
1229 1211
1230extern void unhash_process(struct task_struct *p);
1231
1232/* 1212/*
1233 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1213 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
1234 * subscriptions and synchronises with wait4(). Also used in procfs. Also 1214 * subscriptions and synchronises with wait4(). Also used in procfs. Also
@@ -1248,6 +1228,15 @@ static inline void task_unlock(struct task_struct *p)
1248 spin_unlock(&p->alloc_lock); 1228 spin_unlock(&p->alloc_lock);
1249} 1229}
1250 1230
1231extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
1232 unsigned long *flags);
1233
1234static inline void unlock_task_sighand(struct task_struct *tsk,
1235 unsigned long *flags)
1236{
1237 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
1238}
1239
1251#ifndef __HAVE_THREAD_FUNCTIONS 1240#ifndef __HAVE_THREAD_FUNCTIONS
1252 1241
1253#define task_thread_info(task) (task)->thread_info 1242#define task_thread_info(task) (task)->thread_info
diff --git a/include/linux/signal.h b/include/linux/signal.h
index b7d093520bb6..162a8fd10b29 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -249,6 +249,8 @@ static inline void init_sigpending(struct sigpending *sig)
249 INIT_LIST_HEAD(&sig->list); 249 INIT_LIST_HEAD(&sig->list);
250} 250}
251 251
252extern void flush_sigqueue(struct sigpending *queue);
253
252/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ 254/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */
253static inline int valid_signal(unsigned long sig) 255static inline int valid_signal(unsigned long sig)
254{ 256{
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 15e1d9736b1b..3af03b19c983 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -210,7 +210,6 @@ extern kmem_cache_t *names_cachep;
210extern kmem_cache_t *files_cachep; 210extern kmem_cache_t *files_cachep;
211extern kmem_cache_t *filp_cachep; 211extern kmem_cache_t *filp_cachep;
212extern kmem_cache_t *fs_cachep; 212extern kmem_cache_t *fs_cachep;
213extern kmem_cache_t *signal_cachep;
214extern kmem_cache_t *sighand_cachep; 213extern kmem_cache_t *sighand_cachep;
215extern kmem_cache_t *bio_cachep; 214extern kmem_cache_t *bio_cachep;
216 215