Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108947
b: refs/heads/master
c: 2d70b68
h: refs/heads/master
i:
  108945: f879e10
  108943: a4ae7d2
v: v3
  • Loading branch information
Ken Chen authored and Linus Torvalds committed Aug 20, 2008
1 parent c244ec8 commit 4dd53e3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 141d87e7debe3334018e46859c7565c44cebda65
refs/heads/master: 2d70b68d42b5196a48ccb639e3797f097ef5bea3
8 changes: 4 additions & 4 deletions trunk/fs/ioprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
pgrp = task_pgrp(current);
else
pgrp = find_vpid(who);
do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
ret = set_task_ioprio(p, ioprio);
if (ret)
break;
} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case IOPRIO_WHO_USER:
if (!who)
Expand Down Expand Up @@ -204,15 +204,15 @@ asmlinkage long sys_ioprio_get(int which, int who)
pgrp = task_pgrp(current);
else
pgrp = find_vpid(who);
do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
tmpio = get_task_ioprio(p);
if (tmpio < 0)
continue;
if (ret == -ESRCH)
ret = tmpio;
else
ret = ioprio_best(ret, tmpio);
} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case IOPRIO_WHO_USER:
if (!who)
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,13 @@ pid_t pid_vnr(struct pid *pid);
} \
} while (0)

#define do_each_pid_thread(pid, type, task) \
do_each_pid_task(pid, type, task) { \
struct task_struct *tg___ = task; \
do {

#define while_each_pid_thread(pid, type, task) \
} while_each_thread(tg___, task); \
task = tg___; \
} while_each_pid_task(pid, type, task)
#endif /* _LINUX_PID_H */
8 changes: 4 additions & 4 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
pgrp = find_vpid(who);
else
pgrp = task_pgrp(current);
do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
error = set_one_prio(p, niceval, error);
} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case PRIO_USER:
user = current->user;
Expand Down Expand Up @@ -229,11 +229,11 @@ asmlinkage long sys_getpriority(int which, int who)
pgrp = find_vpid(who);
else
pgrp = task_pgrp(current);
do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
niceval = 20 - task_nice(p);
if (niceval > retval)
retval = niceval;
} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
break;
case PRIO_USER:
user = current->user;
Expand Down

0 comments on commit 4dd53e3

Please sign in to comment.