summaryrefslogtreecommitdiff
path: root/fs/proc
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-02-12 00:53:00 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:32 -0800
commitab521dc0f8e117fd808d3e425216864d60390500 (patch)
treef9d6449c4d8c9508fd43edfe845108043e1536b2 /fs/proc
parent3e7cd6c413c9e6fbb5e1ee2acdadb4ababd2d474 (diff)
downloadlinux-3.10-ab521dc0f8e117fd808d3e425216864d60390500.tar.gz
linux-3.10-ab521dc0f8e117fd808d3e425216864d60390500.tar.bz2
linux-3.10-ab521dc0f8e117fd808d3e425216864d60390500.zip
[PATCH] tty: update the tty layer to work with struct pid
Of kernel subsystems that work with pids the tty layer is probably the largest consumer. But it has the nice virtue that the assiation with a session only lasts until the session leader exits. Which means that no reference counting is required. So using struct pid winds up being a simple optimization to avoid hash table lookups. In the long term the use of pid_nr also ensures that when we have multiple pid spaces mixed everything will work correctly. Signed-off-by: Eric W. Biederman <eric@maxwell.lnxi.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 70e4fab117b..07c9cdbcdca 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -351,7 +351,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
struct signal_struct *sig = task->signal;
if (sig->tty) {
- tty_pgrp = sig->tty->pgrp;
+ tty_pgrp = pid_nr(sig->tty->pgrp);
tty_nr = new_encode_dev(tty_devnum(sig->tty));
}