public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] pty: show associative slave of ptmx in fdinfo
@ 2017-06-11 16:13 Masatake YAMATO
  0 siblings, 0 replies; 6+ messages in thread
From: Masatake YAMATO @ 2017-06-11 16:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: yamato

This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
specifies /dev/ptmx. The field shows the index of associative
slave pts.

Though a minor number is given for each pts instance, ptmx is not.
It means there is no way in user-space to know the association between
file descriptors for pts/n and ptmx. (n = 0, 1, ...)

This is different from pipe. About pipe such association can be solved
by inode of pipefs.

Providing the way to know the association between pts/n and ptmx helps
users understand the status of running system. lsof can utilize this field.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 drivers/tty/pty.c          | 12 +++++++++++-
 drivers/tty/tty_io.c       | 15 +++++++++++++++
 include/linux/tty_driver.h |  5 +++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 6579957..9357c6a 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -669,6 +669,13 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 	}
 }
 
+#ifdef CONFIG_PROC_FS
+static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
+{
+	seq_printf(m, "tty-index:\t%d\n", tty->index);
+}
+#endif
+
 static const struct tty_operations ptm_unix98_ops = {
 	.lookup = ptm_unix98_lookup,
 	.install = pty_unix98_install,
@@ -682,7 +689,10 @@ static const struct tty_operations ptm_unix98_ops = {
 	.unthrottle = pty_unthrottle,
 	.ioctl = pty_unix98_ioctl,
 	.resize = pty_resize,
-	.cleanup = pty_cleanup
+	.cleanup = pty_cleanup,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo = pty_show_fdinfo,
+#endif
 };
 
 static const struct tty_operations pty_unix98_ops = {
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0c150b5..4a00e34 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -106,6 +106,8 @@
 #include <linux/kmod.h>
 #include <linux/nsproxy.h>
 
+#include <linux/seq_file.h>
+
 #undef TTY_DEBUG_HANGUP
 #ifdef TTY_DEBUG_HANGUP
 # define tty_debug_hangup(tty, f, args...)	tty_debug(tty, f, ##args)
@@ -412,6 +414,16 @@ static int hung_up_tty_fasync(int fd, struct file *file, int on)
 	return -ENOTTY;
 }
 
+#ifdef CONFIG_PROC_FS
+static void tty_show_fdinfo(struct seq_file *m, struct file *file)
+{
+	struct tty_struct *tty = file_tty(file);
+
+	if (tty && tty->ops && tty->ops->show_fdinfo)
+		tty->ops->show_fdinfo(tty, m);
+}
+#endif
+
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
 	.read		= tty_read,
@@ -422,6 +434,9 @@ static const struct file_operations tty_fops = {
 	.open		= tty_open,
 	.release	= tty_release,
 	.fasync		= tty_fasync,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo	= tty_show_fdinfo,
+#endif
 };
 
 static const struct file_operations console_fops = {
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b742b5e..499823d 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -243,6 +243,7 @@
 #include <linux/list.h>
 #include <linux/cdev.h>
 #include <linux/termios.h>
+#include <linux/seq_file.h>
 
 struct tty_struct;
 struct tty_driver;
@@ -285,6 +286,10 @@ struct tty_operations {
 	int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 	int (*get_icount)(struct tty_struct *tty,
 				struct serial_icounter_struct *icount);
+#ifdef CONFIG_PROC_FS
+	void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);
+#endif
+
 #ifdef CONFIG_CONSOLE_POLL
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND] pty: show associative slave of ptmx in fdinfo
@ 2017-06-26  9:05 Masatake YAMATO
  0 siblings, 0 replies; 6+ messages in thread
From: Masatake YAMATO @ 2017-06-26  9:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: yamato

This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
specifies /dev/ptmx. The field shows the index of associative
slave pts.

Though a minor number is given for each pts instance, ptmx is not.
It means there is no way in user-space to know the association between
file descriptors for pts/n and ptmx. (n = 0, 1, ...)

This is different from pipe. About pipe such association can be solved
by inode of pipefs.

Providing the way to know the association between pts/n and ptmx helps
users understand the status of running system. lsof can utilize this field.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 drivers/tty/pty.c          | 12 +++++++++++-
 drivers/tty/tty_io.c       | 15 +++++++++++++++
 include/linux/tty_driver.h |  5 +++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 6579957..9357c6a 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -669,6 +669,13 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 	}
 }
 
