Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163806456
D20719.id58865.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20719.id58865.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/rculist.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/rculist.h
+++ sys/compat/linuxkpi/common/include/linux/rculist.h
@@ -33,6 +33,25 @@
#include <linux/list.h>
#include <linux/rcupdate.h>
+#define list_entry_rcu(ptr, type, member) \
+ container_of(READ_ONCE(ptr), type, member)
+
+#define list_next_rcu(head) (*((struct list_head **)(&(head)->next)))
+
+#define list_for_each_entry_rcu(pos, head, member) \
+ for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \
+ &pos->member != (head); \
+ pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
+
+static inline void
+list_add_rcu(struct list_head *new, struct list_head *prev)
+{
+ new->next = prev->next;
+ new->prev = prev;
+ rcu_assign_pointer(list_next_rcu(prev), new);
+ prev->prev = new;
+}
+
#define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first)))
#define hlist_next_rcu(node) (*((struct hlist_node **)(&(node)->next)))
#define hlist_pprev_rcu(node) (*((struct hlist_node **)((node)->pprev)))
@@ -47,8 +66,12 @@
n->next->pprev = &n->next;
}
-#define hlist_for_each_entry_rcu(pos, head, member) \
- hlist_for_each_entry(pos, head, member)
+#define hlist_for_each_entry_rcu(pos, head, member) \
+ for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
+ typeof(*(pos)), member); \
+ pos; \
+ pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \
+ &(pos)->member)), typeof(*(pos)), member))
static inline void
hlist_del_rcu(struct hlist_node *n)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 27, 5:32 AM (10 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35588165
Default Alt Text
D20719.id58865.diff (1 KB)
Attached To
Mode
D20719: LinuxKPI rcu list additions
Attached
Detach File
Event Timeline
Log In to Comment