From 078e0c5cf0cbc11a3e10f6448fab95e1c484bbc7 Mon Sep 17 00:00:00 2001 From: John Ogness Date: Fri, 10 Mar 2023 13:36:01 +0000 Subject: [PATCH] proc: consoles: Add support for non-BKL consoles Show 'W' if a non-BKL console implements write_thread() or write_atomic(). Add a new flag 'N' to show if it is a non-BKL console. Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- fs/proc/consoles.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c index e0758fe7936d..ab9f42d478c8 100644 --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c @@ -21,12 +21,14 @@ static int show_console_dev(struct seq_file *m, void *v) { CON_ENABLED, 'E' }, { CON_CONSDEV, 'C' }, { CON_BOOT, 'B' }, + { CON_NO_BKL, 'N' }, { CON_PRINTBUFFER, 'p' }, { CON_BRL, 'b' }, { CON_ANYTIME, 'a' }, }; char flags[ARRAY_SIZE(con_flags) + 1]; struct console *con = v; + char con_write = '-'; unsigned int a; dev_t dev = 0; @@ -57,9 +59,15 @@ static int show_console_dev(struct seq_file *m, void *v) seq_setwidth(m, 21 - 1); seq_printf(m, "%s%d", con->name, con->index); seq_pad(m, ' '); - seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', - con->write ? 'W' : '-', con->unblank ? 'U' : '-', - flags); + if (con->flags & CON_NO_BKL) { + if (con->write_thread || con->write_atomic) + con_write = 'W'; + } else { + if (con->write) + con_write = 'W'; + } + seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', con_write, + con->unblank ? 'U' : '-', flags); if (dev) seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev));