[ovs-dev] [PATCH] datapath: Use per_cpu_ptr instead of percpu_ptr.

Jesse Gross jesse at nicira.com
Fri May 14 02:44:45 UTC 2010


percpu_ptr was removed in 2.6.30, so update the one remaining user
and take out the compatibility code.

Suggested-by: Ben Pfaff <blp at nicira.com>
--
This patch applies on top of the previously posted series on locking.
---
 datapath/datapath.c                                |    2 +-
 datapath/linux-2.6/Modules.mk                      |    1 -
 .../linux-2.6/compat-2.6/include/linux/percpu.h    |   10 ----------
 3 files changed, 1 insertions(+), 12 deletions(-)
 delete mode 100644 datapath/linux-2.6/compat-2.6/include/linux/percpu.h

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 837f567..cc55ff3 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1340,7 +1340,7 @@ static int get_dp_stats(struct datapath *dp, struct odp_stats __user *statsp)
 	stats.n_frags = stats.n_hit = stats.n_missed = stats.n_lost = 0;
 	for_each_possible_cpu(i) {
 		const struct dp_stats_percpu *s;
-		s = percpu_ptr(dp->stats_percpu, i);
+		s = per_cpu_ptr(dp->stats_percpu, i);
 		stats.n_frags += s->n_frags;
 		stats.n_hit += s->n_hit;
 		stats.n_missed += s->n_missed;
diff --git a/datapath/linux-2.6/Modules.mk b/datapath/linux-2.6/Modules.mk
index 75e885c..c63e3ea 100644
--- a/datapath/linux-2.6/Modules.mk
+++ b/datapath/linux-2.6/Modules.mk
@@ -30,7 +30,6 @@ openvswitch_headers += \
 	linux-2.6/compat-2.6/include/linux/netfilter_bridge.h \
 	linux-2.6/compat-2.6/include/linux/netfilter_ipv4.h \
 	linux-2.6/compat-2.6/include/linux/netlink.h \
-	linux-2.6/compat-2.6/include/linux/percpu.h \
 	linux-2.6/compat-2.6/include/linux/random.h \
 	linux-2.6/compat-2.6/include/linux/rculist.h \
 	linux-2.6/compat-2.6/include/linux/rtnetlink.h \
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/percpu.h b/datapath/linux-2.6/compat-2.6/include/linux/percpu.h
deleted file mode 100644
index 0f68bb2..0000000
--- a/datapath/linux-2.6/compat-2.6/include/linux/percpu.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __LINUX_PERCPU_H_WRAPPER
-#define __LINUX_PERCPU_H_WRAPPER 1
-
-#include_next <linux/percpu.h>
-
-#ifndef percpu_ptr
-#define percpu_ptr per_cpu_ptr
-#endif
-
-#endif /* linux/percpu.h wrapper */
-- 
1.7.0.4





More information about the dev mailing list