Merge 4.6-rc7 into tty-next
We want the pty fixes in here as well so that patches can build on it. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -624,7 +624,7 @@ static int pty_unix98_ioctl(struct tty_struct *tty,
|
||||
*/
|
||||
|
||||
static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver,
|
||||
struct inode *ptm_inode, int idx)
|
||||
struct file *file, int idx)
|
||||
{
|
||||
/* Master must be open via /dev/ptmx */
|
||||
return ERR_PTR(-EIO);
|
||||
@@ -640,12 +640,12 @@ static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver,
|
||||
*/
|
||||
|
||||
static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
|
||||
struct inode *pts_inode, int idx)
|
||||
struct file *file, int idx)
|
||||
{
|
||||
struct tty_struct *tty;
|
||||
|
||||
mutex_lock(&devpts_mutex);
|
||||
tty = devpts_get_priv(pts_inode);
|
||||
tty = devpts_get_priv(file->f_path.dentry);
|
||||
mutex_unlock(&devpts_mutex);
|
||||
/* Master must be open before slave */
|
||||
if (!tty)
|
||||
@@ -720,7 +720,7 @@ static int ptmx_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct pts_fs_info *fsi;
|
||||
struct tty_struct *tty;
|
||||
struct inode *slave_inode;
|
||||
struct dentry *dentry;
|
||||
int retval;
|
||||
int index;
|
||||
|
||||
@@ -767,14 +767,12 @@ static int ptmx_open(struct inode *inode, struct file *filp)
|
||||
|
||||
tty_add_file(tty, filp);
|
||||
|
||||
slave_inode = devpts_pty_new(fsi,
|
||||
MKDEV(UNIX98_PTY_SLAVE_MAJOR, index), index,
|
||||
tty->link);
|
||||
if (IS_ERR(slave_inode)) {
|
||||
retval = PTR_ERR(slave_inode);
|
||||
dentry = devpts_pty_new(fsi, index, tty->link);
|
||||
if (IS_ERR(dentry)) {
|
||||
retval = PTR_ERR(dentry);
|
||||
goto err_release;
|
||||
}
|
||||
tty->link->driver_data = slave_inode;
|
||||
tty->link->driver_data = dentry;
|
||||
|
||||
retval = ptm_driver->ops->open(tty, filp);
|
||||
if (retval)
|
||||
|
@@ -1363,12 +1363,12 @@ static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
|
||||
* Locking: tty_mutex must be held. If the tty is found, bump the tty kref.
|
||||
*/
|
||||
static struct tty_struct *tty_driver_lookup_tty(struct tty_driver *driver,
|
||||
struct inode *inode, int idx)
|
||||
struct file *file, int idx)
|
||||
{
|
||||
struct tty_struct *tty;
|
||||
|
||||
if (driver->ops->lookup)
|
||||
tty = driver->ops->lookup(driver, inode, idx);
|
||||
tty = driver->ops->lookup(driver, file, idx);
|
||||
else
|
||||
tty = driver->ttys[idx];
|
||||
|
||||
@@ -2035,7 +2035,7 @@ static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode,
|
||||
}
|
||||
|
||||
/* check whether we're reopening an existing tty */
|
||||
tty = tty_driver_lookup_tty(driver, inode, index);
|
||||
tty = tty_driver_lookup_tty(driver, filp, index);
|
||||
if (IS_ERR(tty)) {
|
||||
mutex_unlock(&tty_mutex);
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user