tree/nocb: Improve readability of nocb_gp_wait()
The nocb_gp_wait() function contains logic to check each rdp's bypass
list, flush if needed, and decide on wakeups. This makes the function
hard to follow.
Split out the bypass checking and flushing into a separate helper
nocb_gp_flush_wake(). The new function encapsulates the logic to:
- Check if the bypass needs to be flushed
- Flush if needed
- Return info on wakeups (lazy, bypass or none)
nocb_gp_wait() now becomes simpler by calling the helper to handle
the bypass flushing and waking logic.
This splitting improves the readability and maintainability of the
code by encapsulating related logic into a function with a clear
purpose.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
1 file changed