aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-06-15 09:36:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 19:47:08 -0400
commit7bfe0b7116be207cf2204ae06335cc89d8f8ee02 (patch)
tree03175cd2ce9dd8013c4aaa8e2dd426767aa1a4c7 /include/linux
parent7391ee16950e772076d321792d9fbf030f921345 (diff)
tty: Track flip buffer memory limit atomically
Lockless flip buffers require atomically updating the bytes-in-use watermark. The pty driver also peeks at the watermark value to limit memory consumption to a much lower value than the default; query the watermark with new fn, tty_buffer_space_avail(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/tty_flip.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 2e93eb831c61..7c124541f011 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -71,8 +71,7 @@ struct tty_bufhead {
71 struct tty_buffer *head; /* Queue head */ 71 struct tty_buffer *head; /* Queue head */
72 struct tty_buffer *tail; /* Active buffer */ 72 struct tty_buffer *tail; /* Active buffer */
73 struct llist_head free; /* Free queue head */ 73 struct llist_head free; /* Free queue head */
74 int memory_used; /* Buffer space used excluding 74 atomic_t memory_used; /* In-use buffers excluding free list */
75 free queue */
76}; 75};
77/* 76/*
78 * When a break, frame error, or parity error happens, these codes are 77 * When a break, frame error, or parity error happens, these codes are
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index ad0303994c32..6944ed2ce692 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_space_avail(struct tty_port *port);
4extern int tty_buffer_request_room(struct tty_port *port, size_t size); 5extern int tty_buffer_request_room(struct tty_port *port, size_t size);
5extern int tty_insert_flip_string_flags(struct tty_port *port, 6extern int tty_insert_flip_string_flags(struct tty_port *port,
6 const unsigned char *chars, const char *flags, size_t size); 7 const unsigned char *chars, const char *flags, size_t size);