<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc/proc_tty.c, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/proc/proc_tty.c?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/proc/proc_tty.c?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-01-13T16:03:16Z</updated>
<entry>
<title>proc: use seq_puts()/seq_putc() where possible</title>
<updated>2011-01-13T16:03:16Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2011-01-13T01:00:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9d6de12f70d2fb1487c4f482a21fed25fe74e0fd'/>
<id>urn:sha1:9d6de12f70d2fb1487c4f482a21fed25fe74e0fd</id>
<content type='text'>
For string without format specifiers, use seq_puts().
For seq_printf("\n"), use seq_putc('\n').

   text	   data	    bss	    dec	    hex	filename
  61866	    488	    112	  62466	   f402	fs/proc/proc.o
  61729	    488	    112	  62329	   f379	fs/proc/proc.o
  ----------------------------------------------------
  			   -139

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "tty: Add a new file /proc/tty/consoles"</title>
<updated>2010-10-23T15:14:12Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-23T15:14:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6c2754c28f2388a276fe21edde826f2113c8f60e'/>
<id>urn:sha1:6c2754c28f2388a276fe21edde826f2113c8f60e</id>
<content type='text'>
This reverts commit f4a3e0bceb57466c31757f25e4e0ed108d1299ec.  Jiri
Sladby points out that the tty structure we're using may already be
gone, and Al Viro doesn't hold back in complaining about the random
loading of 'filp-&gt;private_data' which doesn't have to be a pointer at
all, nor does checking the magic field for TTY_MAGIC prove anything.

Belated review by Al:

 "a) global variable depending on stdin of the last opener? Affecting
     output of read(2)? Really?

  b) iterator is broken; list should be locked in -&gt;start(), unlocked in
     -&gt;stop() and *NOT* unlocked/relocked in -&gt;next()

  c) -&gt;show() ought to do nothing in case of -&gt;device == NULL, instead
     of skipping those in -&gt;next()/-&gt;start()

  d) regardless of the merits of the bright idea about asterisk at that
     line in output *and* regardless of (a), the implementation is not
     only atrociously ugly, it's actually very likely to be a roothole.
     Verifying that Cthulhu knows what number happens to be address of a
     tty_struct by blindly dereferencing memory at that address...
     Ouch.

  Please revert that crap."

And Christoph pipes in and NAK's the approach of walking fd tables etc
too.  So it's pretty unanimous.

Noticed-by: Jri Slaby &lt;jslaby@suse.cz&gt;
Requested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Cc: Werner Fink &lt;werner@suse.de&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Add a new file /proc/tty/consoles</title>
<updated>2010-10-22T17:20:05Z</updated>
<author>
<name>Dr. Werner Fink</name>
<email>werner@suse.de</email>
</author>
<published>2010-09-22T10:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f4a3e0bceb57466c31757f25e4e0ed108d1299ec'/>
<id>urn:sha1:f4a3e0bceb57466c31757f25e4e0ed108d1299ec</id>
<content type='text'>
Add a new file /proc/tty/consoles to be able to determine the registered
system console lines.  If the reading process holds /dev/console open at
the regular standard input stream the active device will be marked by an
asterisk.  Show possible operations and also decode the used flags of
the listed console lines.

Signed-off-by: Werner Fink &lt;werner@suse.de&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>proc tty: remove struct tty_operations::read_proc</title>
<updated>2009-04-01T15:59:10Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-03-31T22:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0f043a81ebe84be3576667f04fdda481609e3816'/>
<id>urn:sha1:0f043a81ebe84be3576667f04fdda481609e3816</id>
<content type='text'>
struct tty_operations::proc_fops took it's place and there is one less
create_proc_read_entry() user now!

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc tty: add struct tty_operations::proc_fops</title>
<updated>2009-04-01T15:59:08Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-03-31T22:19:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ae149b6bec64a09373ba20fce75f8aa6b14b78fd'/>
<id>urn:sha1:ae149b6bec64a09373ba20fce75f8aa6b14b78fd</id>
<content type='text'>
Used for gradual switch of TTY drivers from using -&gt;read_proc which helps
with gradual switch from -&gt;read_proc for the whole tree.

