diff options
author | John Ogness <[email protected]> | 2023-01-09 11:13:59 +0106 |
---|---|---|
committer | Petr Mladek <[email protected]> | 2023-01-11 15:35:12 +0100 |
commit | ea308da1198f8ca9de6e4ff7f22120e27d4e6338 (patch) | |
tree | 0968f1f55c9ba80b3109983e6d248073223d2c92 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | c4fcc617e148791fc45fd33b124301cb596bcbf6 (diff) |
printk: use printk_buffers for devkmsg
Replace the buffers in struct devkmsg_user with a struct
printk_buffers. This reduces the number of buffers to keep track of.
As a side-effect, @text_buf was 8kB large, even though it only
needed to be the max size of a ringbuffer record. By switching to
struct printk_buffers, ~7kB less memory is allocated when opening
/dev/kmsg.
And since struct printk_buffers will be used now, reduce duplicate
code by calling printk_get_next_message() to handle the record
reading and formatting.
Note that since /dev/kmsg never suppresses records based on
loglevel, printk_get_next_message() is extended with an extra
bool argument to specify if suppression is allowed.
Signed-off-by: John Ogness <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Signed-off-by: Petr Mladek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions