bpf, lpm: Make locking RT friendly
[linux-2.6-microblaze.git] / kernel / bpf / lpm_trie.c
index 56e6c75..3b3c420 100644 (file)
@@ -34,7 +34,7 @@ struct lpm_trie {
        size_t                          n_entries;
        size_t                          max_prefixlen;
        size_t                          data_size;
-       raw_spinlock_t                  lock;
+       spinlock_t                      lock;
 };
 
 /* This trie implements a longest prefix match algorithm that can be used to
@@ -315,7 +315,7 @@ static int trie_update_elem(struct bpf_map *map,
        if (key->prefixlen > trie->max_prefixlen)
                return -EINVAL;
 
-       raw_spin_lock_irqsave(&trie->lock, irq_flags);
+       spin_lock_irqsave(&trie->lock, irq_flags);
 
        /* Allocate and fill a new node */
 
@@ -422,7 +422,7 @@ out:
                kfree(im_node);
        }
 
-       raw_spin_unlock_irqrestore(&trie->lock, irq_flags);
+       spin_unlock_irqrestore(&trie->lock, irq_flags);
 
        return ret;
 }
@@ -442,7 +442,7 @@ static int trie_delete_elem(struct bpf_map *map, void *_key)
        if (key->prefixlen > trie->max_prefixlen)
                return -EINVAL;
 
-       raw_spin_lock_irqsave(&trie->lock, irq_flags);
+       spin_lock_irqsave(&trie->lock, irq_flags);
 
        /* Walk the tree looking for an exact key/length match and keeping
         * track of the path we traverse.  We will need to know the node
@@ -518,7 +518,7 @@ static int trie_delete_elem(struct bpf_map *map, void *_key)
        kfree_rcu(node, rcu);
 
 out:
-       raw_spin_unlock_irqrestore(&trie->lock, irq_flags);
+       spin_unlock_irqrestore(&trie->lock, irq_flags);
 
        return ret;
 }
@@ -575,7 +575,7 @@ static struct bpf_map *trie_alloc(union bpf_attr *attr)
        if (ret)
                goto out_err;
 
-       raw_spin_lock_init(&trie->lock);
+       spin_lock_init(&trie->lock);
 
        return &trie->map;
 out_err: