aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@us.ibm.com>2008-10-13 10:42:59 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 09:51:43 -0700
commit15f1a6338ddd4e69fff965d4b3a0e1bfb7a13d9c (patch)
tree301eea94cb514dc12b5070fc4b3ab33d3aab4322 /include
parent4a2b5fddd53b80efcb3266ee36e23b8de28e761a (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/devpts_fs.h31
-rw-r--r--include/linux/tty_driver.h3
2 files changed, 23 insertions, 11 deletions
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 154769cad3f..5ce0e5fd712 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -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
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 005d06ad46a..78416b90158 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -225,7 +225,8 @@ struct tty_struct;
struct tty_driver;
struct tty_operations {
- struct tty_struct * (*lookup)(struct tty_driver *driver, int idx);
+ struct tty_struct * (*lookup)(struct tty_driver *driver,
+ struct inode *inode, int idx);
int (*install)(struct tty_driver *driver, struct tty_struct *tty);
void (*remove)(struct tty_driver *driver, struct tty_struct *tty);
int (*open)(struct tty_struct * tty, struct file * filp);