+#ifdef CONFIG_PROC_FS
+static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
+{
+	seq_printf(m, "tty-index:\t%d\n", tty->index);
+}
+#endif
+
 static const struct tty_operations ptm_unix98_ops = {
 	.lookup = ptm_unix98_lookup,
 	.install = pty_unix98_install,
@@ -682,7 +689,10 @@ static const struct tty_operations ptm_unix98_ops = {
 	.unthrottle = pty_unthrottle,
 	.ioctl = pty_unix98_ioctl,
 	.resize = pty_resize,
-	.cleanup = pty_cleanup
+	.cleanup = pty_cleanup,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo = pty_show_fdinfo,
+#endif
 };
 
 static const struct tty_operations pty_unix98_ops = {
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0c150b5..4a00e34 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -106,6 +106,8 @@
 #include <linux/kmod.h>
 #include <linux/nsproxy.h>
 
+#include <linux/seq_file.h>
+
 #undef TTY_DEBUG_HANGUP
 #ifdef TTY_DEBUG_HANGUP
 # define tty_debug_hangup(tty, f, args...)	tty_debug(tty, f, ##args)
@@ -412,6 +414,16 @@ static int hung_up_tty_fasync(int fd, struct file *file, int on)
 	return -ENOTTY;
 }
 
+#ifdef CONFIG_PROC_FS
+static void tty_show_fdinfo(struct seq_file *m, struct file *file)
+{
+	struct tty_struct *tty = file_tty(file);
+
+	if (tty && tty->ops && tty->ops->show_fdinfo)
+		tty->ops->show_fdinfo(tty, m);
+}
+#endif
+
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
 	.read		= tty_read,
@@ -422,6 +434,9 @@ static const struct file_operations tty_fops = {
 	.open		= tty_open,
 	.release	= tty_release,
 	.fasync		= tty_fasync,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo	= tty_show_fdinfo,
+#endif
 };
 
 static const struct file_operations console_fops = {
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b742b5e..499823d 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -243,6 +243,7 @@
 #include <linux/list.h>
 #include <linux/cdev.h>
 #include <linux/termios.h>
+#include <linux/seq_file.h>
 
 struct tty_struct;
 struct tty_driver;
@@ -285,6 +286,10 @@ struct tty_operations {
 	int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 	int (*get_icount)(struct tty_struct *tty,
 				struct serial_icounter_struct *icount);
+#ifdef CONFIG_PROC_FS
+	void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);
+#endif
+
 #ifdef CONFIG_CONSOLE_POLL
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND] pty: show associative slave of ptmx in fdinfo
@ 2017-07-12 19:34 Masatake YAMATO
  2017-07-17 14:41 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Masatake YAMATO @ 2017-07-12 19:34 UTC (permalink / raw)
  To: linux-kernel, gregkh, jslaby; +Cc: yamato

This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
specifies /dev/ptmx. The field shows the index of associative
slave pts.

Though a minor number is given for each pts instance, ptmx is not.
It means there is no way in user-space to know the association between
file descriptors for pts/n and ptmx. (n = 0, 1, ...)

This is different from pipe. About pipe such association can be solved
by inode of pipefs.

Providing the way to know the association between pts/n and ptmx helps
users understand the status of running system. lsof can utilize this field.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 drivers/tty/pty.c          | 12 +++++++++++-
 drivers/tty/tty_io.c       | 15 +++++++++++++++
 include/linux/tty_driver.h |  5 +++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 6579957..9357c6a 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -669,6 +669,13 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 	}
 }
 
