From: Linus Torvalds <torvalds@linux-foundation.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Howells <dhowells@redhat.com>,
akpm@linux-foundation.org, gregkh@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove pty_ops_bsd and pty_bsd_ioctl() as they're not used
Date: Mon, 28 Sep 2009 07:55:59 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.01.0909280743310.3349@localhost.localdomain> (raw)
In-Reply-To: <20090928151628.62955233@lxorguk.ukuu.org.uk>
On Mon, 28 Sep 2009, Alan Cox wrote:
> On Mon, 28 Sep 2009 14:53:32 +0100
> David Howells <dhowells@redhat.com> wrote:
> >
> > Possibly legacy_pty_init() should be passing this to tty_set_operations()
> > rather than pty_ops.
>
> It should indeed, otherwise the BSD pty locking ioctl fails.
Hmm. The pty_ops_bsd thing is missing the .install handler. And looking at
it, I'm not immediately seeing the difference between the pty_install
handler and the pty_unix98_install one. There's some differences in
termios initialization, and there is that
driver->other->ttys[idx] = o_tty;
driver->ttys[idx] = tty
thing, but it's not entirely clear to me why the legacy pty's don't use
the 'lookup()' logic instead (like the unix98 ones). Oh well.
Does anybody want to test this patch?
And is there any situation where this can be actually noticed? You
obviously need to have an old distro that actually uses the old static pty
setup.
Linus
---
drivers/char/pty.c | 24 ++++++------------------
1 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 53761ce..7f93ca2 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -261,6 +261,9 @@ done:
return 0;
}
+/* Traditional BSD devices */
+#ifdef CONFIG_LEGACY_PTYS
+
static int pty_install(struct tty_driver *driver, struct tty_struct *tty)
{
struct tty_struct *o_tty;
@@ -310,22 +313,6 @@ free_mem_out:
return -ENOMEM;
}
-
-static const struct tty_operations pty_ops = {
- .install = pty_install,
- .open = pty_open,
- .close = pty_close,
- .write = pty_write,
- .write_room = pty_write_room,
- .flush_buffer = pty_flush_buffer,
- .chars_in_buffer = pty_chars_in_buffer,
- .unthrottle = pty_unthrottle,
- .set_termios = pty_set_termios,
- .resize = pty_resize
-};
-
-/* Traditional BSD devices */
-#ifdef CONFIG_LEGACY_PTYS
static struct tty_driver *pty_driver, *pty_slave_driver;
static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
@@ -342,6 +329,7 @@ static int legacy_count = CONFIG_LEGACY_PTY_COUNT;
module_param(legacy_count, int, 0);
static const struct tty_operations pty_ops_bsd = {
+ .install = pty_install,
.open = pty_open,
.close = pty_close,
.write = pty_write,
@@ -383,7 +371,7 @@ static void __init legacy_pty_init(void)
pty_driver->init_termios.c_ospeed = 38400;
pty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
pty_driver->other = pty_slave_driver;
- tty_set_operations(pty_driver, &pty_ops);
+ tty_set_operations(pty_driver, &pty_ops_bsd);
pty_slave_driver->owner = THIS_MODULE;
pty_slave_driver->driver_name = "pty_slave";
@@ -399,7 +387,7 @@ static void __init legacy_pty_init(void)
pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS |
TTY_DRIVER_REAL_RAW;
pty_slave_driver->other = pty_driver;
- tty_set_operations(pty_slave_driver, &pty_ops);
+ tty_set_operations(pty_slave_driver, &pty_ops_bsd);
if (tty_register_driver(pty_driver))
panic("Couldn't register pty driver");
next prev parent reply other threads:[~2009-09-28 14:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-28 13:53 David Howells
2009-09-28 14:16 ` Alan Cox
2009-09-28 14:55 ` Linus Torvalds [this message]
2009-09-29 15:55 ` David Howells
2009-09-29 16:23 ` Linus Torvalds
2009-09-29 16:38 ` Linus Torvalds
2009-09-29 18:40 ` David Howells
2009-09-29 22:39 ` Alan Cox
2009-09-30 10:20 ` David Howells
2009-09-30 11:28 ` Alan Cox
2009-09-28 14:55 ` David Howells
2009-09-28 15:25 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.01.0909280743310.3349@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dhowells@redhat.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome