aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rhashtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rhashtable.h')
-rw-r--r--include/linux/rhashtable.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index 843ceca9a21e..e50b31d18462 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -19,6 +19,7 @@
19 19
20#include <linux/atomic.h> 20#include <linux/atomic.h>
21#include <linux/compiler.h> 21#include <linux/compiler.h>
22#include <linux/err.h>
22#include <linux/errno.h> 23#include <linux/errno.h>
23#include <linux/jhash.h> 24#include <linux/jhash.h>
24#include <linux/list_nulls.h> 25#include <linux/list_nulls.h>
@@ -339,10 +340,11 @@ static inline int lockdep_rht_bucket_is_held(const struct bucket_table *tbl,
339int rhashtable_init(struct rhashtable *ht, 340int rhashtable_init(struct rhashtable *ht,
340 const struct rhashtable_params *params); 341 const struct rhashtable_params *params);
341 342
342int rhashtable_insert_slow(struct rhashtable *ht, const void *key, 343struct bucket_table *rhashtable_insert_slow(struct rhashtable *ht,
343 struct rhash_head *obj, 344 const void *key,
344 struct bucket_table *old_tbl); 345 struct rhash_head *obj,
345int rhashtable_insert_rehash(struct rhashtable *ht); 346 struct bucket_table *old_tbl);
347int rhashtable_insert_rehash(struct rhashtable *ht, struct bucket_table *tbl);
346 348
347int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter); 349int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter);
348void rhashtable_walk_exit(struct rhashtable_iter *iter); 350void rhashtable_walk_exit(struct rhashtable_iter *iter);
@@ -598,9 +600,11 @@ restart:
598 600
599 new_tbl = rht_dereference_rcu(tbl->future_tbl, ht); 601 new_tbl = rht_dereference_rcu(tbl->future_tbl, ht);
600 if (unlikely(new_tbl)) { 602 if (unlikely(new_tbl)) {
601 err = rhashtable_insert_slow(ht, key, obj, new_tbl); 603 tbl = rhashtable_insert_slow(ht, key, obj, new_tbl);
602 if (err == -EAGAIN) 604 if (!IS_ERR_OR_NULL(tbl))
603 goto slow_path; 605 goto slow_path;
606
607 err = PTR_ERR(tbl);
604 goto out; 608 goto out;
605 } 609 }
606 610
@@ -611,7 +615,7 @@ restart:
611 if (unlikely(rht_grow_above_100(ht, tbl))) { 615 if (unlikely(rht_grow_above_100(ht, tbl))) {
612slow_path: 616slow_path:
613 spin_unlock_bh(lock); 617 spin_unlock_bh(lock);
614 err = rhashtable_insert_rehash(ht); 618 err = rhashtable_insert_rehash(ht, tbl);
615 rcu_read_unlock(); 619 rcu_read_unlock();
616 if (err) 620 if (err)
617 return err; 621 return err;