aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-19 02:40:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:43 -0400
commitba25f9dcc4ea6e30839fcab5a5516f2176d5bfed (patch)
tree3123c03b25dd5c0cd24b6ab4fc16731217838157 /drivers/char/tty_io.c
parent9a2e70572e94e21e7ec4186702d045415422bda0 (diff)
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>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e40544947135..13a53575a016 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3530,7 +3530,7 @@ void __do_SAK(struct tty_struct *tty)
3530 do_each_pid_task(session, PIDTYPE_SID, p) { 3530 do_each_pid_task(session, PIDTYPE_SID, p) {
3531 printk(KERN_NOTICE "SAK: killed process %d" 3531 printk(KERN_NOTICE "SAK: killed process %d"
3532 " (%s): task_session_nr(p)==tty->session\n", 3532 " (%s): task_session_nr(p)==tty->session\n",
3533 p->pid, p->comm); 3533 task_pid_nr(p), p->comm);
3534 send_sig(SIGKILL, p, 1); 3534 send_sig(SIGKILL, p, 1);
3535 } while_each_pid_task(session, PIDTYPE_SID, p); 3535 } while_each_pid_task(session, PIDTYPE_SID, p);
3536 /* Now kill any processes that happen to have the 3536 /* Now kill any processes that happen to have the
@@ -3540,7 +3540,7 @@ void __do_SAK(struct tty_struct *tty)
3540 if (p->signal->tty == tty) { 3540 if (p->signal->tty == tty) {
3541 printk(KERN_NOTICE "SAK: killed process %d" 3541 printk(KERN_NOTICE "SAK: killed process %d"
3542 " (%s): task_session_nr(p)==tty->session\n", 3542 " (%s): task_session_nr(p)==tty->session\n",
3543 p->pid, p->comm); 3543 task_pid_nr(p), p->comm);
3544 send_sig(SIGKILL, p, 1); 3544 send_sig(SIGKILL, p, 1);
3545 continue; 3545 continue;
3546 } 3546 }
@@ -3560,7 +3560,7 @@ void __do_SAK(struct tty_struct *tty)
3560 filp->private_data == tty) { 3560 filp->private_data == tty) {
3561 printk(KERN_NOTICE "SAK: killed process %d" 3561 printk(KERN_NOTICE "SAK: killed process %d"
3562 " (%s): fd#%d opened to the tty\n", 3562 " (%s): fd#%d opened to the tty\n",
3563 p->pid, p->comm, i); 3563 task_pid_nr(p), p->comm, i);
3564 force_sig(SIGKILL, p); 3564 force_sig(SIGKILL, p);
3565 break; 3565 break;
3566 } 3566 }