]> www.infradead.org Git - linux-platform-drivers-x86.git/commit
printk: introduce a kmsg_dump iterator
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 3 Mar 2021 10:15:25 +0000 (11:15 +0100)
committerPetr Mladek <pmladek@suse.com>
Mon, 8 Mar 2021 10:43:27 +0000 (11:43 +0100)
commitf9f3f02db98bbe678a8e57fe9432b196174744a3
treea788ed5cb2ff8ed46a25336400f2c23d6ba0a20c
parent5f6c7648e556f41a3064bb6dceb9e102c50b618d
printk: introduce a kmsg_dump iterator

Rather than storing the iterator information in the registered
kmsg_dumper structure, create a separate iterator structure. The
kmsg_dump_iter structure can reside on the stack of the caller, thus
allowing lockless use of the kmsg_dump functions.

Update code that accesses the kernel logs using the kmsg_dumper
structure to use the new kmsg_dump_iter structure. For kmsg_dumpers,
this also means adding a call to kmsg_dump_rewind() to initialize
the iterator.

All this is in preparation for removal of @logbuf_lock.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org> # pstore
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210303101528.29901-13-john.ogness@linutronix.de
arch/powerpc/kernel/nvram_64.c
arch/powerpc/xmon/xmon.c
arch/um/kernel/kmsg_dump.c
drivers/hv/vmbus_drv.c
drivers/mtd/mtdoops.c
fs/pstore/platform.c
include/linux/kmsg_dump.h
kernel/debug/kdb/kdb_main.c
kernel/printk/printk.c