binder: Refactor binder_node print synchronization
authorTiffany Y. Yang <ynaffit@google.com>
Sat, 10 May 2025 01:34:38 +0000 (01:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 12:39:16 +0000 (14:39 +0200)
commit91f1bbaa783d26b379d65ef7b4b2b947c338c749
tree0b36f5550125ce52b73e77070cf003de227cb3fb
parent8c0a559825281764061a127632e5ad273f0466ad
binder: Refactor binder_node print synchronization

The binder driver outputs information about each dead binder node by
iterating over the dead nodes list, and it prints the state of each live
node in the system by traversing each binder_proc's proc->nodes tree.
Both cases require similar logic to maintain the global lock ordering
while accessing each node.

Create a helper function to synchronize around printing binder nodes in
a list. Opportunistically make minor cosmetic changes to binder print
functions.

Acked-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: "Tiffany Y. Yang" <ynaffit@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250510013435.1520671-5-ynaffit@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c