diff options
author | David S. Miller <davem@davemloft.net> | 2017-12-11 09:58:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-11 09:58:39 -0500 |
commit | 9944a0f2f502e4501fccb1dc0a64a6012c83dd97 (patch) | |
tree | 98769c3324dd57bc2070c08852c9bf1f272ba2b8 /net/tipc/socket.c | |
parent | a0b586fa75a69578ecf10b40582eed9b35de2432 (diff) | |
parent | 64e0cd0d3540dbbdf6661943025409e6b31d5178 (diff) |
Merge branch 'rhashtable-New-features-in-walk-and-bucket'
Tom Herbert says:
====================
rhashtable: New features in walk and bucket
This patch contains some changes to related rhashtable:
- Above allow rhashtable_walk_start to return void
- Add a functon to peek at the next entry during a walk
- Abstract out function to compute a has for a table
- A library function to alloc a spinlocks bucket array
- Call the above function for rhashtable locks allocation
Tested: Exercised using various operations on an ILA xlat
table.
v2:
- Apply feedback from Herbert. Don't change semantics of resize
event reporting and -EAGAIN, just simplify API for callers that
ignore those.
- Add end_of_table in iter to reliably tell when the iterator has
reached to the eno.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 5d18c0caa92b..22c4fd8a9dfe 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -2640,9 +2640,7 @@ void tipc_sk_reinit(struct net *net) | |||
2640 | rhashtable_walk_enter(&tn->sk_rht, &iter); | 2640 | rhashtable_walk_enter(&tn->sk_rht, &iter); |
2641 | 2641 | ||
2642 | do { | 2642 | do { |
2643 | tsk = ERR_PTR(rhashtable_walk_start(&iter)); | 2643 | rhashtable_walk_start(&iter); |
2644 | if (IS_ERR(tsk)) | ||
2645 | goto walk_stop; | ||
2646 | 2644 | ||
2647 | while ((tsk = rhashtable_walk_next(&iter)) && !IS_ERR(tsk)) { | 2645 | while ((tsk = rhashtable_walk_next(&iter)) && !IS_ERR(tsk)) { |
2648 | spin_lock_bh(&tsk->sk.sk_lock.slock); | 2646 | spin_lock_bh(&tsk->sk.sk_lock.slock); |
@@ -2651,7 +2649,7 @@ void tipc_sk_reinit(struct net *net) | |||
2651 | msg_set_orignode(msg, tn->own_addr); | 2649 | msg_set_orignode(msg, tn->own_addr); |
2652 | spin_unlock_bh(&tsk->sk.sk_lock.slock); | 2650 | spin_unlock_bh(&tsk->sk.sk_lock.slock); |
2653 | } | 2651 | } |
2654 | walk_stop: | 2652 | |
2655 | rhashtable_walk_stop(&iter); | 2653 | rhashtable_walk_stop(&iter); |
2656 | } while (tsk == ERR_PTR(-EAGAIN)); | 2654 | } while (tsk == ERR_PTR(-EAGAIN)); |
2657 | } | 2655 | } |