+#ifdef CONFIG_PROC_FS
+static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
+{
+	seq_printf(m, "tty-index:\t%d\n", tty->index);
+}
+#endif
+
 static const struct tty_operations ptm_unix98_ops = {
 	.lookup = ptm_unix98_lookup,
 	.install = pty_unix98_install,
@@ -682,7 +689,10 @@ static const struct tty_operations ptm_unix98_ops = {
 	.unthrottle = pty_unthrottle,
 	.ioctl = pty_unix98_ioctl,
 	.resize = pty_resize,
-	.cleanup = pty_cleanup
+	.cleanup = pty_cleanup,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo = pty_show_fdinfo,
+#endif
 };
 
 static const struct tty_operations pty_unix98_ops = {
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0c150b5..4a00e34 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -106,6 +106,8 @@
 #include <linux/kmod.h>
 #include <linux/nsproxy.h>
 
+#include <linux/seq_file.h>
+
 #undef TTY_DEBUG_HANGUP
 #ifdef TTY_DEBUG_HANGUP
 # define tty_debug_hangup(tty, f, args...)	tty_debug(tty, f, ##args)
@@ -412,6 +414,16 @@ static int hung_up_tty_fasync(int fd, struct file *file, int on)
 	return -ENOTTY;
 }
 
+#ifdef CONFIG_PROC_FS
+static void tty_show_fdinfo(struct seq_file *m, struct file *file)
+{
+	struct tty_struct *tty = file_tty(file);
+
+	if (tty && tty->ops && tty->ops->show_fdinfo)
+		tty->ops->show_fdinfo(tty, m);
+}
+#endif
+
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
 	.read		= tty_read,
@@ -422,6 +434,9 @@ static const struct file_operations tty_fops = {
 	.open		= tty_open,
 	.release	= tty_release,
 	.fasync		= tty_fasync,
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo	= tty_show_fdinfo,
+#endif
 };
 
 static const struct file_operations console_fops = {
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b742b5e..499823d 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -243,6 +243,7 @@
 #include <linux/list.h>
 #include <linux/cdev.h>
 #include <linux/termios.h>
+#include <linux/seq_file.h>
 
 struct tty_struct;
 struct tty_driver;
@@ -285,6 +286,10 @@ struct tty_operations {
 	int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 	int (*get_icount)(struct tty_struct *tty,
 				struct serial_icounter_struct *icount);
+#ifdef CONFIG_PROC_FS
+	void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);
+#endif
+
 #ifdef CONFIG_CONSOLE_POLL
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] pty: show associative slave of ptmx in fdinfo
  2017-07-12 19:34 [PATCH RESEND] pty: show associative slave of ptmx in fdinfo Masatake YAMATO
@ 2017-07-17 14:41 ` Greg KH
  2017-07-31  0:01   ` [PATCH v2 resend] " Masatake YAMATO
  2017-08-14 14:41   ` Masatake YAMATO
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2017-07-17 14:41 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: linux-kernel, jslaby

On Thu, Jul 13, 2017 at 04:34:37AM +0900, Masatake YAMATO wrote:
> This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
> specifies /dev/ptmx. The field shows the index of associative
> slave pts.
> 
> Though a minor number is given for each pts instance, ptmx is not.
> It means there is no way in user-space to know the association between
> file descriptors for pts/n and ptmx. (n = 0, 1, ...)
> 
> This is different from pipe. About pipe such association can be solved
> by inode of pipefs.
> 
> Providing the way to know the association between pts/n and ptmx helps
> users understand the status of running system. lsof can utilize this field.
> 
> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
> ---
>  drivers/tty/pty.c          | 12 +++++++++++-
>  drivers/tty/tty_io.c       | 15 +++++++++++++++
>  include/linux/tty_driver.h |  5 +++++
>  3 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
> index 6579957..9357c6a 100644
> --- a/drivers/tty/pty.c
> +++ b/drivers/tty/pty.c
> @@ -669,6 +669,13 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
>  	}
>  }
>  
> +#ifdef CONFIG_PROC_FS

There is no real need for all of the #ifdef everywhere here, if PROC_FS
is not enabled, the functions will just not be called, right?

Can you fix this up and resend a new version?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 resend] pty: show associative slave of ptmx in fdinfo
  2017-07-17 14:41 ` Greg KH
@ 2017-07-31  0:01   ` Masatake YAMATO
  2017-08-14 14:41   ` Masatake YAMATO
  1 sibling, 0 replies; 6+ messages in thread
From: Masatake YAMATO @ 2017-07-31  0:01 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, yamato

This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
specifies /dev/ptmx. The field shows the index of associative
slave pts.

Though a minor number is given for each pts instance, ptmx is not.
It means there is no way in user-space to know the association between
file descriptors for pts/n and ptmx. (n = 0, 1, ...)

This is different from pipe. About pipe such association can be solved
by inode of pipefs.

Providing the way to know the association between pts/n and ptmx helps
users understand the status of running system. lsof can utilize this field.

Change in v2:

	Remove all #ifdef CONFIG_PROC_FS/#endif.
	Suggested by Greg KH.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 drivers/tty/pty.c          | 8 +++++++-
 drivers/tty/tty_io.c       | 9 +++++++++
 include/linux/tty_driver.h | 2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index d1399aa..ce27be4 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -742,6 +742,11 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 	}
 }
 
