Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Tue, 9 Sep 2008 15:49:05 +0000 (15:49 +0000)
committeryangsheng <yangsheng>
Tue, 9 Sep 2008 15:49:05 +0000 (15:49 +0000)
b=16949
i=yury, deen

Add labs(x) as a inline function because absent since 2.6.22.

lustre/include/linux/lustre_compat25.h

index 8d575a6..6c36ac1 100644 (file)
@@ -608,5 +608,19 @@ static inline int ll_crypto_hmac(struct crypto_tfm *tfm,
 #define cpu_to_node(cpu)         0
 #endif
 
+#ifndef abs
+static inline int abs(int x)
+{
+        return (x < 0) ? -x : x;
+}
+#endif
+
+#ifndef labs
+static inline long labs(long x)
+{
+        return (x < 0) ? -x : x;
+}
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _COMPAT25_H */