As side effect, fix possible race condition when -&gt;data initialized after
PDE is hooked into proc tree.

-&gt;proc_fops takes precedence over -&gt;read_proc.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc 2/2: remove struct proc_dir_entry::owner</title>
<updated>2009-03-30T21:14:44Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-03-25T19:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=99b76233803beab302123d243eea9e41149804f3'/>
<id>urn:sha1:99b76233803beab302123d243eea9e41149804f3</id>
<content type='text'>
Setting -&gt;owner as done currently (pde-&gt;owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
-&gt;owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep -&gt;owner and supply it at registration time like -&gt;proc_fops
and -&gt;data.

But this leaves -&gt;owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching -&gt;owner. -&gt;proc_fops is declared as "const" which should give
some thoughts.

-&gt;read_proc/-&gt;write_proc were just fixed to not require -&gt;owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing -&gt;owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

http://bugzilla.kernel.org/show_bug.cgi?id=12454

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
</content>
</entry>
<entry>
<title>tty: Ldisc revamp</title>
<updated>2008-07-21T00:12:34Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@redhat.com</email>
</author>
<published>2008-07-16T20:53:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a352def21a642133758b868c71bee12ab34ad5c5'/>
<id>urn:sha1:a352def21a642133758b868c71bee12ab34ad5c5</id>
<content type='text'>
Move the line disciplines towards a conventional -&gt;ops arrangement.  For
the moment the actual 'tty_ldisc' struct in the tty is kept as part of
the tty struct but this can then be changed if it turns out that when it
all settles down we want to refcount ldiscs separately to the tty.

Pull the ldisc code out of /proc and put it with our ldisc code.

Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: The big operations rework</title>
<updated>2008-04-30T15:29:47Z</updated>
<author>
<name>Alan Cox</name>
<email>alan@lxorguk.ukuu.org.uk</email>
</author>
<published>2008-04-30T07:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f34d7a5b7010b82fe97da95496b9971435530062'/>
<id>urn:sha1:f34d7a5b7010b82fe97da95496b9971435530062</id>
<content type='text'>
- Operations are now a shared const function block as with most other Linux
  objects

- Introduce wrappers for some optional functions to get consistent behaviour

- Wrap put_char which used to be patched by the tty layer

- Document which functions are needed/optional

- Make put_char report success/fail

- Cache the driver-&gt;ops pointer in the tty as tty-&gt;ops

- Remove various surplus lock calls we no longer need

- Remove proc_write method as noted by Alexey Dobriyan

- Introduce some missing sanity checks where certain driver/ldisc
  combinations would oops as they didn't check needed methods were present

[akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
[akpm@linux-foundation.org: fix isicom]
[akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
[akpm@linux-foundation.org: fix kgdb]
Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Cc: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: convert /proc/tty/ldiscs to seq_file interface</title>
<updated>2008-04-29T15:06:20Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2008-04-29T08:01:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b640a89ddd742782bd2d83873da30d4776d1b9c6'/>
<id>urn:sha1:b640a89ddd742782bd2d83873da30d4776d1b9c6</id>
<content type='text'>
Note: THIS_MODULE and header addition aren't technically needed because
      this code is not modular, but let's keep it anyway because people
      can copy this code into modular code.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: switch to proc_create()</title>
<updated>2008-04-29T15:06:17Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@sw.ru</email>
</author>
<published>2008-04-29T08:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0d5c9f5f59a61cf8e98e2925cb5d81cbe7694305'/>
<id>urn:sha1:0d5c9f5f59a61cf8e98e2925cb5d81cbe7694305</id>
<content type='text'>
Signed-off-by: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
