diff options
author | Kuniyuki Iwashima <[email protected]> | 2022-01-13 09:28:45 +0900 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-01-18 15:45:06 -0800 |
commit | 4408d55a64677febdcb50d1b44d0dc714ce4187e (patch) | |
tree | d4b3ce744d08900ceb2af860f8f7c962ed86486c /lib/mpi/mpi-mod.c | |
parent | 2a1aff6035187d877d7b6f28f81b0a084c00e17a (diff) |
af_unix: Refactor unix_next_socket().
Currently, unix_next_socket() is overloaded depending on the 2nd argument.
If it is NULL, unix_next_socket() returns the first socket in the hash. If
not NULL, it returns the next socket in the same hash list or the first
socket in the next non-empty hash list.
This patch refactors unix_next_socket() into two functions unix_get_first()
and unix_get_next(). unix_get_first() newly acquires a lock and returns
the first socket in the list. unix_get_next() returns the next socket in a
list or releases a lock and falls back to unix_get_first().
In the following patch, bpf iter holds entire sockets in a list and always
releases the lock before .show(). It always calls unix_get_first() to
acquire a lock in each iteration. So, this patch makes the change easier
to follow.
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions