public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] percpu: add percpu_variable_ptr()
@ 2010-06-23 10:04 Lai Jiangshan
  2010-06-23 10:07 ` Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Lai Jiangshan @ 2010-06-23 10:04 UTC (permalink / raw)
  To: Tejun Heo, Paul E. McKenney, Ingo Molnar, LKML

The percpu variable and allocated percpu data are compatible
witch each other, This patch adds a API, thus we can use
per_cpu_ptr() for defined/declared percpu variable.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index ce2dc65..d5c8d7f 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -81,6 +81,12 @@
 #endif
 
 /*
+ * Ptr of the declared/defined per-CPU variable.
+ * It is totally compatible with the return from alloc_percpu().
+ */
+#define percpu_variable_ptr(name) (&(name))
+
+/*
  * Variant on the per-CPU variable declaration/definition theme used for
  * ordinary per-CPU variables.
  */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-23 10:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-23 10:04 [PATCH 1/2] percpu: add percpu_variable_ptr() Lai Jiangshan
2010-06-23 10:07 ` Tejun Heo
2010-06-23 10:20   ` Lai Jiangshan
2010-06-23 10:22     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox