]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/frrcu.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / lib / frrcu.c
index d65a4a98bf631e4c5e3449aeeb748e8a5fde9ecc..c7cc655e09ceb9339cc5493e973234d2985de209 100644 (file)
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2017-19  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 /* implementation notes:  this is an epoch-based RCU implementation.  rcu_seq
 #include "seqlock.h"
 #include "atomlist.h"
 
-DEFINE_MTYPE_STATIC(LIB, RCU_THREAD,    "RCU thread")
-DEFINE_MTYPE_STATIC(LIB, RCU_NEXT,      "RCU sequence barrier")
+DEFINE_MTYPE_STATIC(LIB, RCU_THREAD,    "RCU thread");
+DEFINE_MTYPE_STATIC(LIB, RCU_NEXT,      "RCU sequence barrier");
 
-DECLARE_ATOMLIST(rcu_heads, struct rcu_head, head)
+DECLARE_ATOMLIST(rcu_heads, struct rcu_head, head);
 
-PREDECL_ATOMLIST(rcu_threads)
+PREDECL_ATOMLIST(rcu_threads);
 struct rcu_thread {
        struct rcu_threads_item head;
 
@@ -70,7 +59,7 @@ struct rcu_thread {
        /* only accessed by thread itself, not atomic */
        unsigned depth;
 };
-DECLARE_ATOMLIST(rcu_threads, struct rcu_thread, head)
+DECLARE_ATOMLIST(rcu_threads, struct rcu_thread, head);
 
 static const struct rcu_action rcua_next  = { .type = RCUA_NEXT };
 static const struct rcu_action rcua_end   = { .type = RCUA_END };
@@ -206,7 +195,7 @@ void rcu_thread_unprepare(struct rcu_thread *rt)
        rcu_bump();
        if (rt != &rcu_thread_main)
                /* this free() happens after seqlock_release() below */
-               rcu_free_internal(&_mt_RCU_THREAD, rt, rcu_head);
+               rcu_free_internal(MTYPE_RCU_THREAD, rt, rcu_head);
 
        rcu_threads_del(&rcu_threads, rt);
        seqlock_release(&rt->rcu);
@@ -269,7 +258,7 @@ static void rcu_bump(void)
         * "last item is being deleted - start over" case, and then we may end
         * up accessing old RCU queue items that are already free'd.
         */
-       rcu_free_internal(&_mt_RCU_NEXT, rn, head_free);
+       rcu_free_internal(MTYPE_RCU_NEXT, rn, head_free);
 
        /* Only allow the RCU sweeper to run after these 2 items are queued.
         *