diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 09:36:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 19:47:08 -0400 |
commit | 7391ee16950e772076d321792d9fbf030f921345 (patch) | |
tree | c0b17ff0622f801f05bb11228426bdc90e8ffdc2 /include/linux/tty.h | |
parent | 809850b7a5fcc0a96d023e1171a7944c60fd5a71 (diff) |
tty: Simplify flip buffer list with 0-sized sentinel
Use a 0-sized sentinel to avoid assigning the head ptr from
the driver side thread. This also eliminates testing head/tail
for NULL.
When the sentinel is first 'consumed' by the buffer work
(or by tty_buffer_flush()), it is detached from the list but not
freed nor added to the free list. Both buffer work and
tty_buffer_flush() continue to preserve at least 1 flip buffer
to which head & tail is pointed.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 5043b12f23ea..2e93eb831c61 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -67,6 +67,7 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs) | |||
67 | struct tty_bufhead { | 67 | struct tty_bufhead { |
68 | struct work_struct work; | 68 | struct work_struct work; |
69 | spinlock_t lock; | 69 | spinlock_t lock; |
70 | struct tty_buffer sentinel; | ||
70 | struct tty_buffer *head; /* Queue head */ | 71 | struct tty_buffer *head; /* Queue head */ |
71 | struct tty_buffer *tail; /* Active buffer */ | 72 | struct tty_buffer *tail; /* Active buffer */ |
72 | struct llist_head free; /* Free queue head */ | 73 | struct llist_head free; /* Free queue head */ |