diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2012-01-05 13:06:02 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-24 14:00:41 -0800 |
commit | a4834c102f4a46808630cad1a545cb0706b3b0a2 (patch) | |
tree | 683971bcb7796e1649b4bd9b15619d700aa9e0da /drivers/tty/pty.c | |
parent | 593a27c4b212e2afdf772a1f8dcb894e91bda0fa (diff) | |
download | op-kernel-dev-a4834c102f4a46808630cad1a545cb0706b3b0a2.zip op-kernel-dev-a4834c102f4a46808630cad1a545cb0706b3b0a2.tar.gz |
tty: move pty count limiting into devpts
Let's move this stuff to the better place, where we can account pty right in
tty-indexes managing code.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r-- | drivers/tty/pty.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 03147fa..d505837 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -21,7 +21,6 @@ #include <linux/major.h> #include <linux/mm.h> #include <linux/init.h> -#include <linux/sysctl.h> #include <linux/device.h> #include <linux/uaccess.h> #include <linux/bitops.h> @@ -439,55 +438,9 @@ static inline void legacy_pty_init(void) { } /* Unix98 devices */ #ifdef CONFIG_UNIX98_PTYS -/* - * sysctl support for setting limits on the number of Unix98 ptys allocated. - * Otherwise one can eat up all kernel memory by opening /dev/ptmx repeatedly. - */ -int pty_limit = NR_UNIX98_PTY_DEFAULT; -static int pty_limit_min; -static int pty_limit_max = NR_UNIX98_PTY_MAX; -static int pty_count; static struct cdev ptmx_cdev; -static struct ctl_table pty_table[] = { - { - .procname = "max", - .maxlen = sizeof(int), - .mode = 0644, - .data = &pty_limit, - .proc_handler = proc_dointvec_minmax, - .extra1 = &pty_limit_min, - .extra2 = &pty_limit_max, - }, { - .procname = "nr", - .maxlen = sizeof(int), - .mode = 0444, - .data = &pty_count, - .proc_handler = proc_dointvec, - }, - {} -}; - -static struct ctl_table pty_kern_table[] = { - { - .procname = "pty", - .mode = 0555, - .child = pty_table, - }, - {} -}; - -static struct ctl_table pty_root_table[] = { - { - .procname = "kernel", - .mode = 0555, - .child = pty_kern_table, - }, - {} -}; - - static int pty_unix98_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { @@ -587,7 +540,6 @@ static int pty_unix98_install(struct tty_driver *driver, struct tty_struct *tty) */ tty_driver_kref_get(driver); tty->count++; - pty_count++; return 0; err_free_mem: deinitialize_tty_struct(o_tty); @@ -601,7 +553,6 @@ err_free_tty: static void ptm_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) { - pty_count--; } static void pts_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) @@ -760,8 +711,6 @@ static void __init unix98_pty_init(void) if (tty_register_driver(pts_driver)) panic("Couldn't register Unix98 pts driver"); - register_sysctl_table(pty_root_table); - /* Now create the /dev/ptmx special device */ tty_default_fops(&ptmx_fops); ptmx_fops.open = ptmx_open; |