Use task_pid_nr() instead of pid_nr(task_pid())
PATCH 1/1 Use task_pid_nr() instead of pid_nr(task_pid())
There are two places that do so - the cgroups subsystem and the autofs code.
---
fs/autofs/root.c +1 -1
@@ -214,7 +214,7 @@ static struct dentry *autofs_root_lookup oz_mode =autofs_oz_mode (sbi);DPRINTK (("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, " -"oz_mode = %d\n" ,pid_nr (task_pid (current)), +"oz_mode = %d\n" ,task_pid_nr (current),task_pgrp_nr (current), sbi->catatonic, oz_mode));
kernel/cgroup.c +1 -1
@@ -1762,7 +1762,7 @@ static int pid_array_load(pid_t *pidarrawhile ((tsk =cgroup_iter_next (cont, &it))) {if (unlikely (n == npids))break ; - pidarray[n++] =pid_nr (task_pid (tsk)); + pidarray[n++] =task_pid_nr (tsk); }cgroup_iter_end (cont, &it);return n;
Quoted 25 lines · On Wed, 03 Oct 2007 18:26:06 +0400 Pavel Emelyanov <[email protected]> wrote:
There are two places that do so - the cgroups subsystem and the autofs code.
Signed-off-by Pavel Emelyanov <[email protected]>---
fs/autofs/root.c +1
-1@@ -214,7 +214,7 @@ static struct dentry *autofs_root_lookup oz_mode =autofs_oz_mode (sbi);DPRINTK (("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, " -"oz_mode = %d\n" ,pid_nr (task_pid (current)), +"oz_mode = %d\n" ,task_pid_nr (current),task_pgrp_nr (current), sbi->catatonic, oz_mode));kernel/cgroup.c +0
-0
kernel/cgroup.c static int pid_array_load(pid_t *pidarra · line 1768
Quoted 8 lines
kernel/cgroup.c +1
-1@@ -1762,7 +1762,7 @@ static int pid_array_load(pid_t *pidarrawhile ((tsk =cgroup_iter_next (cont, &it))) {if (unlikely (n == npids))break ; - pidarray[n++] =pid_nr (task_pid (tsk)); + pidarray[n++] =task_pid_nr (tsk); }cgroup_iter_end (cont, &it);return n;
And more will appear over time unless we remove pid_nr() altogether.
Can we do that?
Quoted 39 lines · Andrew Morton
Quoted 25 lines · On Wed, 03 Oct 2007 18:26:06 +0400 Pavel Emelyanov <[email protected]> wrote:
There are two places that do so - the cgroups subsystem and the autofs code.
Signed-off-by Pavel Emelyanov <[email protected]>---
fs/autofs/root.c +1
-1@@ -214,7 +214,7 @@ static struct dentry *autofs_root_lookup oz_mode =autofs_oz_mode (sbi);DPRINTK (("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, " -"oz_mode = %d\n" ,pid_nr (task_pid (current)), +"oz_mode = %d\n" ,task_pid_nr (current),task_pgrp_nr (current), sbi->catatonic, oz_mode));kernel/cgroup.c +0
-0kernel/cgroup.c static int pid_array_load(pid_t *pidarra · line 1768
Quoted 8 lines
kernel/cgroup.c +1
-1@@ -1762,7 +1762,7 @@ static int pid_array_load(pid_t *pidarrawhile ((tsk =cgroup_iter_next (cont, &it))) {if (unlikely (n == npids))break ; - pidarray[n++] =pid_nr (task_pid (tsk)); + pidarray[n++] =task_pid_nr (tsk); }cgroup_iter_end (cont, &it);return n;And more will appear over time unless we remove
pid_nr()altogether.
Quoted 1 line
Can we do that?
Hardly.
There are places that store the struct pid and try to obtain its number later. E.g. tiocgpgrp() wants to tell user the pgrp nr of the tty's active group; fgetown() tells user the number of file's owner pid or (!) pgrp; file locks need to store the pid and report it later (this is not implemented yet, I'm still working on it) and so on and so forth.
Thanks,
Pavel