blob: 128f0153430f0c24d534beece46ae5e3fb0151b4 [file] [log] [blame]
From 86369315e1e2d591cf4b2d3cf3600ff5cf8ce2b2 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 23 Dec 2015 23:36:43 +0100
Subject: [PATCH 123/366] rbtree: don't include the rcu header
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The RCU header pulls in spinlock.h and fails due not yet defined types:
|In file included from include/linux/spinlock.h:275:0,
| from include/linux/rcupdate.h:38,
| from include/linux/rbtree.h:34,
| from include/linux/rtmutex.h:17,
| from include/linux/spinlock_types.h:18,
| from kernel/bounds.c:13:
|include/linux/rwlock_rt.h:16:38: error: unknown type name ‘rwlock_t’
| extern void __lockfunc rt_write_lock(rwlock_t *rwlock);
| ^
This patch moves the only RCU user from the header file into c file so the
inclusion can be avoided.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/rbtree.h | 11 ++---------
lib/rbtree.c | 11 +++++++++++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index a5aa7ae..24ddffd 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -31,7 +31,6 @@
#include <linux/kernel.h>
#include <linux/stddef.h>
-#include <linux/rcupdate.h>
struct rb_node {
unsigned long __rb_parent_color;
@@ -86,14 +85,8 @@ static inline void rb_link_node(struct rb_node *node, struct rb_node *parent,
*rb_link = node;
}
-static inline void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
- struct rb_node **rb_link)
-{
- node->__rb_parent_color = (unsigned long)parent;
- node->rb_left = node->rb_right = NULL;
-
- rcu_assign_pointer(*rb_link, node);
-}
+void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
+ struct rb_node **rb_link);
#define rb_entry_safe(ptr, type, member) \
({ typeof(ptr) ____ptr = (ptr); \
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 1356454..d15d6c4 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -23,6 +23,7 @@
#include <linux/rbtree_augmented.h>
#include <linux/export.h>
+#include <linux/rcupdate.h>
/*
* red-black trees properties: http://en.wikipedia.org/wiki/Rbtree
@@ -590,3 +591,13 @@ struct rb_node *rb_first_postorder(const struct rb_root *root)
return rb_left_deepest_node(root->rb_node);
}
EXPORT_SYMBOL(rb_first_postorder);
+
+void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent,
+ struct rb_node **rb_link)
+{
+ node->__rb_parent_color = (unsigned long)parent;
+ node->rb_left = node->rb_right = NULL;
+
+ rcu_assign_pointer(*rb_link, node);
+}
+EXPORT_SYMBOL(rb_link_node_rcu);
--
1.9.1