]> git.hungrycats.org Git - linux/commit
[PATCH] move job control fields from task_struct to
authorAndrew Morton <akpm@osdl.org>
Sun, 5 Oct 2003 04:04:11 +0000 (21:04 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 5 Oct 2003 04:04:11 +0000 (21:04 -0700)
commit1bd563fd41bf28b72605b4c4b9254d31f20a3814
tree1d266c5bd8871d1bd0fb3fc3874ad45cfff70a14
parent9697ce4cdbdf2c6e5f30d462fcfece58cb0e0da4
[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.
21 files changed:
arch/ia64/kernel/unaligned.c
drivers/char/n_tty.c
drivers/char/rocket.c
drivers/char/tty_io.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/net/slip.c
fs/binfmt_elf.c
fs/dquot.c
fs/exec.c
fs/open.c
fs/proc/array.c
include/linux/sched.h
kernel/acct.c
kernel/exit.c
kernel/fork.c
kernel/pid.c
kernel/signal.c
kernel/sys.c
net/ipv4/netfilter/ipt_owner.c
net/ipv6/netfilter/ip6t_owner.c