upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / include / linux / rcupdate.h
index b12bdd9..91057d6 100644 (file)
@@ -238,6 +238,24 @@ static inline int rcu_pending(int cpu)
                                (_________p1); \
                                })
 
+/**
+ * rcu_assign_pointer - assign (publicize) a pointer to a newly
+ * initialized structure that will be dereferenced by RCU read-side
+ * critical sections.  Returns the value assigned.
+ *
+ * Inserts memory barriers on architectures that require them
+ * (pretty much all of them other than x86), and also prevents
+ * the compiler from reordering the code that initializes the
+ * structure after the pointer assignment.  More importantly, this
+ * call documents which pointers will be dereferenced by RCU read-side
+ * code.
+ */
+
+#define rcu_assign_pointer(p, v)       ({ \
+                                               smp_wmb(); \
+                                               (p) = (v); \
+                                       })
+
 extern void rcu_init(void);
 extern void rcu_check_callbacks(int cpu, int user);
 extern void rcu_restart_cpu(int cpu);