diff options
author | Sukadev Bhattiprolu <sukadev@us.ibm.com> | 2008-04-30 03:54:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:48 -0400 |
commit | 718a916338e821a10961e6a7a17430c18e5e58d9 (patch) | |
tree | b261fd36e7a4f642223668596c85da62b60729a4 /include | |
parent | 4f8f9d66cdac4845409f7520e4f287a1907a6bf9 (diff) |
devpts: factor out PTY index allocation
Factor out the code used to allocate/free a pts index into new interfaces,
devpts_new_index() and devpts_kill_index(). This localizes the external data
structures used in managing the pts indices.
[akpm@linux-foundation.org: undo accidental mutex2sem conversion]
Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/devpts_fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index b672ddc00735..154769cad3f3 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #ifdef CONFIG_UNIX98_PTYS | 18 | #ifdef CONFIG_UNIX98_PTYS |
19 | 19 | ||
20 | int devpts_new_index(void); | ||
21 | void devpts_kill_index(int idx); | ||
20 | int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */ | 22 | int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */ |
21 | struct tty_struct *devpts_get_tty(int number); /* get tty structure */ | 23 | struct tty_struct *devpts_get_tty(int number); /* get tty structure */ |
22 | void devpts_pty_kill(int number); /* unlink */ | 24 | void devpts_pty_kill(int number); /* unlink */ |
@@ -24,6 +26,8 @@ void devpts_pty_kill(int number); /* unlink */ | |||
24 | #else | 26 | #else |
25 | 27 | ||
26 | /* Dummy stubs in the no-pty case */ | 28 | /* Dummy stubs in the no-pty case */ |
29 | static inline int devpts_new_index(void) { return -EINVAL; } | ||
30 | static inline void devpts_kill_index(int idx) { } | ||
27 | static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; } | 31 | static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; } |
28 | static inline struct tty_struct *devpts_get_tty(int number) { return NULL; } | 32 | static inline struct tty_struct *devpts_get_tty(int number) { return NULL; } |
29 | static inline void devpts_pty_kill(int number) { } | 33 | static inline void devpts_pty_kill(int number) { } |