diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | drivers/char/pty.c | 9 | ||||
-rw-r--r-- | include/linux/tty.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a57c1f216b21..bdddd3cd46dd 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1430,6 +1430,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1430 | pt. [PARIDE] | 1430 | pt. [PARIDE] |
1431 | See Documentation/paride.txt. | 1431 | See Documentation/paride.txt. |
1432 | 1432 | ||
1433 | pty.legacy_count= | ||
1434 | [KNL] Number of legacy pty's. Overwrites compiled-in | ||
1435 | default number. | ||
1436 | |||
1433 | quiet [KNL] Disable most log messages | 1437 | quiet [KNL] Disable most log messages |
1434 | 1438 | ||
1435 | r128= [HW,DRM] | 1439 | r128= [HW,DRM] |
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index de14aea34e11..73de77105fea 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -248,14 +248,19 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, | |||
248 | return -ENOIOCTLCMD; | 248 | return -ENOIOCTLCMD; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int legacy_count = CONFIG_LEGACY_PTY_COUNT; | ||
252 | module_param(legacy_count, int, 0); | ||
253 | |||
251 | static void __init legacy_pty_init(void) | 254 | static void __init legacy_pty_init(void) |
252 | { | 255 | { |
256 | if (legacy_count <= 0) | ||
257 | return; | ||
253 | 258 | ||
254 | pty_driver = alloc_tty_driver(NR_PTYS); | 259 | pty_driver = alloc_tty_driver(legacy_count); |
255 | if (!pty_driver) | 260 | if (!pty_driver) |
256 | panic("Couldn't allocate pty driver"); | 261 | panic("Couldn't allocate pty driver"); |
257 | 262 | ||
258 | pty_slave_driver = alloc_tty_driver(NR_PTYS); | 263 | pty_slave_driver = alloc_tty_driver(legacy_count); |
259 | if (!pty_slave_driver) | 264 | if (!pty_slave_driver) |
260 | panic("Couldn't allocate pty slave driver"); | 265 | panic("Couldn't allocate pty slave driver"); |
261 | 266 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 6570719eafdf..60478f6e5dc6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -21,7 +21,6 @@ | |||
21 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are | 21 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are |
22 | * hardcoded at present.) | 22 | * hardcoded at present.) |
23 | */ | 23 | */ |
24 | #define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */ | ||
25 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
26 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
27 | #define NR_LDISCS 17 | 26 | #define NR_LDISCS 17 |