Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30963
b: refs/heads/master
c: 2c3bb20
h: refs/heads/master
i:
  30961: 96c09b9
  30959: 91e71dc
v: v3
  • Loading branch information
Paul Fulghum authored and Linus Torvalds committed Jun 28, 2006
1 parent 9f750d4 commit 57d25be
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 817d6d3bceaf34c99f5343820f9b9e6021f0655c
refs/heads/master: 2c3bb20f46709a0adfa7ea408013edbcab945d5a
37 changes: 24 additions & 13 deletions trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2771,8 +2771,7 @@ static void flush_to_ldisc(void *private_)
struct tty_struct *tty = (struct tty_struct *) private_;
unsigned long flags;
struct tty_ldisc *disc;
struct tty_buffer *tbuf;
int count;
struct tty_buffer *tbuf, *head;
char *char_buf;
unsigned char *flag_buf;

Expand All @@ -2781,21 +2780,33 @@ static void flush_to_ldisc(void *private_)
return;

spin_lock_irqsave(&tty->buf.lock, flags);
while((tbuf = tty->buf.head) != NULL) {
while ((count = tbuf->commit - tbuf->read) != 0) {
char_buf = tbuf->char_buf_ptr + tbuf->read;
flag_buf = tbuf->flag_buf_ptr + tbuf->read;
tbuf->read += count;
head = tty->buf.head;
if (head != NULL) {
tty->buf.head = NULL;
for (;;) {
int count = head->commit - head->read;
if (!count) {
if (head->next == NULL)
break;
tbuf = head;
head = head->next;
tty_buffer_free(tty, tbuf);
continue;
}
if (!tty->receive_room) {
schedule_delayed_work(&tty->buf.work, 1);
break;
}
if (count > tty->receive_room)
count = tty->receive_room;
char_buf = head->char_buf_ptr + head->read;
flag_buf = head->flag_buf_ptr + head->read;
head->read += count;
spin_unlock_irqrestore(&tty->buf.lock, flags);
disc->receive_buf(tty, char_buf, flag_buf, count);
spin_lock_irqsave(&tty->buf.lock, flags);
}
if (tbuf->active)
break;
tty->buf.head = tbuf->next;
if (tty->buf.head == NULL)
tty->buf.tail = NULL;
tty_buffer_free(tty, tbuf);
tty->buf.head = head;
}
spin_unlock_irqrestore(&tty->buf.lock, flags);

Expand Down

0 comments on commit 57d25be

Please sign in to comment.