]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC tty fixes, r259549 and r259663
authorgrehan <grehan@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 18 Sep 2014 14:44:47 +0000 (14:44 +0000)
committergrehan <grehan@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 18 Sep 2014 14:44:47 +0000 (14:44 +0000)
commitd80c43e26e21de4b6782959d2608f5f39c1a6aa6
tree829c1a112aac1e04928cbe5a2d27f681149e27e7
parent836f2b8727b004bb71f5a6ca1585a29cc7a10fab
MFC tty fixes, r259549 and r259663

Keep tty_makedev as a function to preserve the KBI on 10-stable
(it is a macro in CURRENT). The changes for this are direct
commits to 10-stable.

r259549 (glebius):
  - Rename tty_makedev() into tty_makedevf() and make it capable
    to fail and return error.
  - Use make_dev_p() in tty_makedevf() instead of make_dev_cred().
  - Always pass MAKEDEV_CHECKNAME flag.
  - Optionally pass MAKEDEV_REF flag.
  - Provide macro for compatibility with old API.

  This fixes races with simultaneous creation and desctruction of
  ttys, and makes it possible to call tty_makedevf() from device
  cloners.

  A race in tty_watermarks() still exist, since the latter drops
  lock for M_WAITOK allocation. This will be addressed in separate
  commit.

r259663 (glebius):
  Move list of ttys handling from the allocating procedures, to the
  device creation stage. A device creation can fail, and in that case
  an entry already on the list will be freed.

KBI issue pointed out by:       kib
Reviewed by:    kib (KBI addition)
Approved by:    re (kib)

git-svn-id: svn://svn.freebsd.org/base/stable/10@271773 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/tty.c
sys/sys/tty.h