diff options
| -rw-r--r-- | drivers/tty/tty_buffer.c | 7 | ||||
| -rw-r--r-- | include/linux/tty.h | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 39cae611fe59..fb042b9a8d68 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c | |||
| @@ -189,11 +189,11 @@ void tty_buffer_flush(struct tty_struct *tty) | |||
| 189 | struct tty_port *port = tty->port; | 189 | struct tty_port *port = tty->port; |
| 190 | struct tty_bufhead *buf = &port->buf; | 190 | struct tty_bufhead *buf = &port->buf; |
| 191 | 191 | ||
| 192 | set_bit(TTYP_FLUSHPENDING, &port->iflags); | 192 | buf->flushpending = 1; |
| 193 | 193 | ||
| 194 | mutex_lock(&buf->flush_mutex); | 194 | mutex_lock(&buf->flush_mutex); |
| 195 | __tty_buffer_flush(port); | 195 | __tty_buffer_flush(port); |
| 196 | clear_bit(TTYP_FLUSHPENDING, &port->iflags); | 196 | buf->flushpending = 0; |
| 197 | mutex_unlock(&buf->flush_mutex); | 197 | mutex_unlock(&buf->flush_mutex); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| @@ -426,7 +426,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
| 426 | int count; | 426 | int count; |
| 427 | 427 | ||
| 428 | /* Ldisc or user is trying to flush the buffers. */ | 428 | /* Ldisc or user is trying to flush the buffers. */ |
| 429 | if (test_bit(TTYP_FLUSHPENDING, &port->iflags)) | 429 | if (buf->flushpending) |
| 430 | break; | 430 | break; |
| 431 | 431 | ||
| 432 | count = head->commit - head->read; | 432 | count = head->commit - head->read; |
| @@ -505,6 +505,7 @@ void tty_buffer_init(struct tty_port *port) | |||
| 505 | buf->tail = &buf->sentinel; | 505 | buf->tail = &buf->sentinel; |
| 506 | init_llist_head(&buf->free); | 506 | init_llist_head(&buf->free); |
| 507 | atomic_set(&buf->memory_used, 0); | 507 | atomic_set(&buf->memory_used, 0); |
| 508 | buf->flushpending = 0; | ||
| 508 | INIT_WORK(&buf->work, flush_to_ldisc); | 509 | INIT_WORK(&buf->work, flush_to_ldisc); |
| 509 | } | 510 | } |
| 510 | 511 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index b8e8adf95bf3..991575fe3451 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -68,6 +68,7 @@ struct tty_bufhead { | |||
| 68 | struct tty_buffer *head; /* Queue head */ | 68 | struct tty_buffer *head; /* Queue head */ |
| 69 | struct work_struct work; | 69 | struct work_struct work; |
| 70 | struct mutex flush_mutex; | 70 | struct mutex flush_mutex; |
| 71 | unsigned int flushpending:1; | ||
| 71 | struct tty_buffer sentinel; | 72 | struct tty_buffer sentinel; |
| 72 | struct llist_head free; /* Free queue head */ | 73 | struct llist_head free; /* Free queue head */ |
| 73 | atomic_t memory_used; /* In-use buffers excluding free list */ | 74 | atomic_t memory_used; /* In-use buffers excluding free list */ |
| @@ -212,8 +213,6 @@ struct tty_port { | |||
| 212 | wait_queue_head_t close_wait; /* Close waiters */ | 213 | wait_queue_head_t close_wait; /* Close waiters */ |
| 213 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 214 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 214 | unsigned long flags; /* TTY flags ASY_*/ | 215 | unsigned long flags; /* TTY flags ASY_*/ |
| 215 | unsigned long iflags; /* TTYP_ internal flags */ | ||
| 216 | #define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */ | ||
| 217 | unsigned char console:1, /* port is a console */ | 216 | unsigned char console:1, /* port is a console */ |
| 218 | low_latency:1; /* direct buffer flush */ | 217 | low_latency:1; /* direct buffer flush */ |
| 219 | struct mutex mutex; /* Locking */ | 218 | struct mutex mutex; /* Locking */ |
