Fix: use liburcu flavor header instead of local copy
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 28 Oct 2015 19:55:58 +0000 (15:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Oct 2015 20:05:19 +0000 (16:05 -0400)
The layout of struct rcu_flavor_struct has changed in newer URCU
versions. There is no need to keep a local copy of this structure. Use
the library header instead.

This ensures that the caller of _cds_lfht_new(), which passes a flavor
pointer with the library layout defined by liburcu, has the same layout
expected internally within the local copy of rculfhash.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/hashtable/Makefile.am
src/common/hashtable/rculfhash.c
src/common/hashtable/rculfhash.h
src/common/hashtable/urcu-flavor.h [deleted file]

index 021f01c7915660d6b1888078a219942ccebc55cd..8d5a59a28185e1e928efb50f40b7765137dffc1b 100644 (file)
@@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libhashtable.la
 
 libhashtable_la_SOURCES = hashtable.c hashtable.h \
                          utils.c utils.h \
-                         rculfhash-internal.h urcu-flavor.h \
+                         rculfhash-internal.h \
                          rculfhash.h rculfhash.c \
                          rculfhash-mm-chunk.c \
                          rculfhash-mm-mmap.c \
index e11c6541f471a88f8cfaa67517f2271af621ccc5..aa9cae509010000bf58892501a21c91701164aa3 100644 (file)
 
 #include "rculfhash.h"
 #include "rculfhash-internal.h"
-#include "urcu-flavor.h"
+#include <urcu-flavor.h>
 
 #include <common/common.h>
 
index adb5d9d4fe41b82993ec0da288c9e186029ca2c9..4bfe789e279d5366c480d9a543416729a8f8220d 100644 (file)
@@ -31,8 +31,7 @@
 #include <stdint.h>
 #include <urcu/compiler.h>
 #include <urcu-call-rcu.h>
-
-#include "urcu-flavor.h"
+#include <urcu-flavor.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/common/hashtable/urcu-flavor.h b/src/common/hashtable/urcu-flavor.h
deleted file mode 100644 (file)
index 9af4d0e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef _URCU_FLAVOR_H
-#define _URCU_FLAVOR_H
-
-/*
- * urcu-flavor.h
- *
- * Userspace RCU header - rcu flavor declarations
- *
- * Copyright (c) 2011 Lai Jiangshan <laijs@cn.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct rcu_flavor_struct {
-       void (*read_lock)(void);
-       void (*read_unlock)(void);
-       void (*read_quiescent_state)(void);
-       void (*update_call_rcu)(struct rcu_head *head,
-                               void (*func)(struct rcu_head *head));
-       void (*update_synchronize_rcu)(void);
-       void (*update_defer_rcu)(void (*fct)(void *p), void *p);
-
-       void (*thread_offline)(void);
-       void (*thread_online)(void);
-       void (*register_thread)(void);
-       void (*unregister_thread)(void);
-};
-
-#define DEFINE_RCU_FLAVOR(x)                           \
-const struct rcu_flavor_struct x = {                   \
-       .read_lock              = rcu_read_lock,        \
-       .read_unlock            = rcu_read_unlock,      \
-       .read_quiescent_state   = rcu_quiescent_state,  \
-       .update_call_rcu        = call_rcu,             \
-       .update_synchronize_rcu = synchronize_rcu,      \
-       .update_defer_rcu       = defer_rcu,            \
-       .thread_offline         = rcu_thread_offline,   \
-       .thread_online          = rcu_thread_online,    \
-       .register_thread        = rcu_register_thread,  \
-       .unregister_thread      = rcu_unregister_thread,\
-}
-
-extern const struct rcu_flavor_struct rcu_flavor;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _URCU_FLAVOR_H */
This page took 0.027993 seconds and 4 git commands to generate.