aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ioprio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ioprio.c')
-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)