# Re: \[PATCH next v4 12/15\] printk: introduce a kmsg\_dump iterator

- From: Petr Mladek \<pmladek@suse.com\>
- Date: 2021-03-03 18:11:04 
- List: linux-hyperv
- Page: https://ratatoskr.run/linux-hyperv/2021/03/6286841
- Thread: https://ratatoskr.run/linuxppc-dev/2021/03/6286496/t.md

```text
On Wed 2021-03-03 11:15:25, John Ogness wrote:
> 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 <redacted> # pstore

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
```
