kmsg_dump_rewind() and kmsg_dump_get_line() are lockless, so there is no need for _nolock() variants. Remove these functions and switch all callers of the _nolock() variants. The functions without _nolock() were chosen because they are already exported to kernel modules.
Showing the changes to kernel/debug (1 of 4 files). Show all
Unified · Split
| @@ -2126,8 +2126,8 @@ static int kdb_dmesg(int argc, const char **argv) · 2125 unmodified lines | |||
| 2126 | kdb_set(2, setargs); | 2126 | kdb_set(2, setargs); |
| 2127 | } | 2127 | } |
| 2128 | 2128 | ||
| 2129 | kmsg_dump_rewind_nolock(&iter); | 2129 | kmsg_dump_rewind(&iter); |
| 2130 | while (kmsg_dump_get_line_nolock(&iter, 1, NULL, 0, NULL)) | 2130 | while (kmsg_dump_get_line(&iter, 1, NULL, 0, NULL)) |
| 2131 | n++; | 2131 | n++; |
| 2132 | 2132 | ||
| 2133 | if (lines < 0) { | 2133 | if (lines < 0) { |
| @@ -2159,8 +2159,8 @@ static int kdb_dmesg(int argc, const char **argv) · 25 unmodified lines | |||
| 2159 | if (skip >= n || skip < 0) | 2159 | if (skip >= n || skip < 0) |
| 2160 | return 0; | 2160 | return 0; |
| 2161 | 2161 | ||
| 2162 | kmsg_dump_rewind_nolock(&iter); | 2162 | kmsg_dump_rewind(&iter); |
| 2163 | while (kmsg_dump_get_line_nolock(&iter, 1, buf, sizeof(buf), &len)) { | 2163 | while (kmsg_dump_get_line(&iter, 1, buf, sizeof(buf), &len)) { |
| 2164 | if (skip) { | 2164 | if (skip) { |
| 2165 | skip--; | 2165 | skip--; |
| 2166 | continue; | 2166 | continue; |