]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: Avoid symbols duplication by compat
authorVladimir Sokolovsky <vlad@mellanox.com>
Mon, 19 Aug 2013 13:36:25 +0000 (16:36 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 19 Aug 2013 13:40:01 +0000 (16:40 +0300)
Use LINUX_BACKPORT macro to rename exported symbol to avoid duplication.
Removed ida_simple_get symbol as not required by RDMA

bug: 2436
bug: 2413

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
compat/Makefile
compat/compat-3.1.c [deleted file]
include/linux/compat-2.6.h
include/linux/compat-3.1.h
include/linux/compat-3.3.h

index 08b5fd7ac219d2ec0c76a518b2dd9f03114422f2..9493112f9a667629128056a108558a20fbe2e9fb 100644 (file)
@@ -37,7 +37,6 @@ compat-$(CONFIG_COMPAT_KERNEL_2_6_39) += \
        compat-2.6.39.o \
        kstrtox.o
 compat-$(CONFIG_COMPAT_KERNEL_3_0) += compat-3.0.o
-compat-$(CONFIG_COMPAT_KERNEL_3_1) += compat-3.1.o
 compat-$(CONFIG_COMPAT_KERNEL_3_2) += compat-3.2.o
 compat-$(CONFIG_COMPAT_KERNEL_3_3) += \
        compat-3.3.o \
diff --git a/compat/compat-3.1.c b/compat/compat-3.1.c
deleted file mode 100644 (file)
index 07bf8d6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2012    Hauke Mehrtens <hauke@hauke-m.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 3.1.
- */
-
-#ifndef CONFIG_COMPAT_SLES_11_3
-#if ! defined(RHEL_MINOR) || (RHEL_MINOR < 3)
-#include <linux/idr.h>
-
-static DEFINE_SPINLOCK(simple_ida_lock);
-
-/**
- * ida_simple_get - get a new id.
- * @ida: the (initialized) ida.
- * @start: the minimum id (inclusive, < 0x8000000)
- * @end: the maximum id (exclusive, < 0x8000000 or 0)
- * @gfp_mask: memory allocation flags
- *
- * Allocates an id in the range start <= id < end, or returns -ENOSPC.
- * On memory allocation failure, returns -ENOMEM.
- *
- * Use ida_simple_remove() to get rid of an id.
- */
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
-                  gfp_t gfp_mask)
-{
-       int ret, id;
-       unsigned int max;
-       unsigned long flags;
-
-       BUG_ON((int)start < 0);
-       BUG_ON((int)end < 0);
-
-       if (end == 0)
-               max = 0x80000000;
-       else {
-               BUG_ON(end < start);
-               max = end - 1;
-       }
-
-again:
-       if (!ida_pre_get(ida, gfp_mask))
-               return -ENOMEM;
-
-       spin_lock_irqsave(&simple_ida_lock, flags);
-       ret = ida_get_new_above(ida, start, &id);
-       if (!ret) {
-               if (id > max) {
-                       ida_remove(ida, id);
-                       ret = -ENOSPC;
-               } else {
-                       ret = id;
-               }
-       }
-       spin_unlock_irqrestore(&simple_ida_lock, flags);
-
-       if (unlikely(ret == -EAGAIN))
-               goto again;
-
-       return ret;
-}
-EXPORT_SYMBOL(ida_simple_get);
-
-/**
- * ida_simple_remove - remove an allocated id.
- * @ida: the (initialized) ida.
- * @id: the id returned by ida_simple_get.
- */
-void ida_simple_remove(struct ida *ida, unsigned int id)
-{
-       unsigned long flags;
-
-       BUG_ON((int)id < 0);
-       spin_lock_irqsave(&simple_ida_lock, flags);
-       ida_remove(ida, id);
-       spin_unlock_irqrestore(&simple_ida_lock, flags);
-}
-EXPORT_SYMBOL(ida_simple_remove);
-/* source lib/idr.c */
-#endif
-#endif /* CONFIG_COMPAT_SLES_11_3 */
-
index b188d28382ffbd6b34092efdd02f5ae282d7cd94..0ea019032638e8463af87f4e419fc44f46ae5e8d 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef LINUX_26_COMPAT_H
 #define LINUX_26_COMPAT_H
 
+#define LINUX_BACKPORT(__sym) backport_ ##__sym
+
 #include <linux/version.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
 #include <linux/kconfig.h>
index f1a0ba43f6fdc3a43937e535189760e180d50b64..a4b0734592a7ca76d510e25b957767d645d81581 100644 (file)
@@ -111,12 +111,6 @@ static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
 #include <asm-generic/atomic64.h>
 #endif
 
-#ifndef CONFIG_COMPAT_SLES_11_3
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
-                  gfp_t gfp_mask);
-void ida_simple_remove(struct ida *ida, unsigned int id);
-#endif /* CONFIG_COMPAT_SLES_11_3 */
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) */
 
 #endif /* LINUX_3_1_COMPAT_H */
index 337cb6fb65c13c4258b2b20bdc853c7d89a7b66a..e3c6336b3e7dee7036f69a81a7100e292e06dcf6 100644 (file)
@@ -26,6 +26,7 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 #endif
 #endif
 
+#define __pskb_copy LINUX_BACKPORT(__pskb_copy)
 extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
                                   int headroom, gfp_t gfp_mask);
 
@@ -76,16 +77,19 @@ module_exit(__driver##_exit);
        module_driver(__usb_driver, usb_register, \
                       usb_deregister)
 
+#define netdev_tx_sent_queue LINUX_BACKPORT(netdev_tx_sent_queue)
 static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
                                       unsigned int bytes)
 {
 }
 
+#define netdev_tx_completed_queue LINUX_BACKPORT(netdev_tx_completed_queue)
 static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
                                            unsigned pkts, unsigned bytes)
 {
 }
 
+#define netdev_tx_reset_queue LINUX_BACKPORT(netdev_tx_reset_queue)
 static inline void netdev_tx_reset_queue(struct netdev_queue *q)
 {
 #ifdef CONFIG_BQL