diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-10-04 21:04:11 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-10-04 21:04:11 -0700 |
| commit | 1bd563fd41bf28b72605b4c4b9254d31f20a3814 (patch) | |
| tree | 1d266c5bd8871d1bd0fb3fc3874ad45cfff70a14 /fs/proc/array.c | |
| parent | 9697ce4cdbdf2c6e5f30d462fcfece58cb0e0da4 (diff) | |
[PATCH] move job control fields from task_struct to
From: Roland McGrath <roland@redhat.com>
This patch completes what was started with the `process_group' accessor
function, moving all the job control-related fields from task_struct into
signal_struct and using process_foo accessor functions to read them. All
these things are per-process in POSIX, none per-thread. Off hand it's hard
to come up with the hairy MT scenarios in which the existing code would do
insane things, but trust me, they're there. At any rate, all the uses
being done via inline accessor functions now has got to be all good.
I did a "make allyesconfig" build and caught the few random drivers and
whatnot that referred to these fields. I was surprised to find how few
references to ->tty there really were to fix up. I'm sure there will be a
few more fixups needed in non-x86 code. The only actual testing of a
running kernel with these patches I've done is on my normal minimal x86
config. Everything works fine as it did before as far as I can tell.
One issue that may be of concern is the lack of any locking on multiple
threads diddling these fields. I don't think it really matters, though
there might be some obscure races that could produce inconsistent job
control results. Nothing shattering, I'm sure; probably only something
like a multi-threaded program calling setsid while its other threads do tty
i/o, which never happens in reality. This is the same situation we get by
using ->group_leader->foo without other synchronization, which seemed to be
the trend and noone was worried about it.
Diffstat (limited to 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 1eba76a6f603..7029fc9eb211 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -304,9 +304,9 @@ int proc_pid_stat(struct task_struct *task, char * buffer) mm = task->mm; if(mm) mm = mmgrab(mm); - if (task->tty) { - tty_pgrp = task->tty->pgrp; - tty_nr = new_encode_dev(tty_devnum(task->tty)); + if (process_tty(task)) { + tty_pgrp = process_tty(task)->pgrp; + tty_nr = new_encode_dev(tty_devnum(process_tty(task))); } task_unlock(task); if (mm) { @@ -345,7 +345,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer) state, ppid, process_group(task), - task->session, + process_session(task), tty_nr, tty_pgrp, task->flags, |
