ring-buffer: Reuse rb_watermark_hit() for the poll logic
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Mar 2024 13:19:21 +0000 (09:19 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Mar 2024 16:44:07 +0000 (12:44 -0400)
commite36f19a6457b2c0dfa4a7d19153ef0fda4bf5634
treee85c299a5f028b12a809d52f53a534cc6c753c6d
parent8145f1c35fa648da662078efab299c4467b85ad5
ring-buffer: Reuse rb_watermark_hit() for the poll logic

The check for knowing if the poll should wait or not is basically the
exact same logic as rb_watermark_hit(). The only difference is that
rb_watermark_hit() also handles the !full case. But for the full case, the
logic is the same. Just call that instead of duplicating the code in
ring_buffer_poll_wait().

Link: https://lore.kernel.org/linux-trace-kernel/20240312131952.802267543@goodmis.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c