]> Git Repo - linux.git/commitdiff
tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push()
authorJiri Slaby <[email protected]>
Thu, 7 Jul 2022 08:25:57 +0000 (10:25 +0200)
committerGreg Kroah-Hartman <[email protected]>
Fri, 8 Jul 2022 13:16:28 +0000 (15:16 +0200)
We will need this new helper in the next patch.

Cc: Hillf Danton <[email protected]>
Cc: 一只狗 <[email protected]>
Cc: Dan Carpenter <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/tty_buffer.c

index bfa431a8e6902a68148a0f56a0c4e6f7d9e8e088..303a26c1b82112e92741b6557fc1268011808123 100644 (file)
@@ -532,6 +532,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                -       push terminal buffers
  * @port: tty port to push
@@ -546,11 +555,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);
This page took 0.061434 seconds and 4 git commands to generate.