]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
compat: add smp_mb__before_clear_bit as necessary
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 4 Mar 2015 16:37:59 +0000 (11:37 -0500)
committerMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 4 Mar 2015 18:10:33 +0000 (13:10 -0500)
RHEL7.1 no longer has the above macro in <asm/bitops.h>.

Add it in the compat version of <linux/bitops> as if
<asm/bitops.h> had provided it.

This really include probably needs to be reworked using
the autoconf stuff.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
include/linux/bitops.h

index aa76af1843445343705673f583537023fd8880dc..38064da1c5d621363fa3cdcd789cfbf90e5d9a31 100644 (file)
@@ -23,6 +23,27 @@ extern unsigned long __sw_hweight64(__u64 w);
  */
 #include <asm/bitops.h>
 
+/*
+ *  * Provide __deprecated wrappers for the new interface, avoid flag day changes.
+ *   * We need the ugly external functions to break header recursion hell.
+ *    */
+#ifndef smp_mb__before_clear_bit
+static inline void __deprecated smp_mb__before_clear_bit(void)
+{
+       extern void __smp_mb__before_atomic(void);
+       __smp_mb__before_atomic();
+}
+#endif
+
+#ifndef smp_mb__after_clear_bit
+static inline void __deprecated smp_mb__after_clear_bit(void)
+{
+       extern void __smp_mb__after_atomic(void);
+__smp_mb__after_atomic();
+}
+#endif
+
+
 #define for_each_set_bit(bit, addr, size) \
        for ((bit) = find_first_bit((addr), (size)); \
             (bit) < (size); \