linux_dsm_epyc7002/drivers/tty
Linus Torvalds 8ead9dd547 devpts: more pty driver interface cleanups
This is more prep-work for the upcoming pty changes.  Still just code
cleanup with no actual semantic changes.

This removes a bunch pointless complexity by just having the slave pty
side remember the dentry associated with the devpts slave rather than
the inode.  That allows us to remove all the "look up the dentry" code
for when we want to remove it again.

Together with moving the tty pointer from "inode->i_private" to
"dentry->d_fsdata" and getting rid of pointless inode locking, this
removes about 30 lines of code.  Not only is the end result smaller,
it's simpler and easier to understand.

The old code, for example, depended on the d_find_alias() to not just
find the dentry, but also to check that it is still hashed, which in
turn validated the tty pointer in the inode.

That is a _very_ roundabout way to say "invalidate the cached tty
pointer when the dentry is removed".

The new code just does

	dentry->d_fsdata = NULL;

in devpts_pty_kill() instead, invalidating the tty pointer rather more
directly and obviously.  Don't do something complex and subtle when the
obvious straightforward approach will do.

The rest of the patch (ie apart from code deletion and the above tty
pointer clearing) is just switching the calling convention to pass the
dentry or file pointer around instead of the inode.

Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: Jann Horn <jann@thejh.net>
Cc: Greg KH <greg@kroah.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Florian Weimer <fw@deneb.enyo.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-26 15:47:32 -07:00
..
hvc xen: features and fixes for 4.6-rc0 2016-03-22 12:55:17 -07:00
ipwireless Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2015-04-14 09:50:27 -07:00
serial Revert "serial: 8250: Add hardware dependency to RT288X option" 2016-04-19 15:17:37 +09:00
vt tty: vt: initialize softcursor_original correctly 2016-02-06 23:42:25 -08:00
amiserial.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
bfin_jtag_comm.c TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation 2015-03-07 03:44:14 +01:00
cyclades.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
ehv_bytechan.c drivers/tty: make ehv_bytechan.c explicitly non-modular 2016-02-06 23:26:43 -08:00
goldfish.c tty: goldfish: support platform_device with id -1 2016-03-07 16:11:14 -08:00
isicom.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
Kconfig tty: cyclades: cyz_interrupt is only used for PCI 2016-02-06 23:41:17 -08:00
Makefile TTY: Add MIPS EJTAG Fast Debug Channel TTY driver 2015-03-31 12:04:12 +02:00
metag_da.c tty/metag_da: Avoid module_init/module_exit in non-modular code 2015-06-16 14:12:31 -04:00
mips_ejtag_fdc.c ttyFDC: Fix build problems due to use of module_{init,exit} 2015-10-17 21:29:21 -07:00
moxa.c tty: Remove unused SERIAL_DO_RESTART define 2015-12-13 19:59:48 -08:00
moxa.h
mxser.c tty: constify tty_port_operations structs 2016-02-06 23:31:08 -08:00
mxser.h
n_gsm.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
n_hdlc.c TTY: n_hdlc, fix lockdep false positive 2016-02-06 23:27:46 -08:00
n_r3964.c tty: r3964: Replace/remove bogus tty lock use 2015-10-17 21:11:29 -07:00
n_tracerouter.c n_tracerouter: stop including <asm-generic/bug> 2015-10-15 00:21:10 +02:00
n_tracesink.c n_tracesink: stop including <asm-generic/bug> 2015-10-15 00:21:11 +02:00
n_tracesink.h
n_tty.c n_tty: Ignore all read data when closing 2016-01-28 14:13:44 -08:00
nozomi.c tty: nozomi: avoid a harmless gcc warning 2016-02-06 23:41:17 -08:00
pty.c devpts: more pty driver interface cleanups 2016-04-26 15:47:32 -07:00
rocket_int.h tty: rocket: Remove private close_wait 2016-01-28 14:13:44 -08:00
rocket.c tty: Remove ASYNC_CLOSING 2016-01-28 14:19:12 -08:00
rocket.h tty: rocket: fix comment of ROCKET_SPD_HI 2015-05-24 12:49:16 -07:00
synclink_gt.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
synclink.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
synclinkmp.c tty: synclinkmp: do not ignore errors in probe() 2016-02-06 23:27:46 -08:00
sysrq.c sysrq: Fix warning in sysrq generated crash. 2015-12-29 16:29:18 -08:00
tty_audit.c tty: audit: remove unused variable 2016-03-07 16:11:14 -08:00
tty_buffer.c tty: Unify receive_buf() code paths 2016-01-28 14:13:44 -08:00
tty_io.c devpts: more pty driver interface cleanups 2016-04-26 15:47:32 -07:00
tty_ioctl.c tty: Use termios c_*flag macros 2016-01-28 14:13:44 -08:00
tty_ldisc.c tty: Eliminate global symbol tty_ldisc_N_TTY 2016-01-27 15:13:28 -08:00
tty_ldsem.c tty: Deinline __ldsem_down_write_nested, save 128 bytes 2015-12-13 19:59:48 -08:00
tty_mutex.c Merge 4.5-rc4 into tty-next 2016-02-14 14:36:04 -08:00
tty_port.c tty: Remove ASYNC_CLOSING 2016-01-28 14:19:12 -08:00