aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/guarded-list.h4
-rw-r--r--lib/lacp.c2
-rw-r--r--lib/list.h9
-rw-r--r--lib/netdev-dpdk.c6
-rw-r--r--lib/netdev-dummy.c2
-rw-r--r--lib/ovs-thread.c6
-rw-r--r--lib/process.c2
-rw-r--r--lib/rculist.h2
-rw-r--r--lib/rstp.c2
-rw-r--r--lib/rtbsd.c2
-rw-r--r--lib/stp.c2
-rw-r--r--lib/vlog.c2
-rw-r--r--lib/vlog.h2
13 files changed, 18 insertions, 25 deletions
diff --git a/lib/guarded-list.h b/lib/guarded-list.h
index c19f64ee9..3e46d513b 100644
--- a/lib/guarded-list.h
+++ b/lib/guarded-list.h
@@ -28,9 +28,9 @@ struct guarded_list {
size_t n;
};
-#define GUARDED_LIST_INITIALIZER(LIST) { \
+#define GUARDED_OVS_LIST_INITIALIZER(LIST) { \
.mutex = OVS_MUTEX_INITIALIZER, \
- .list = LIST_INITIALIZER(&((LIST)->list)), \
+ .list = OVS_LIST_INITIALIZER(&((LIST)->list)), \
.n = 0 }
void guarded_list_init(struct guarded_list *);
diff --git a/lib/lacp.c b/lib/lacp.c
index 46d5bfb17..cc1a58223 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -132,7 +132,7 @@ struct slave {
};
static struct ovs_mutex mutex;
-static struct ovs_list all_lacps__ = LIST_INITIALIZER(&all_lacps__);
+static struct ovs_list all_lacps__ = OVS_LIST_INITIALIZER(&all_lacps__);
static struct ovs_list *const all_lacps OVS_GUARDED_BY(mutex) = &all_lacps__;
static void lacp_update_attached(struct lacp *) OVS_REQUIRES(mutex);
diff --git a/lib/list.h b/lib/list.h
index f2aa3350f..15be0f82f 100644
--- a/lib/list.h
+++ b/lib/list.h
@@ -21,14 +21,7 @@
#include <stdbool.h>
#include <stddef.h>
#include "util.h"
-
-/* Doubly linked list head or element. */
-struct ovs_list {
- struct ovs_list *prev; /* Previous list element. */
- struct ovs_list *next; /* Next list element. */
-};
-
-#define LIST_INITIALIZER(LIST) { LIST, LIST }
+#include "openvswitch/list.h"
static inline void list_init(struct ovs_list *);
static inline void list_poison(struct ovs_list *);
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 53fdb8e32..4e2d28118 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -135,10 +135,10 @@ static struct ovs_mutex dpdk_mutex = OVS_MUTEX_INITIALIZER;
/* Contains all 'struct dpdk_dev's. */
static struct ovs_list dpdk_list OVS_GUARDED_BY(dpdk_mutex)
- = LIST_INITIALIZER(&dpdk_list);
+ = OVS_LIST_INITIALIZER(&dpdk_list);
static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mutex)
- = LIST_INITIALIZER(&dpdk_mp_list);
+ = OVS_LIST_INITIALIZER(&dpdk_mp_list);
/* This mutex must be used by non pmd threads when allocating or freeing
* mbufs through mempools. Since dpdk_queue_pkts() and dpdk_queue_flush() may
@@ -168,7 +168,7 @@ struct dpdk_tx_queue {
*/
static struct ovs_list dpdk_ring_list OVS_GUARDED_BY(dpdk_mutex)
- = LIST_INITIALIZER(&dpdk_ring_list);
+ = OVS_LIST_INITIALIZER(&dpdk_ring_list);
struct dpdk_ring {
/* For the client rings */
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index b794b107c..01ee928e9 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -88,7 +88,7 @@ static struct ovs_mutex dummy_list_mutex = OVS_MUTEX_INITIALIZER;
/* Contains all 'struct dummy_dev's. */
static struct ovs_list dummy_list OVS_GUARDED_BY(dummy_list_mutex)
- = LIST_INITIALIZER(&dummy_list);
+ = OVS_LIST_INITIALIZER(&dummy_list);
struct netdev_dummy {
struct netdev up;
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index 1f346b930..3dd0ed6eb 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -621,14 +621,14 @@ static struct ovs_mutex key_mutex = OVS_MUTEX_INITIALIZER;
* Together, 'inuse_keys' and 'free_keys' hold an ovsthread_key for every index
* from 0 to n_keys - 1, inclusive. */
static struct ovs_list inuse_keys OVS_GUARDED_BY(key_mutex)
- = LIST_INITIALIZER(&inuse_keys);
+ = OVS_LIST_INITIALIZER(&inuse_keys);
static struct ovs_list free_keys OVS_GUARDED_BY(key_mutex)
- = LIST_INITIALIZER(&free_keys);
+ = OVS_LIST_INITIALIZER(&free_keys);
static unsigned int n_keys OVS_GUARDED_BY(key_mutex);
/* All existing struct ovsthread_key_slots. */
static struct ovs_list slots_list OVS_GUARDED_BY(key_mutex)
- = LIST_INITIALIZER(&slots_list);
+ = OVS_LIST_INITIALIZER(&slots_list);
static void *
clear_slot(struct ovsthread_key_slots *slots, unsigned int index)
diff --git a/lib/process.c b/lib/process.c
index 93a99ab16..f6b665e81 100644
--- a/lib/process.c
+++ b/lib/process.c
@@ -54,7 +54,7 @@ struct process {
static int fds[2];
/* All processes. */
-static struct ovs_list all_processes = LIST_INITIALIZER(&all_processes);
+static struct ovs_list all_processes = OVS_LIST_INITIALIZER(&all_processes);
static void sigchld_handler(int signr OVS_UNUSED);
diff --git a/lib/rculist.h b/lib/rculist.h
index 3a5795613..f3c1475de 100644
--- a/lib/rculist.h
+++ b/lib/rculist.h
@@ -75,7 +75,7 @@ static inline const struct rculist *rculist_next(const struct rculist *);
static inline struct rculist *rculist_next_protected(const struct rculist *);
/* List initialization. */
-#define RCULIST_INITIALIZER(LIST) { LIST, OVSRCU_INITIALIZER(LIST) }
+#define RCUOVS_LIST_INITIALIZER(LIST) { LIST, OVSRCU_INITIALIZER(LIST) }
static inline void rculist_init(struct rculist *list);
static inline void rculist_poison(struct rculist *elem);
diff --git a/lib/rstp.c b/lib/rstp.c
index 022fc3cfb..8a7891a60 100644
--- a/lib/rstp.c
+++ b/lib/rstp.c
@@ -50,7 +50,7 @@ VLOG_DEFINE_THIS_MODULE(rstp);
struct ovs_mutex rstp_mutex = OVS_MUTEX_INITIALIZER;
-static struct ovs_list all_rstps__ = LIST_INITIALIZER(&all_rstps__);
+static struct ovs_list all_rstps__ = OVS_LIST_INITIALIZER(&all_rstps__);
static struct ovs_list *const all_rstps OVS_GUARDED_BY(rstp_mutex) = &all_rstps__;
/* Internal use only. */
diff --git a/lib/rtbsd.c b/lib/rtbsd.c
index 46a0632cc..d33f64bd6 100644
--- a/lib/rtbsd.c
+++ b/lib/rtbsd.c
@@ -38,7 +38,7 @@ static struct ovs_mutex rtbsd_mutex = OVS_MUTEX_INITIALIZER;
static int notify_sock = -1;
/* All registered notifiers. */
-static struct ovs_list all_notifiers = LIST_INITIALIZER(&all_notifiers);
+static struct ovs_list all_notifiers = OVS_LIST_INITIALIZER(&all_notifiers);
static void rtbsd_report_change(const struct if_msghdr *)
OVS_REQUIRES(rtbsd_mutex);
diff --git a/lib/stp.c b/lib/stp.c
index 5854afac0..9e02acc7b 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -150,7 +150,7 @@ struct stp {
};
static struct ovs_mutex mutex;
-static struct ovs_list all_stps__ = LIST_INITIALIZER(&all_stps__);
+static struct ovs_list all_stps__ = OVS_LIST_INITIALIZER(&all_stps__);
static struct ovs_list *const all_stps OVS_GUARDED_BY(mutex) = &all_stps__;
#define FOR_EACH_ENABLED_PORT(PORT, STP) \
diff --git a/lib/vlog.c b/lib/vlog.c
index 639dc9127..60ce3b420 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -75,7 +75,7 @@ VLOG_LEVELS
BUILD_ASSERT_DECL(LOG_LOCAL0 == (16 << 3));
/* The log modules. */
-struct ovs_list vlog_modules = LIST_INITIALIZER(&vlog_modules);
+struct ovs_list vlog_modules = OVS_LIST_INITIALIZER(&vlog_modules);
/* Protects the 'pattern' in all "struct facility"s, so that a race between
* changing and reading the pattern does not cause an access to freed
diff --git a/lib/vlog.h b/lib/vlog.h
index 41b0adcab..a8f7b0152 100644
--- a/lib/vlog.h
+++ b/lib/vlog.h
@@ -281,7 +281,7 @@ void vlog_usage(void);
extern struct vlog_module VLM_##MODULE; \
struct vlog_module VLM_##MODULE = \
{ \
- LIST_INITIALIZER(&VLM_##MODULE.list), \
+ OVS_LIST_INITIALIZER(&VLM_##MODULE.list), \
#MODULE, /* name */ \
{ VLL_INFO, VLL_INFO, VLL_INFO }, /* levels */ \
VLL_INFO, /* min_level */ \