vrevoke/single-user - fix more revoke issues.
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Jul 2009 22:56:25 +0000 (15:56 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Jul 2009 22:56:25 +0000 (15:56 -0700)
commita32446b7b42983c7cb48c360d105496b4a3596c3
tree72f52067b938ff07c7e9b454a149fe90e503f772
parent815c76b979031ed20b418bbdd1a9c8c2e4c09689
vrevoke/single-user - fix more revoke issues.

* vrevoke() no longer clears vp->v_rdev.  Doing so interferes with specfs's
  ability to call dev_dclose().  Fixing this will allow the regular close
  of the vnode to close the underlying device.

  Since the revoke code detaches the vnode from any user-visible file
  descriptors the vnode will end up being closed the moment the last
  referenced to the detached fp goes away.

* kill 1 no longer leaves the syscons in a state where both /dev/ttyv0 and
  /dev/console are marked open (due to the above bug).  This state would
  cause the keyboard to stop working sometimes when dropping into single
  user.

* Add dev_drevoke() and friends.  This allows a device to do something
  when an attempt is made to revoke() the related vnode.

  TTY and PTY devices now attempt to break out of any ttysleep() operation
  (such as when processes are blocked in read()).  This is advisory and
  if it fails to break a process out of a blocked condition that process
  will still detach after the blocked condition is resolved normally.
20 files changed:
sys/dev/misc/dcons/dcons_os.c
sys/dev/misc/nmdm/nmdm.c
sys/dev/misc/syscons/syscons.c
sys/dev/misc/syscons/sysmouse.c
sys/dev/serial/cy/cy.c
sys/dev/serial/dgb/dgm.c
sys/dev/serial/digi/digi.c
sys/dev/serial/rc/rc.c
sys/dev/serial/rp/rp.c
sys/dev/serial/si/si.c
sys/dev/serial/sio/sio.c
sys/dev/serial/stl/stallion.c
sys/dev/serial/stli/istallion.c
sys/dev/usbmisc/ucom/ucom.c
sys/kern/kern_device.c
sys/kern/tty.c
sys/kern/tty_pty.c
sys/kern/vfs_subr.c
sys/sys/device.h
sys/sys/tty.h