Merge tag 'mvebu-dt-5.8-1' of git://git.infradead.org/linux-mvebu into arm/dt
[linux-2.6-microblaze.git] / net / sunrpc / cache.c
index af0ddd2..baef5ee 100644 (file)
@@ -529,7 +529,6 @@ void cache_purge(struct cache_detail *detail)
 {
        struct cache_head *ch = NULL;
        struct hlist_head *head = NULL;
-       struct hlist_node *tmp = NULL;
        int i = 0;
 
        spin_lock(&detail->hash_lock);
@@ -541,7 +540,9 @@ void cache_purge(struct cache_detail *detail)
        dprintk("RPC: %d entries in %s cache\n", detail->entries, detail->name);
        for (i = 0; i < detail->hash_size; i++) {
                head = &detail->hash_table[i];
-               hlist_for_each_entry_safe(ch, tmp, head, cache_list) {
+               while (!hlist_empty(head)) {
+                       ch = hlist_entry(head->first, struct cache_head,
+                                        cache_list);
                        sunrpc_begin_cache_remove_entry(ch, detail);
                        spin_unlock(&detail->hash_lock);
                        sunrpc_end_cache_remove_entry(ch, detail);