diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-08-20 22:24:33 +0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-08-20 22:24:33 +0400 |
| commit | 39cf0518d89d1f0af79554457c52adb5b12fa43c (patch) | |
| tree | 3d04a6efe1e2afb6db7091af4b7033a56ae1b077 /fs/proc/base.c | |
| parent | af15c1addf920d830b030e3489a482456904ca8c (diff) | |
| parent | 6c30c53fd5ae6a99a23ad78e90c428d2c8ffb07f (diff) | |
| download | linux-39cf0518d89d1f0af79554457c52adb5b12fa43c.tar.xz | |
Merge branch 'master' into for-linus
Diffstat (limited to 'fs/proc/base.c')
| -rw-r--r-- | fs/proc/base.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 175db258942f..6f742f6658a9 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1003,12 +1003,7 @@ static ssize_t oom_adjust_read(struct file *file, char __user *buf, if (!task) return -ESRCH; - task_lock(task); - if (task->mm) - oom_adjust = task->mm->oom_adj; - else - oom_adjust = OOM_DISABLE; - task_unlock(task); + oom_adjust = task->oomkilladj; put_task_struct(task); len = snprintf(buffer, sizeof(buffer), "%i\n", oom_adjust); @@ -1037,19 +1032,11 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf, task = get_proc_task(file->f_path.dentry->d_inode); if (!task) return -ESRCH; - task_lock(task); - if (!task->mm) { - task_unlock(task); - put_task_struct(task); - return -EINVAL; - } - if (oom_adjust < task->mm->oom_adj && !capable(CAP_SYS_RESOURCE)) { - task_unlock(task); + if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) { put_task_struct(task); return -EACCES; } - task->mm->oom_adj = oom_adjust; - task_unlock(task); + task->oomkilladj = oom_adjust; put_task_struct(task); if (end - buffer == 0) return -EIO; |
