aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-02-12 03:53:01 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:32 -0500
commit41487c65bfcce9c8e4d123da1719fcfd8df6d4d0 (patch)
treee2e0e13bc3178c2cff766f1e0165bbbabdb2ed98 /fs
parentab521dc0f8e117fd808d3e425216864d60390500 (diff)
[PATCH] pid: replace do/while_each_task_pid with do/while_each_pid_task
There isn't any real advantage to this change except that it allows the old functions to be removed. Which is easier on maintenance and puts the code in a more uniform style. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ioprio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c
index 89e8da112a75..10d2c211d18b 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -60,6 +60,7 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
60 int data = IOPRIO_PRIO_DATA(ioprio); 60 int data = IOPRIO_PRIO_DATA(ioprio);
61 struct task_struct *p, *g; 61 struct task_struct *p, *g;
62 struct user_struct *user; 62 struct user_struct *user;
63 struct pid *pgrp;
63 int ret; 64 int ret;
64 65
65 switch (class) { 66 switch (class) {
@@ -98,12 +99,14 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
98 break; 99 break;
99 case IOPRIO_WHO_PGRP: 100 case IOPRIO_WHO_PGRP:
100 if (!who) 101 if (!who)
101 who = process_group(current); 102 pgrp = task_pgrp(current);
102 do_each_task_pid(who, PIDTYPE_PGID, p) { 103 else
104 pgrp = find_pid(who);
105 do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
103 ret = set_task_ioprio(p, ioprio); 106 ret = set_task_ioprio(p, ioprio);
104 if (ret) 107 if (ret)
105 break; 108 break;
106 } while_each_task_pid(who, PIDTYPE_PGID, p); 109 } while_each_pid_task(pgrp, PIDTYPE_PGID, p);
107 break; 110 break;
108 case IOPRIO_WHO_USER: 111 case IOPRIO_WHO_USER:
109 if (!who) 112 if (!who)
@@ -167,6 +170,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
167{ 170{
168 struct task_struct *g, *p; 171 struct task_struct *g, *p;
169 struct user_struct *user; 172 struct user_struct *user;
173 struct pid *pgrp;
170 int ret = -ESRCH; 174 int ret = -ESRCH;
171 int tmpio; 175 int tmpio;
172 176
@@ -182,8 +186,10 @@ asmlinkage long sys_ioprio_get(int which, int who)
182 break; 186 break;
183 case IOPRIO_WHO_PGRP: 187 case IOPRIO_WHO_PGRP:
184 if (!who) 188 if (!who)
185 who = process_group(current); 189 pgrp = task_pgrp(current);
186 do_each_task_pid(who, PIDTYPE_PGID, p) { 190 else
191 pgrp = find_pid(who);
192 do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
187 tmpio = get_task_ioprio(p); 193 tmpio = get_task_ioprio(p);
188 if (tmpio < 0) 194 if (tmpio < 0)
189 continue; 195 continue;
@@ -191,7 +197,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
191 ret = tmpio; 197 ret = tmpio;
192 else 198 else
193 ret = ioprio_best(ret, tmpio); 199 ret = ioprio_best(ret, tmpio);
194 } while_each_task_pid(who, PIDTYPE_PGID, p); 200 } while_each_pid_task(pgrp, PIDTYPE_PGID, p);
195 break; 201 break;
196 case IOPRIO_WHO_USER: 202 case IOPRIO_WHO_USER:
197 if (!who) 203 if (!who)