tty: shutdown method
authorAlan Cox <alan@redhat.com>
Mon, 13 Oct 2008 09:41:30 +0000 (10:41 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Oct 2008 16:51:42 +0000 (09:51 -0700)
commitfeebed6515a113eeb33919e9557a8b9710ea627c
tree0461178ee0c5e16ea90023e4b6386cb5c57d3391
parentbf7a06bcce205705ea5c7675cbb8ea9239ea30a0
tty: shutdown method

Right now there are various drivers that try to use tty->count to know when
they get the final close. Aristeau Rozanski showed while debugging the vt
sysfs race that this isn't entirely safe.

Instead of driver side tricks to work around this introduce a shutdown which
is called when the tty is being destructed. This also means that the shutdown
method is tied into the refcounting.

Use this to rework the console close/sysfs logic.

Remove lots of special case code from the tty core code. The pty code can now
have a shutdown() method that replaces the special case hackery in the tree
free up paths.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/pty.c
drivers/char/tty_io.c
drivers/char/vt.c
include/linux/tty.h
include/linux/tty_driver.h