Add an instance parameter devpts interfaces
Pass-in 'inode' or 'tty' parameter to devpts interfaces. With multiple devpts instances, these parameters will be used in subsequent patches to identify the instance of devpts mounted. The parameters also help simplify devpts implementation. Changelog[v3]: - minor changes due to merge with ttydev updates - rename parameters to emphasize they are ptmx or pts inodes - pass-in tty_struct * to devpts_pty_kill() (this will help cleanup the get_node() call in a subsequent patch) Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
4a2b5fddd5
commit
15f1a6338d
@@ -17,20 +17,31 @@
|
||||
|
||||
#ifdef CONFIG_UNIX98_PTYS
|
||||
|
||||
int devpts_new_index(void);
|
||||
void devpts_kill_index(int idx);
|
||||
int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */
|
||||
struct tty_struct *devpts_get_tty(int number); /* get tty structure */
|
||||
void devpts_pty_kill(int number); /* unlink */
|
||||
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);
|
||||
/* unlink */
|
||||
void devpts_pty_kill(struct tty_struct *tty);
|
||||
|
||||
#else
|
||||
|
||||
/* Dummy stubs in the no-pty case */
|
||||
static inline int devpts_new_index(void) { return -EINVAL; }
|
||||
static inline void devpts_kill_index(int idx) { }
|
||||
static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; }
|
||||
static inline struct tty_struct *devpts_get_tty(int number) { return NULL; }
|
||||
static inline void devpts_pty_kill(int number) { }
|
||||
static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
|
||||
static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
|
||||
static inline int devpts_pty_new(struct inode *ptmx_inode,
|
||||
struct tty_struct *tty)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode,
|
||||
int number)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void devpts_pty_kill(struct tty_struct *tty) { }
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user