From 6b2cd6118cdf245dd3d32318b913431ebcaf0d28 Mon Sep 17 00:00:00 2001 From: yangsheng <yangsheng> Date: Tue, 9 Sep 2008 15:49:05 +0000 Subject: [PATCH] Branch HEAD b=16949 i=yury, deen Add labs(x) as a inline function because absent since 2.6.22. --- lustre/include/linux/lustre_compat25.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 8d575a6548..6c36ac1f11 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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 */ -- GitLab