mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 03:06:43 +00:00
tty: move some tty-only functions to drivers/tty/tty.h
[ Upstream commit 9f72cab1596327e1011ab4599c07b165e0fb45db ] The flow change and restricted_tty_write() logic is internal to the tty core only, so move it out of the include/linux/tty.h file. Cc: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20210408125134.3016837-12-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Stable-dep-of: 094fb49a2d0d ("tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1924d47a28
commit
57b510c7d3
@ -41,6 +41,21 @@ enum {
|
|||||||
TTY_LOCK_SLAVE,
|
TTY_LOCK_SLAVE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Values for tty->flow_change */
|
||||||
|
#define TTY_THROTTLE_SAFE 1
|
||||||
|
#define TTY_UNTHROTTLE_SAFE 2
|
||||||
|
|
||||||
|
static inline void __tty_set_flow_change(struct tty_struct *tty, int val)
|
||||||
|
{
|
||||||
|
tty->flow_change = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void tty_set_flow_change(struct tty_struct *tty, int val)
|
||||||
|
{
|
||||||
|
tty->flow_change = val;
|
||||||
|
smp_mb();
|
||||||
|
}
|
||||||
|
|
||||||
int tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout);
|
int tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout);
|
||||||
void tty_ldisc_unlock(struct tty_struct *tty);
|
void tty_ldisc_unlock(struct tty_struct *tty);
|
||||||
|
|
||||||
@ -58,4 +73,6 @@ static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ssize_t redirected_tty_write(struct kiocb *, struct iov_iter *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/compat.h>
|
#include <linux/compat.h>
|
||||||
|
#include "tty.h"
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
@ -350,21 +350,6 @@ struct tty_file_private {
|
|||||||
#define TTY_LDISC_CHANGING 20 /* Change pending - non-block IO */
|
#define TTY_LDISC_CHANGING 20 /* Change pending - non-block IO */
|
||||||
#define TTY_LDISC_HALTED 22 /* Line discipline is halted */
|
#define TTY_LDISC_HALTED 22 /* Line discipline is halted */
|
||||||
|
|
||||||
/* Values for tty->flow_change */
|
|
||||||
#define TTY_THROTTLE_SAFE 1
|
|
||||||
#define TTY_UNTHROTTLE_SAFE 2
|
|
||||||
|
|
||||||
static inline void __tty_set_flow_change(struct tty_struct *tty, int val)
|
|
||||||
{
|
|
||||||
tty->flow_change = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void tty_set_flow_change(struct tty_struct *tty, int val)
|
|
||||||
{
|
|
||||||
tty->flow_change = val;
|
|
||||||
smp_mb();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool tty_io_nonblock(struct tty_struct *tty, struct file *file)
|
static inline bool tty_io_nonblock(struct tty_struct *tty, struct file *file)
|
||||||
{
|
{
|
||||||
return file->f_flags & O_NONBLOCK ||
|
return file->f_flags & O_NONBLOCK ||
|
||||||
@ -395,7 +380,6 @@ extern const char *tty_name(const struct tty_struct *tty);
|
|||||||
extern struct tty_struct *tty_kopen(dev_t device);
|
extern struct tty_struct *tty_kopen(dev_t device);
|
||||||
extern void tty_kclose(struct tty_struct *tty);
|
extern void tty_kclose(struct tty_struct *tty);
|
||||||
extern int tty_dev_name_to_number(const char *name, dev_t *number);
|
extern int tty_dev_name_to_number(const char *name, dev_t *number);
|
||||||
extern ssize_t redirected_tty_write(struct kiocb *, struct iov_iter *);
|
|
||||||
#else
|
#else
|
||||||
static inline void tty_kref_put(struct tty_struct *tty)
|
static inline void tty_kref_put(struct tty_struct *tty)
|
||||||
{ }
|
{ }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user