Use helpers to obtain task pid in printks
The task_struct->pid member is going to be deprecated, so start using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in the kernel. The first thing to start with is the pid, printed to dmesg - in this case we may safely use task_pid_nr(). Besides, printks produce more (much more) than a half of all the explicit pid usage. [akpm@linux-foundation.org: git-drm went and changed lots of stuff] Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
9a2e70572e
commit
ba25f9dcc4
@@ -3530,7 +3530,7 @@ void __do_SAK(struct tty_struct *tty)
|
||||
do_each_pid_task(session, PIDTYPE_SID, p) {
|
||||
printk(KERN_NOTICE "SAK: killed process %d"
|
||||
" (%s): task_session_nr(p)==tty->session\n",
|
||||
p->pid, p->comm);
|
||||
task_pid_nr(p), p->comm);
|
||||
send_sig(SIGKILL, p, 1);
|
||||
} while_each_pid_task(session, PIDTYPE_SID, p);
|
||||
/* Now kill any processes that happen to have the
|
||||
@@ -3540,7 +3540,7 @@ void __do_SAK(struct tty_struct *tty)
|
||||
if (p->signal->tty == tty) {
|
||||
printk(KERN_NOTICE "SAK: killed process %d"
|
||||
" (%s): task_session_nr(p)==tty->session\n",
|
||||
p->pid, p->comm);
|
||||
task_pid_nr(p), p->comm);
|
||||
send_sig(SIGKILL, p, 1);
|
||||
continue;
|
||||
}
|
||||
@@ -3560,7 +3560,7 @@ void __do_SAK(struct tty_struct *tty)
|
||||
filp->private_data == tty) {
|
||||
printk(KERN_NOTICE "SAK: killed process %d"
|
||||
" (%s): fd#%d opened to the tty\n",
|
||||
p->pid, p->comm, i);
|
||||
task_pid_nr(p), p->comm, i);
|
||||
force_sig(SIGKILL, p);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user