struct tty_port *port = tty->port;
struct tty_bufhead *buf = &port->buf;
- set_bit(TTYP_FLUSHPENDING, &port->iflags);
+ buf->flushpending = 1;
mutex_lock(&buf->flush_mutex);
__tty_buffer_flush(port);
- clear_bit(TTYP_FLUSHPENDING, &port->iflags);
+ buf->flushpending = 0;
mutex_unlock(&buf->flush_mutex);
}
int count;
/* Ldisc or user is trying to flush the buffers. */
- if (test_bit(TTYP_FLUSHPENDING, &port->iflags))
+ if (buf->flushpending)
break;
count = head->commit - head->read;
buf->tail = &buf->sentinel;
init_llist_head(&buf->free);
atomic_set(&buf->memory_used, 0);
+ buf->flushpending = 0;
INIT_WORK(&buf->work, flush_to_ldisc);
}
struct tty_buffer *head; /* Queue head */
struct work_struct work;
struct mutex flush_mutex;
+ unsigned int flushpending:1;
struct tty_buffer sentinel;
struct llist_head free; /* Free queue head */
atomic_t memory_used; /* In-use buffers excluding free list */
wait_queue_head_t close_wait; /* Close waiters */
wait_queue_head_t delta_msr_wait; /* Modem status change */
unsigned long flags; /* TTY flags ASY_*/
- unsigned long iflags; /* TTYP_ internal flags */
-#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */
unsigned char console:1, /* port is a console */
low_latency:1; /* direct buffer flush */
struct mutex mutex; /* Locking */