Pull release into acpica branch
[pandora-kernel.git] / fs / ioprio.c
index 663e420..4bf1c63 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/ioprio.h>
 #include <linux/blkdev.h>
+#include <linux/syscalls.h>
 
 static int set_task_ioprio(struct task_struct *task, int ioprio)
 {
@@ -43,7 +44,7 @@ static int set_task_ioprio(struct task_struct *task, int ioprio)
        return 0;
 }
 
-asmlinkage int sys_ioprio_set(int which, int who, int ioprio)
+asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
 {
        int class = IOPRIO_PRIO_CLASS(ioprio);
        int data = IOPRIO_PRIO_DATA(ioprio);
@@ -62,6 +63,8 @@ asmlinkage int sys_ioprio_set(int which, int who, int ioprio)
 
                        break;
                case IOPRIO_CLASS_IDLE:
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EPERM;
                        break;
                default:
                        return -EINVAL;
@@ -115,7 +118,7 @@ asmlinkage int sys_ioprio_set(int which, int who, int ioprio)
        return ret;
 }
 
-asmlinkage int sys_ioprio_get(int which, int who)
+asmlinkage long sys_ioprio_get(int which, int who)
 {
        struct task_struct *g, *p;
        struct user_struct *user;