+static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
+{
+	seq_printf(m, "tty-index:\t%d\n", tty->index);
+}
+
 static const struct tty_operations ptm_unix98_ops = {
 	.lookup = ptm_unix98_lookup,
 	.install = pty_unix98_install,
@@ -756,7 +761,8 @@ static const struct tty_operations ptm_unix98_ops = {
 	.ioctl = pty_unix98_ioctl,
 	.compat_ioctl = pty_unix98_compat_ioctl,
 	.resize = pty_resize,
-	.cleanup = pty_cleanup
+	.cleanup = pty_cleanup,
+	.show_fdinfo = pty_show_fdinfo,
 };
 
 static const struct tty_operations pty_unix98_ops = {
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 974b13d..c3c8fd0 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -462,6 +462,14 @@ static int hung_up_tty_fasync(int fd, struct file *file, int on)
 	return -ENOTTY;
 }
 
+static void tty_show_fdinfo(struct seq_file *m, struct file *file)
+{
+	struct tty_struct *tty = file_tty(file);
+
+	if (tty && tty->ops && tty->ops->show_fdinfo)
+		tty->ops->show_fdinfo(tty, m);
+}
+
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
 	.read		= tty_read,
@@ -472,6 +480,7 @@ static const struct file_operations tty_fops = {
 	.open		= tty_open,
 	.release	= tty_release,
 	.fasync		= tty_fasync,
+	.show_fdinfo	= tty_show_fdinfo,
 };
 
 static const struct file_operations console_fops = {
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b742b5e..570b05b 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -243,6 +243,7 @@
 #include <linux/list.h>
 #include <linux/cdev.h>
 #include <linux/termios.h>
+#include <linux/seq_file.h>
 
 struct tty_struct;
 struct tty_driver;
@@ -285,6 +286,7 @@ struct tty_operations {
 	int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 	int (*get_icount)(struct tty_struct *tty,
 				struct serial_icounter_struct *icount);
+	void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);
 #ifdef CONFIG_CONSOLE_POLL
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 resend] pty: show associative slave of ptmx in fdinfo
  2017-07-17 14:41 ` Greg KH
  2017-07-31  0:01   ` [PATCH v2 resend] " Masatake YAMATO
@ 2017-08-14 14:41   ` Masatake YAMATO
  1 sibling, 0 replies; 6+ messages in thread
From: Masatake YAMATO @ 2017-08-14 14:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, yamato

This patch adds "tty-index" field to /proc/PID/fdinfo/N if N
specifies /dev/ptmx. The field shows the index of associative
slave pts.

Though a minor number is given for each pts instance, ptmx is not.
It means there is no way in user-space to know the association between
file descriptors for pts/n and ptmx. (n = 0, 1, ...)

This is different from pipe. About pipe such association can be solved
by inode of pipefs.

Providing the way to know the association between pts/n and ptmx helps
users understand the status of running system. lsof can utilize this field.

Change in v2:

	Remove all #ifdef CONFIG_PROC_FS/#endif.
	Suggested by Greg KH.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 drivers/tty/pty.c          | 8 +++++++-
 drivers/tty/tty_io.c       | 9 +++++++++
 include/linux/tty_driver.h | 2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index d1399aa..ce27be4 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -742,6 +742,11 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 	}
 }
 
+static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
+{
+	seq_printf(m, "tty-index:\t%d\n", tty->index);
+}
+
 static const struct tty_operations ptm_unix98_ops = {
 	.lookup = ptm_unix98_lookup,
 	.install = pty_unix98_install,
@@ -756,7 +761,8 @@ static const struct tty_operations ptm_unix98_ops = {
 	.ioctl = pty_unix98_ioctl,
 	.compat_ioctl = pty_unix98_compat_ioctl,
 	.resize = pty_resize,
-	.cleanup = pty_cleanup
+	.cleanup = pty_cleanup,
+	.show_fdinfo = pty_show_fdinfo,
 };
 
 static const struct tty_operations pty_unix98_ops = {
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 974b13d..c3c8fd0 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -462,6 +462,14 @@ static int hung_up_tty_fasync(int fd, struct file *file, int on)
 	return -ENOTTY;
 }
 
+static void tty_show_fdinfo(struct seq_file *m, struct file *file)
+{
+	struct tty_struct *tty = file_tty(file);
+
+	if (tty && tty->ops && tty->ops->show_fdinfo)
+		tty->ops->show_fdinfo(tty, m);
+}
+
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
 	.read		= tty_read,
@@ -472,6 +480,7 @@ static const struct file_operations tty_fops = {
 	.open		= tty_open,
 	.release	= tty_release,
 	.fasync		= tty_fasync,
+	.show_fdinfo	= tty_show_fdinfo,
 };
 
 static const struct file_operations console_fops = {
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b742b5e..570b05b 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -243,6 +243,7 @@
 #include <linux/list.h>
 #include <linux/cdev.h>
 #include <linux/termios.h>
+#include <linux/seq_file.h>
 
 struct tty_struct;
 struct tty_driver;
@@ -285,6 +286,7 @@ struct tty_operations {
 	int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 	int (*get_icount)(struct tty_struct *tty,
 				struct serial_icounter_struct *icount);
+	void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);
 #ifdef CONFIG_CONSOLE_POLL
 	int (*poll_init)(struct tty_driver *driver, int line, char *options);
 	int (*poll_get_char)(struct tty_driver *driver, int line);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-14 14:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 19:34 [PATCH RESEND] pty: show associative slave of ptmx in fdinfo Masatake YAMATO
2017-07-17 14:41 ` Greg KH
2017-07-31  0:01   ` [PATCH v2 resend] " Masatake YAMATO
2017-08-14 14:41   ` Masatake YAMATO
  -- strict thread matches above, loose matches on Subject: below --
2017-06-26  9:05 [PATCH RESEND] " Masatake YAMATO
2017-06-11 16:13 Masatake YAMATO

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox