• Alan Cox's avatar
    tty: shutdown method · feebed65
    Alan Cox authored
    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: default avatarAlan Cox <alan@redhat.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    feebed65
pty.c 13.2 KB