Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153057303
D20719.id58871.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D20719.id58871.diff
View Options
Index: head/sys/compat/linuxkpi/common/include/linux/rculist.h
===================================================================
--- head/sys/compat/linuxkpi/common/include/linux/rculist.h
+++ head/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)
Index: head/sys/sys/param.h
===================================================================
--- head/sys/sys/param.h
+++ head/sys/sys/param.h
@@ -60,7 +60,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1300032 /* Master, propagated to newvers */
+#define __FreeBSD_version 1300033 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 9:33 PM (9 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31800001
Default Alt Text
D20719.id58871.diff (2 KB)
Attached To
Mode
D20719: LinuxKPI rcu list additions
Attached
Detach File
Event Timeline
Log In to Comment