/* This routine returns the numbers of characters the tty driver will accept for queuing to be written. This number is subject to change as output buffers get emptied, or if the output flow control is acted.  */
static int sclp_vt220_write_room(struct tty_struct *tty)
/* This routine returns the numbers of characters the tty driver will accept for queuing to be written. This number is subject to change as output buffers get emptied, or if the output flow control is acted.  */
static int sclp_vt220_write_room(struct tty_struct *tty)
{
	unsigned long flags;
	struct list_head *l;
	int count;
	spin_lock_irqsave(&sclp_vt220_lock, flags);
	count = 0;
	if (sclp_vt220_current_request != NULL)
		count = sclp_vt220_space_left(sclp_vt220_current_request);
	list_for_each(l, &sclp_vt220_empty)
		count += SCLP_VT220_MAX_CHARS_PER_BUFFER;
	spin_unlock_irqrestore(&sclp_vt220_lock, flags);
	return count;
}