aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-24 12:23:50 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-24 12:23:50 -0400
commita8972ccf00b7184a743eb6cd9bc7f3443357910c (patch)
treea5b6652a138a9f428cdff8f440c7a5bbe52e8b85
parentb3da2a73ff5a2953a4ad8ebbf0aa7e6965ff9de2 (diff)
sched: constify sched.h
Add const to some struct task_struct * uses Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/sched.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 13df99fb2769..52288a647692 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1196,7 +1196,7 @@ static inline int rt_prio(int prio)
1196 return 0; 1196 return 0;
1197} 1197}
1198 1198
1199static inline int rt_task(struct task_struct *p) 1199static inline int rt_task(const struct task_struct *p)
1200{ 1200{
1201 return rt_prio(p->prio); 1201 return rt_prio(p->prio);
1202} 1202}
@@ -1211,22 +1211,22 @@ static inline void set_task_pgrp(struct task_struct *tsk, pid_t pgrp)
1211 tsk->signal->__pgrp = pgrp; 1211 tsk->signal->__pgrp = pgrp;
1212} 1212}
1213 1213
1214static inline struct pid *task_pid(struct task_struct *task) 1214static inline struct pid *task_pid(const struct task_struct *task)
1215{ 1215{
1216 return task->pids[PIDTYPE_PID].pid; 1216 return task->pids[PIDTYPE_PID].pid;
1217} 1217}
1218 1218
1219static inline struct pid *task_tgid(struct task_struct *task) 1219static inline struct pid *task_tgid(const struct task_struct *task)
1220{ 1220{
1221 return task->group_leader->pids[PIDTYPE_PID].pid; 1221 return task->group_leader->pids[PIDTYPE_PID].pid;
1222} 1222}
1223 1223
1224static inline struct pid *task_pgrp(struct task_struct *task) 1224static inline struct pid *task_pgrp(const struct task_struct *task)
1225{ 1225{
1226 return task->group_leader->pids[PIDTYPE_PGID].pid; 1226 return task->group_leader->pids[PIDTYPE_PGID].pid;
1227} 1227}
1228 1228
1229static inline struct pid *task_session(struct task_struct *task) 1229static inline struct pid *task_session(const struct task_struct *task)
1230{ 1230{
1231 return task->group_leader->pids[PIDTYPE_SID].pid; 1231 return task->group_leader->pids[PIDTYPE_SID].pid;
1232} 1232}
@@ -1255,7 +1255,7 @@ struct pid_namespace;
1255 * see also pid_nr() etc in include/linux/pid.h 1255 * see also pid_nr() etc in include/linux/pid.h
1256 */ 1256 */
1257 1257
1258static inline pid_t task_pid_nr(struct task_struct *tsk) 1258static inline pid_t task_pid_nr(const struct task_struct *tsk)
1259{ 1259{
1260 return tsk->pid; 1260 return tsk->pid;
1261} 1261}
@@ -1268,7 +1268,7 @@ static inline pid_t task_pid_vnr(struct task_struct *tsk)
1268} 1268}
1269 1269
1270 1270
1271static inline pid_t task_tgid_nr(struct task_struct *tsk) 1271static inline pid_t task_tgid_nr(const struct task_struct *tsk)
1272{ 1272{
1273 return tsk->tgid; 1273 return tsk->tgid;
1274} 1274}
@@ -1281,7 +1281,7 @@ static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1281} 1281}
1282 1282
1283 1283
1284static inline pid_t task_pgrp_nr(struct task_struct *tsk) 1284static inline pid_t task_pgrp_nr(const struct task_struct *tsk)
1285{ 1285{
1286 return tsk->signal->__pgrp; 1286 return tsk->signal->__pgrp;
1287} 1287}
@@ -1294,7 +1294,7 @@ static inline pid_t task_pgrp_vnr(struct task_struct *tsk)
1294} 1294}
1295 1295
1296 1296
1297static inline pid_t task_session_nr(struct task_struct *tsk) 1297static inline pid_t task_session_nr(const struct task_struct *tsk)
1298{ 1298{
1299 return tsk->signal->__session; 1299 return tsk->signal->__session;
1300} 1300}
@@ -1321,7 +1321,7 @@ static inline pid_t task_ppid_nr_ns(struct task_struct *tsk,
1321 * If pid_alive fails, then pointers within the task structure 1321 * If pid_alive fails, then pointers within the task structure
1322 * can be stale and must not be dereferenced. 1322 * can be stale and must not be dereferenced.
1323 */ 1323 */
1324static inline int pid_alive(struct task_struct *p) 1324static inline int pid_alive(const struct task_struct *p)
1325{ 1325{
1326 return p->pids[PIDTYPE_PID].pid != NULL; 1326 return p->pids[PIDTYPE_PID].pid != NULL;
1327} 1327}
@@ -1332,7 +1332,7 @@ static inline int pid_alive(struct task_struct *p)
1332 * 1332 *
1333 * Check if a task structure is the first user space task the kernel created. 1333 * Check if a task structure is the first user space task the kernel created.
1334 */ 1334 */
1335static inline int is_global_init(struct task_struct *tsk) 1335static inline int is_global_init(const struct task_struct *tsk)
1336{ 1336{
1337 return tsk->pid == 1; 1337 return tsk->pid == 1;
1338} 1338}
@@ -1469,7 +1469,7 @@ extern int rt_mutex_getprio(struct task_struct *p);
1469extern void rt_mutex_setprio(struct task_struct *p, int prio); 1469extern void rt_mutex_setprio(struct task_struct *p, int prio);
1470extern void rt_mutex_adjust_pi(struct task_struct *p); 1470extern void rt_mutex_adjust_pi(struct task_struct *p);
1471#else 1471#else
1472static inline int rt_mutex_getprio(struct task_struct *p) 1472static inline int rt_mutex_getprio(const struct task_struct *p)
1473{ 1473{
1474 return p->normal_prio; 1474 return p->normal_prio;
1475} 1475}
@@ -1721,7 +1721,7 @@ extern void wait_task_inactive(struct task_struct * p);
1721 * all we care about is that we have a task with the appropriate 1721 * all we care about is that we have a task with the appropriate
1722 * pid, we don't actually care if we have the right task. 1722 * pid, we don't actually care if we have the right task.
1723 */ 1723 */
1724static inline int has_group_leader_pid(struct task_struct *p) 1724static inline int has_group_leader_pid(const struct task_struct *p)
1725{ 1725{
1726 return p->pid == p->tgid; 1726 return p->pid == p->tgid;
1727} 1727}
@@ -1738,7 +1738,7 @@ static inline struct task_struct *next_thread(const struct task_struct *p)
1738 struct task_struct, thread_group); 1738 struct task_struct, thread_group);
1739} 1739}
1740 1740
1741static inline int thread_group_empty(struct task_struct *p) 1741static inline int thread_group_empty(const struct task_struct *p)
1742{ 1742{
1743 return list_empty(&p->thread_group); 1743 return list_empty(&p->thread_group);
1744} 1744}