GhantaKrishnamurthy MohanKrishna dfde331e75 tipc: modify socket iterator for sock_diag
The current socket iterator function tipc_nl_sk_dump, handles socket
locks and calls __tipc_nl_add_sk for each socket.
To reuse this logic in sock_diag implementation, we do minor
modifications to make these functions generic as described below.

In this commit, we add a two new functions __tipc_nl_sk_walk,
__tipc_nl_add_sk_info and modify tipc_nl_sk_dump, __tipc_nl_add_sk
accordingly.

In __tipc_nl_sk_walk we:
1. acquire and release socket locks
2. for each socket, execute the specified callback function

In __tipc_nl_add_sk we:
- Move the netlink attribute insertion to __tipc_nl_add_sk_info.

tipc_nl_sk_dump calls tipc_nl_sk_walk with __tipc_nl_add_sk as argument.

sock_diag will use these generic functions in a later commit.

There is no functional change in this commit.
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-22 14:43:29 -04:00
..
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-02-14 14:46:32 -05:00
2018-03-13 11:24:56 -04:00
2015-03-05 22:08:42 -05:00
2016-07-26 14:26:42 -07:00
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-03-17 17:11:46 -04:00
2018-02-14 14:46:33 -05:00