aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ioprio.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-11-07 07:54:07 -0500
committerJens Axboe <jens.axboe@oracle.com>2007-11-07 07:54:07 -0500
commit8ec680e4c3ec818efd1652f15199ed1c216ab550 (patch)
tree5f58d77e0661d720cbf1443aa5c1153ee930d37c /fs/ioprio.c
parent0e7be9edb9134f833278c381b6feabb54b875208 (diff)
ioprio: allow sys_ioprio_set() value of 0 to reset ioprio setting
Normally io priorities follow the CPU nice, unless a specific scheduling class has been set. Once that is set, there's no way to reset the behaviour to 'none' so that it follows CPU nice again. Currently passing in 0 as the ioprio class/value will return -1/EINVAL, change that to allow resetting of a set scheduling class. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/ioprio.c')
-rw-r--r--fs/ioprio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c
index d6ff77e8e7ec..e4e01bc7f338 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -78,6 +78,10 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
78 if (!capable(CAP_SYS_ADMIN)) 78 if (!capable(CAP_SYS_ADMIN))
79 return -EPERM; 79 return -EPERM;
80 break; 80 break;
81 case IOPRIO_CLASS_NONE:
82 if (data)
83 return -EINVAL;
84 break;
81 default: 85 default:
82 return -EINVAL; 86 return -EINVAL;
83 } 87 }