X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fproc%2Fbase.c;h=ac0df4dde823866b54480c7062d5188887009365;hb=511a8cdb650544b7efd1bbccf7967d3153aee5f6;hp=31370da2ee7ce9ca2944eb22efb4d512681bc9dc;hpb=43a0a98aa8da71583f84b84fd72e265c24d4c5f8;p=cascardo%2Flinux.git diff --git a/fs/proc/base.c b/fs/proc/base.c index 31370da2ee7c..ac0df4dde823 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -579,11 +579,8 @@ static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, unsigned long totalpages = totalram_pages + total_swap_pages; unsigned long points = 0; - read_lock(&tasklist_lock); - if (pid_alive(task)) - points = oom_badness(task, NULL, NULL, totalpages) * - 1000 / totalpages; - read_unlock(&tasklist_lock); + points = oom_badness(task, NULL, NULL, totalpages) * + 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; @@ -1559,18 +1556,13 @@ static const struct file_operations proc_pid_set_comm_operations = { static int proc_exe_link(struct dentry *dentry, struct path *exe_path) { struct task_struct *task; - struct mm_struct *mm; struct file *exe_file; task = get_proc_task(d_inode(dentry)); if (!task) return -ENOENT; - mm = get_task_mm(task); + exe_file = get_task_exe_file(task); put_task_struct(task); - if (!mm) - return -ENOENT; - exe_file = get_mm_exe_file(mm); - mmput(mm); if (exe_file) { *exe_path = exe_file->f_path; path_get(&exe_file->f_path);