datapath: Get rid of compat.h, compat26.h in favor of modern approach.
authorBen Pfaff <blp@nicira.com>
Wed, 12 Jan 2011 18:44:43 +0000 (10:44 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 13 Jan 2011 20:26:15 +0000 (12:26 -0800)
I had completely forgotten that we had a top-level compat.h and compat26.h.
It's better to distribute their contents to individual compat headers, so
this commit does so and deletes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/Modules.mk
datapath/brcompat.c
datapath/compat.h [deleted file]
datapath/datapath.c
datapath/flow.c
datapath/linux-2.6/Modules.mk
datapath/linux-2.6/compat-2.6/compat26.h [deleted file]
datapath/linux-2.6/compat-2.6/include/linux/kernel.h
datapath/linux-2.6/compat-2.6/include/linux/netdevice.h
datapath/linux-2.6/compat-2.6/include/linux/slab.h
datapath/vport-netdev.c

index b4d40fd..01c1a71 100644 (file)
@@ -31,7 +31,6 @@ openvswitch_sources = \
 openvswitch_headers = \
        actions.h \
        checksum.h \
-       compat.h \
        datapath.h \
        dp_sysfs.h \
        flow.h \
index f23db93..15cec9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2011 Nicira Networks.
  * Distributed under the terms of the GNU GPL version 2.
  *
  * Significant portions of this file may be copied from parts of the Linux
@@ -17,7 +17,6 @@
 #include <linux/rtnetlink.h>
 #include <net/genetlink.h>
 
-#include "compat.h"
 #include "openvswitch/brcompat-netlink.h"
 #include "brc_procfs.h"
 #include "datapath.h"
diff --git a/datapath/compat.h b/datapath/compat.h
deleted file mode 100644 (file)
index 84a222f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2009 Nicira Networks.
- * Distributed under the terms of the GNU GPL version 2.
- *
- * Significant portions of this file may be copied from parts of the Linux
- * kernel, by Linus Torvalds and others.
- */
-
-#ifndef COMPAT_H
-#define COMPAT_H 1
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-
-#include "compat26.h"
-
-#else
-
-#include "compat24.h"
-
-#endif
-
-
-#endif /* compat.h */
index 4117ba9..f9af829 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira Networks.
  * Distributed under the terms of the GNU GPL version 2.
  *
  * Significant portions of this file may be copied from parts of the Linux
@@ -53,8 +53,6 @@
 #include "table.h"
 #include "vport-internal_dev.h"
 
-#include "compat.h"
-
 int (*dp_ioctl_hook)(struct net_device *dev, struct ifreq *rq, int cmd);
 EXPORT_SYMBOL(dp_ioctl_hook);
 
index fb339e7..ccc72d3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Distributed under the terms of the GNU GPL version 2.
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira Networks.
  *
  * Significant portions of this file may be copied from parts of the Linux
  * kernel, by Linus Torvalds and others.
@@ -29,8 +29,6 @@
 #include <net/inet_ecn.h>
 #include <net/ip.h>
 
-#include "compat.h"
-
 static struct kmem_cache *flow_cache;
 static unsigned int hash_seed __read_mostly;
 
index 1bc092e..42514b1 100644 (file)
@@ -8,7 +8,6 @@ openvswitch_sources += \
        linux-2.6/compat-2.6/skbuff-openvswitch.c \
        linux-2.6/compat-2.6/time.c
 openvswitch_headers += \
-       linux-2.6/compat-2.6/compat26.h \
        linux-2.6/compat-2.6/include/asm-generic/bug.h \
        linux-2.6/compat-2.6/include/linux/bottom_half.h \
        linux-2.6/compat-2.6/include/linux/compiler.h \
diff --git a/datapath/linux-2.6/compat-2.6/compat26.h b/datapath/linux-2.6/compat-2.6/compat26.h
deleted file mode 100644 (file)
index 61448d6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __COMPAT26_H
-#define __COMPAT26_H 1
-
-#include <linux/version.h>
-
-#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
-#error "CONFIG_PREEMPT is broken with 2.6.x before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
-#endif
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
-/*----------------------------------------------------------------------------
- * In 2.6.24, a namespace argument became required for dev_get_by_name. */
-
-#define dev_get_by_name(net, name) \
-               dev_get_by_name((name))
-
-#define dev_get_by_index(net, ifindex) \
-               dev_get_by_index((ifindex))
-
-#define __dev_get_by_name(net, name) \
-               __dev_get_by_name((name))
-
-#define __dev_get_by_index(net, ifindex) \
-               __dev_get_by_index((ifindex))
-
-#endif /* linux kernel <= 2.6.23 */
-
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22)
-/*----------------------------------------------------------------------------
- * In 2.6.23, the last argument was dropped from kmem_cache_create. */
-#define kmem_cache_create(n, s, a, f, c) \
-               kmem_cache_create((n), (s), (a), (f), (c), NULL)
-
-#endif /* linux kernel <= 2.6.22 */
-
-#endif /* compat26.h */
index 13361f7..356187f 100644 (file)
@@ -38,4 +38,8 @@
 #define pr_warn pr_warning
 #endif
 
+#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+#error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
+#endif
+
 #endif /* linux/kernel.h */
index ac1ff82..3856bb6 100644 (file)
@@ -116,4 +116,11 @@ static inline void netdev_rx_handler_unregister(struct net_device *dev)
        ( (netdev)->ethtool_ops = (struct ethtool_ops *)(ops) )
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define dev_get_by_name(net, name) dev_get_by_name(name)
+#define dev_get_by_index(net, ifindex) dev_get_by_index(ifindex)
+#define __dev_get_by_name(net, name) __dev_get_by_name(name)
+#define __dev_get_by_index(net, ifindex) __dev_get_by_index(ifindex)
+#endif
+
 #endif
index 5c54c18..7e9c3f4 100644 (file)
@@ -7,4 +7,8 @@
 extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#define kmem_cache_create(n, s, a, f, c) kmem_cache_create(n, s, a, f, c, NULL)
+#endif
+
 #endif
index d492d19..363651b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010 Nicira Networks.
+ * Copyright (c) 2010, 2011 Nicira Networks.
  * Distributed under the terms of the GNU GPL version 2.
  *
  * Significant portions of this file may be copied from parts of the Linux
@@ -21,8 +21,6 @@
 #include "vport-internal_dev.h"
 #include "vport-netdev.h"
 
-#include "compat.h"
-
 /* If the native device stats aren't 64 bit use the vport stats tracking instead. */
 #define USE_VPORT_STATS (sizeof(((struct net_device_stats *)0)->rx_bytes) < sizeof(u64))