Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338333
b: refs/heads/master
c: 8fcbaa2
h: refs/heads/master
i:
  338331: f090dd8
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent dd286fc commit d085337
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cee4ad1ed90a0959fc29f9d30a2526e5e9522cfa
refs/heads/master: 8fcbaa2b7f5b70dba9ed1c7f91d0a270ce752e2c
2 changes: 1 addition & 1 deletion trunk/drivers/tty/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
struct tty_struct *tty;

mutex_lock(&devpts_mutex);
tty = devpts_get_tty(pts_inode, idx);
tty = devpts_get_priv(pts_inode);
mutex_unlock(&devpts_mutex);
/* Master must be open before slave */
if (!tty)
Expand Down
9 changes: 4 additions & 5 deletions trunk/fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
return ret;
}

struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
void *devpts_get_priv(struct inode *pts_inode)
{
struct dentry *dentry;
struct tty_struct *tty;
void *priv = NULL;

BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));

Expand All @@ -605,13 +605,12 @@ struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
if (!dentry)
return NULL;

tty = NULL;
if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
tty = (struct tty_struct *)pts_inode->i_private;
priv = pts_inode->i_private;

dput(dentry);

return tty;
return priv;
}

void devpts_pty_kill(struct tty_struct *tty)
Expand Down
7 changes: 3 additions & 4 deletions trunk/include/linux/devpts_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ int devpts_new_index(struct inode *ptmx_inode);
void devpts_kill_index(struct inode *ptmx_inode, int idx);
/* mknod in devpts */
int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
/* get tty structure */
struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number);
/* get private structure */
void *devpts_get_priv(struct inode *pts_inode);
/* unlink */
void devpts_pty_kill(struct tty_struct *tty);

Expand All @@ -36,8 +36,7 @@ static inline int devpts_pty_new(struct inode *ptmx_inode,
{
return -EINVAL;
}
static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode,
int number)
static inline void *devpts_get_priv(struct inode *pts_inode)
{
return NULL;
}
Expand Down

0 comments on commit d085337

Please sign in to comment.