diff options
| author | Jiri Slaby <jslaby@suse.cz> | 2022-07-07 10:25:57 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 17:25:32 +0200 |
| commit | 816c301b6a739ae0a78b566248acc0bc81fe05c7 (patch) | |
| tree | 0d6783afa82058b600eafa01bc05cf250d6d1da1 | |
| parent | 35545303454a0a711db2f61eae693647e3a87b4b (diff) | |
| download | linux-816c301b6a739ae0a78b566248acc0bc81fe05c7.tar.gz linux-816c301b6a739ae0a78b566248acc0bc81fe05c7.tar.bz2 linux-816c301b6a739ae0a78b566248acc0bc81fe05c7.zip | |
tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push()
commit 716b10580283fda66f2b88140e3964f8a7f9da89 upstream.
We will need this new helper in the next patch.
Cc: Hillf Danton <hdanton@sina.com>
Cc: 一只狗 <chennbnbnb@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220707082558.9250-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/tty/tty_buffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index d63c1f6c7ef4..76fb600c1f79 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -533,6 +533,15 @@ static void flush_to_ldisc(struct work_struct *work) } +static inline void tty_flip_buffer_commit(struct tty_buffer *tail) +{ + /* + * Paired w/ acquire in flush_to_ldisc(); ensures flush_to_ldisc() sees + * buffer data. + */ + smp_store_release(&tail->commit, tail->used); +} + /** * tty_flip_buffer_push - terminal * @port: tty port to push @@ -548,11 +557,7 @@ void tty_flip_buffer_push(struct tty_port *port) { struct tty_bufhead *buf = &port->buf; - /* - * Paired w/ acquire in flush_to_ldisc(); ensures flush_to_ldisc() sees - * buffer data. - */ - smp_store_release(&buf->tail->commit, buf->tail->used); + tty_flip_buffer_commit(buf->tail); queue_work(system_unbound_wq, &buf->work); } EXPORT_SYMBOL(tty_flip_buffer_push); |
