diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 13:55:54 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 13:55:54 -0800 |
commit | 0ef1698e4d6282a1665207c40b115ec78fceda9b (patch) | |
tree | 61df100f821a49b04bd4b2914fcb9998ee88e37c /drivers | |
parent | 6dc01aa65306fe46b7ba38db51fad4ed81c23d00 (diff) |
Revert "TTY: get rid of BTM around devpts_*"
This reverts commit d3bda5298aad98c7a27678bdd0dd9d008ab9e685.
Sasha reported that this causes problems, so revert it.
Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/pty.c | 6 | ||||
-rw-r--r-- | drivers/tty/tty_io.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 39afd045f8e..ddec9f3c339 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -54,8 +54,8 @@ static void pty_close(struct tty_struct *tty, struct file *filp) wake_up_interruptible(&tty->link->write_wait); if (tty->driver->subtype == PTY_TYPE_MASTER) { set_bit(TTY_OTHER_CLOSED, &tty->flags); - tty_unlock(); devpts_pty_kill(tty->link); + tty_unlock(); tty_vhangup(tty->link); tty_lock(); } @@ -613,7 +613,9 @@ static int ptmx_open(struct inode *inode, struct file *filp) return retval; /* find a device that is not in use. */ + tty_lock(); index = devpts_new_index(inode); + tty_unlock(); if (index < 0) { retval = index; goto err_file; @@ -648,8 +650,8 @@ err_release: tty_release(inode, filp); return retval; out: - tty_unlock(); devpts_kill_index(inode, index); + tty_unlock(); err_file: tty_free_file(filp); return retval; diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index ea7ebe22a16..44736f9e61d 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1789,11 +1789,11 @@ int tty_release(struct inode *inode, struct file *filp) * the slots and preserving the termios structure. */ release_tty(tty, idx); - tty_unlock(); /* Make this pty number available for reallocation */ if (devpts) devpts_kill_index(inode, idx); + tty_unlock(); return 0; } |