diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 64 |
1 files changed, 9 insertions, 55 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 644ffbda17ca..2036e9f26020 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -572,12 +572,6 @@ struct signal_struct { | |||
572 | */ | 572 | */ |
573 | struct rlimit rlim[RLIM_NLIMITS]; | 573 | struct rlimit rlim[RLIM_NLIMITS]; |
574 | 574 | ||
575 | /* keep the process-shared keyrings here so that they do the right | ||
576 | * thing in threads created with CLONE_THREAD */ | ||
577 | #ifdef CONFIG_KEYS | ||
578 | struct key *session_keyring; /* keyring inherited over fork */ | ||
579 | struct key *process_keyring; /* keyring private to this process */ | ||
580 | #endif | ||
581 | #ifdef CONFIG_BSD_PROCESS_ACCT | 575 | #ifdef CONFIG_BSD_PROCESS_ACCT |
582 | struct pacct_struct pacct; /* per-process accounting information */ | 576 | struct pacct_struct pacct; /* per-process accounting information */ |
583 | #endif | 577 | #endif |
@@ -661,6 +655,7 @@ extern struct user_struct *find_user(uid_t); | |||
661 | extern struct user_struct root_user; | 655 | extern struct user_struct root_user; |
662 | #define INIT_USER (&root_user) | 656 | #define INIT_USER (&root_user) |
663 | 657 | ||
658 | |||
664 | struct backing_dev_info; | 659 | struct backing_dev_info; |
665 | struct reclaim_state; | 660 | struct reclaim_state; |
666 | 661 | ||
@@ -884,38 +879,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
884 | #endif /* !CONFIG_SMP */ | 879 | #endif /* !CONFIG_SMP */ |
885 | 880 | ||
886 | struct io_context; /* See blkdev.h */ | 881 | struct io_context; /* See blkdev.h */ |
887 | #define NGROUPS_SMALL 32 | ||
888 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) | ||
889 | struct group_info { | ||
890 | int ngroups; | ||
891 | atomic_t usage; | ||
892 | gid_t small_block[NGROUPS_SMALL]; | ||
893 | int nblocks; | ||
894 | gid_t *blocks[0]; | ||
895 | }; | ||
896 | 882 | ||
897 | /* | ||
898 | * get_group_info() must be called with the owning task locked (via task_lock()) | ||
899 | * when task != current. The reason being that the vast majority of callers are | ||
900 | * looking at current->group_info, which can not be changed except by the | ||
901 | * current task. Changing current->group_info requires the task lock, too. | ||
902 | */ | ||
903 | #define get_group_info(group_info) do { \ | ||
904 | atomic_inc(&(group_info)->usage); \ | ||
905 | } while (0) | ||
906 | |||
907 | #define put_group_info(group_info) do { \ | ||
908 | if (atomic_dec_and_test(&(group_info)->usage)) \ | ||
909 | groups_free(group_info); \ | ||
910 | } while (0) | ||
911 | |||
912 | extern struct group_info *groups_alloc(int gidsetsize); | ||
913 | extern void groups_free(struct group_info *group_info); | ||
914 | extern int set_current_groups(struct group_info *group_info); | ||
915 | extern int groups_search(struct group_info *group_info, gid_t grp); | ||
916 | /* access the groups "array" with this macro */ | ||
917 | #define GROUP_AT(gi, i) \ | ||
918 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) | ||
919 | 883 | ||
920 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK | 884 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK |
921 | extern void prefetch_stack(struct task_struct *t); | 885 | extern void prefetch_stack(struct task_struct *t); |
@@ -1182,17 +1146,12 @@ struct task_struct { | |||
1182 | struct list_head cpu_timers[3]; | 1146 | struct list_head cpu_timers[3]; |
1183 | 1147 | ||
1184 | /* process credentials */ | 1148 | /* process credentials */ |
1185 | uid_t uid,euid,suid,fsuid; | 1149 | const struct cred *real_cred; /* objective and real subjective task |
1186 | gid_t gid,egid,sgid,fsgid; | 1150 | * credentials (COW) */ |
1187 | struct group_info *group_info; | 1151 | const struct cred *cred; /* effective (overridable) subjective task |
1188 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; | 1152 | * credentials (COW) */ |
1189 | struct user_struct *user; | 1153 | struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */ |
1190 | unsigned securebits; | 1154 | |
1191 | #ifdef CONFIG_KEYS | ||
1192 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | ||
1193 | struct key *request_key_auth; /* assumed request_key authority */ | ||
1194 | struct key *thread_keyring; /* keyring private to this thread */ | ||
1195 | #endif | ||
1196 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1155 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1197 | - access with [gs]et_task_comm (which lock | 1156 | - access with [gs]et_task_comm (which lock |
1198 | it with task_lock()) | 1157 | it with task_lock()) |
@@ -1229,9 +1188,6 @@ struct task_struct { | |||
1229 | int (*notifier)(void *priv); | 1188 | int (*notifier)(void *priv); |
1230 | void *notifier_data; | 1189 | void *notifier_data; |
1231 | sigset_t *notifier_mask; | 1190 | sigset_t *notifier_mask; |
1232 | #ifdef CONFIG_SECURITY | ||
1233 | void *security; | ||
1234 | #endif | ||
1235 | struct audit_context *audit_context; | 1191 | struct audit_context *audit_context; |
1236 | #ifdef CONFIG_AUDITSYSCALL | 1192 | #ifdef CONFIG_AUDITSYSCALL |
1237 | uid_t loginuid; | 1193 | uid_t loginuid; |
@@ -1771,7 +1727,6 @@ static inline struct user_struct *get_uid(struct user_struct *u) | |||
1771 | return u; | 1727 | return u; |
1772 | } | 1728 | } |
1773 | extern void free_uid(struct user_struct *); | 1729 | extern void free_uid(struct user_struct *); |
1774 | extern void switch_uid(struct user_struct *); | ||
1775 | extern void release_uids(struct user_namespace *ns); | 1730 | extern void release_uids(struct user_namespace *ns); |
1776 | 1731 | ||
1777 | #include <asm/current.h> | 1732 | #include <asm/current.h> |
@@ -1790,9 +1745,6 @@ extern void wake_up_new_task(struct task_struct *tsk, | |||
1790 | extern void sched_fork(struct task_struct *p, int clone_flags); | 1745 | extern void sched_fork(struct task_struct *p, int clone_flags); |
1791 | extern void sched_dead(struct task_struct *p); | 1746 | extern void sched_dead(struct task_struct *p); |
1792 | 1747 | ||
1793 | extern int in_group_p(gid_t); | ||
1794 | extern int in_egroup_p(gid_t); | ||
1795 | |||
1796 | extern void proc_caches_init(void); | 1748 | extern void proc_caches_init(void); |
1797 | extern void flush_signals(struct task_struct *); | 1749 | extern void flush_signals(struct task_struct *); |
1798 | extern void ignore_signals(struct task_struct *); | 1750 | extern void ignore_signals(struct task_struct *); |
@@ -1924,6 +1876,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
1924 | #define for_each_process(p) \ | 1876 | #define for_each_process(p) \ |
1925 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1877 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
1926 | 1878 | ||
1879 | extern bool is_single_threaded(struct task_struct *); | ||
1880 | |||
1927 | /* | 1881 | /* |
1928 | * Careful: do_each_thread/while_each_thread is a double loop so | 1882 | * Careful: do_each_thread/while_each_thread is a double loop so |
1929 | * 'break' will not work as expected - use goto instead. | 1883 | * 'break' will not work as expected - use goto instead. |