aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index aca699813ba9..84a78e396a56 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -485,7 +485,7 @@ static void rht_deferred_worker(struct work_struct *work)
485 struct rhashtable *ht; 485 struct rhashtable *ht;
486 struct bucket_table *tbl; 486 struct bucket_table *tbl;
487 487
488 ht = container_of(work, struct rhashtable, run_work.work); 488 ht = container_of(work, struct rhashtable, run_work);
489 mutex_lock(&ht->mutex); 489 mutex_lock(&ht->mutex);
490 tbl = rht_dereference(ht->tbl, ht); 490 tbl = rht_dereference(ht->tbl, ht);
491 491
@@ -507,7 +507,7 @@ static void rhashtable_wakeup_worker(struct rhashtable *ht)
507 if (tbl == new_tbl && 507 if (tbl == new_tbl &&
508 ((ht->p.grow_decision && ht->p.grow_decision(ht, size)) || 508 ((ht->p.grow_decision && ht->p.grow_decision(ht, size)) ||
509 (ht->p.shrink_decision && ht->p.shrink_decision(ht, size)))) 509 (ht->p.shrink_decision && ht->p.shrink_decision(ht, size))))
510 schedule_delayed_work(&ht->run_work, 0); 510 schedule_work(&ht->run_work);
511} 511}
512 512
513static void __rhashtable_insert(struct rhashtable *ht, struct rhash_head *obj, 513static void __rhashtable_insert(struct rhashtable *ht, struct rhash_head *obj,
@@ -903,7 +903,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
903 get_random_bytes(&ht->p.hash_rnd, sizeof(ht->p.hash_rnd)); 903 get_random_bytes(&ht->p.hash_rnd, sizeof(ht->p.hash_rnd));
904 904
905 if (ht->p.grow_decision || ht->p.shrink_decision) 905 if (ht->p.grow_decision || ht->p.shrink_decision)
906 INIT_DEFERRABLE_WORK(&ht->run_work, rht_deferred_worker); 906 INIT_WORK(&ht->run_work, rht_deferred_worker);
907 907
908 return 0; 908 return 0;
909} 909}
@@ -921,11 +921,11 @@ void rhashtable_destroy(struct rhashtable *ht)
921{ 921{
922 ht->being_destroyed = true; 922 ht->being_destroyed = true;
923 923
924 mutex_lock(&ht->mutex); 924 if (ht->p.grow_decision || ht->p.shrink_decision)
925 cancel_work_sync(&ht->run_work);
925 926
926 cancel_delayed_work(&ht->run_work); 927 mutex_lock(&ht->mutex);
927 bucket_table_free(rht_dereference(ht->tbl, ht)); 928 bucket_table_free(rht_dereference(ht->tbl, ht));
928
929 mutex_unlock(&ht->mutex); 929 mutex_unlock(&ht->mutex);
930} 930}
931EXPORT_SYMBOL_GPL(rhashtable_destroy); 931EXPORT_SYMBOL_GPL(rhashtable_destroy);