diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 65 |
1 files changed, 10 insertions, 55 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index dc5ea65dc716..0a1094d84b77 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -573,12 +573,6 @@ struct signal_struct { | |||
573 | */ | 573 | */ |
574 | struct rlimit rlim[RLIM_NLIMITS]; | 574 | struct rlimit rlim[RLIM_NLIMITS]; |
575 | 575 | ||
576 | /* keep the process-shared keyrings here so that they do the right | ||
577 | * thing in threads created with CLONE_THREAD */ | ||
578 | #ifdef CONFIG_KEYS | ||
579 | struct key *session_keyring; /* keyring inherited over fork */ | ||
580 | struct key *process_keyring; /* keyring private to this process */ | ||
581 | #endif | ||
582 | #ifdef CONFIG_BSD_PROCESS_ACCT | 576 | #ifdef CONFIG_BSD_PROCESS_ACCT |
583 | struct pacct_struct pacct; /* per-process accounting information */ | 577 | struct pacct_struct pacct; /* per-process accounting information */ |
584 | #endif | 578 | #endif |
@@ -649,6 +643,7 @@ struct user_struct { | |||
649 | /* Hash table maintenance information */ | 643 | /* Hash table maintenance information */ |
650 | struct hlist_node uidhash_node; | 644 | struct hlist_node uidhash_node; |
651 | uid_t uid; | 645 | uid_t uid; |
646 | struct user_namespace *user_ns; | ||
652 | 647 | ||
653 | #ifdef CONFIG_USER_SCHED | 648 | #ifdef CONFIG_USER_SCHED |
654 | struct task_group *tg; | 649 | struct task_group *tg; |
@@ -666,6 +661,7 @@ extern struct user_struct *find_user(uid_t); | |||
666 | extern struct user_struct root_user; | 661 | extern struct user_struct root_user; |
667 | #define INIT_USER (&root_user) | 662 | #define INIT_USER (&root_user) |
668 | 663 | ||
664 | |||
669 | struct backing_dev_info; | 665 | struct backing_dev_info; |
670 | struct reclaim_state; | 666 | struct reclaim_state; |
671 | 667 | ||
@@ -889,38 +885,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
889 | #endif /* !CONFIG_SMP */ | 885 | #endif /* !CONFIG_SMP */ |
890 | 886 | ||
891 | struct io_context; /* See blkdev.h */ | 887 | struct io_context; /* See blkdev.h */ |
892 | #define NGROUPS_SMALL 32 | ||
893 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) | ||
894 | struct group_info { | ||
895 | int ngroups; | ||
896 | atomic_t usage; | ||
897 | gid_t small_block[NGROUPS_SMALL]; | ||
898 | int nblocks; | ||
899 | gid_t *blocks[0]; | ||
900 | }; | ||
901 | 888 | ||
902 | /* | ||
903 | * get_group_info() must be called with the owning task locked (via task_lock()) | ||
904 | * when task != current. The reason being that the vast majority of callers are | ||
905 | * looking at current->group_info, which can not be changed except by the | ||
906 | * current task. Changing current->group_info requires the task lock, too. | ||
907 | */ | ||
908 | #define get_group_info(group_info) do { \ | ||
909 | atomic_inc(&(group_info)->usage); \ | ||
910 | } while (0) | ||
911 | |||
912 | #define put_group_info(group_info) do { \ | ||
913 | if (atomic_dec_and_test(&(group_info)->usage)) \ | ||
914 | groups_free(group_info); \ | ||
915 | } while (0) | ||
916 | |||
917 | extern struct group_info *groups_alloc(int gidsetsize); | ||
918 | extern void groups_free(struct group_info *group_info); | ||
919 | extern int set_current_groups(struct group_info *group_info); | ||
920 | extern int groups_search(struct group_info *group_info, gid_t grp); | ||
921 | /* access the groups "array" with this macro */ | ||
922 | #define GROUP_AT(gi, i) \ | ||
923 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) | ||
924 | 889 | ||
925 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK | 890 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK |
926 | extern void prefetch_stack(struct task_struct *t); | 891 | extern void prefetch_stack(struct task_struct *t); |
@@ -1200,17 +1165,12 @@ struct task_struct { | |||
1200 | struct list_head cpu_timers[3]; | 1165 | struct list_head cpu_timers[3]; |
1201 | 1166 | ||
1202 | /* process credentials */ | 1167 | /* process credentials */ |
1203 | uid_t uid,euid,suid,fsuid; | 1168 | const struct cred *real_cred; /* objective and real subjective task |
1204 | gid_t gid,egid,sgid,fsgid; | 1169 | * credentials (COW) */ |
1205 | struct group_info *group_info; | 1170 | const struct cred *cred; /* effective (overridable) subjective task |
1206 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; | 1171 | * credentials (COW) */ |
1207 | struct user_struct *user; | 1172 | struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */ |
1208 | unsigned securebits; | 1173 | |
1209 | #ifdef CONFIG_KEYS | ||
1210 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | ||
1211 | struct key *request_key_auth; /* assumed request_key authority */ | ||
1212 | struct key *thread_keyring; /* keyring private to this thread */ | ||
1213 | #endif | ||
1214 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1174 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1215 | - access with [gs]et_task_comm (which lock | 1175 | - access with [gs]et_task_comm (which lock |
1216 | it with task_lock()) | 1176 | it with task_lock()) |
@@ -1247,9 +1207,6 @@ struct task_struct { | |||
1247 | int (*notifier)(void *priv); | 1207 | int (*notifier)(void *priv); |
1248 | void *notifier_data; | 1208 | void *notifier_data; |
1249 | sigset_t *notifier_mask; | 1209 | sigset_t *notifier_mask; |
1250 | #ifdef CONFIG_SECURITY | ||
1251 | void *security; | ||
1252 | #endif | ||
1253 | struct audit_context *audit_context; | 1210 | struct audit_context *audit_context; |
1254 | #ifdef CONFIG_AUDITSYSCALL | 1211 | #ifdef CONFIG_AUDITSYSCALL |
1255 | uid_t loginuid; | 1212 | uid_t loginuid; |
@@ -1806,7 +1763,6 @@ static inline struct user_struct *get_uid(struct user_struct *u) | |||
1806 | return u; | 1763 | return u; |
1807 | } | 1764 | } |
1808 | extern void free_uid(struct user_struct *); | 1765 | extern void free_uid(struct user_struct *); |
1809 | extern void switch_uid(struct user_struct *); | ||
1810 | extern void release_uids(struct user_namespace *ns); | 1766 | extern void release_uids(struct user_namespace *ns); |
1811 | 1767 | ||
1812 | #include <asm/current.h> | 1768 | #include <asm/current.h> |
@@ -1825,9 +1781,6 @@ extern void wake_up_new_task(struct task_struct *tsk, | |||
1825 | extern void sched_fork(struct task_struct *p, int clone_flags); | 1781 | extern void sched_fork(struct task_struct *p, int clone_flags); |
1826 | extern void sched_dead(struct task_struct *p); | 1782 | extern void sched_dead(struct task_struct *p); |
1827 | 1783 | ||
1828 | extern int in_group_p(gid_t); | ||
1829 | extern int in_egroup_p(gid_t); | ||
1830 | |||
1831 | extern void proc_caches_init(void); | 1784 | extern void proc_caches_init(void); |
1832 | extern void flush_signals(struct task_struct *); | 1785 | extern void flush_signals(struct task_struct *); |
1833 | extern void ignore_signals(struct task_struct *); | 1786 | extern void ignore_signals(struct task_struct *); |
@@ -1959,6 +1912,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
1959 | #define for_each_process(p) \ | 1912 | #define for_each_process(p) \ |
1960 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1913 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
1961 | 1914 | ||
1915 | extern bool is_single_threaded(struct task_struct *); | ||
1916 | |||
1962 | /* | 1917 | /* |
1963 | * Careful: do_each_thread/while_each_thread is a double loop so | 1918 | * Careful: do_each_thread/while_each_thread is a double loop so |
1964 | * 'break' will not work as expected - use goto instead. | 1919 | * 'break' will not work as expected - use goto instead. |