Whamcloud - gitweb
b=16776
[fs/lustre-release.git] / lustre / include / linux / lustre_compat25.h
index 63554b4..b6c1496 100644 (file)
@@ -404,18 +404,6 @@ int ll_unregister_blkdev(unsigned int dev, const char *name)
 #define ll_inode_blksize(a)     (1<<(a)->i_blkbits)
 #endif
 
-#ifndef HAVE_EXPORT_NR_FREE_BUFFER_PAGES
-static inline unsigned int ll_nr_free_buffer_pages(void)
-{
-        struct sysinfo si;
-
-        si_meminfo(&si);
-        return (unsigned int)(si.freeram - si.freehigh);
-}
-#else
-#define ll_nr_free_buffer_pages()      nr_free_buffer_pages()
-#endif
-
 #ifdef HAVE_FS_RENAME_DOES_D_MOVE
 #define LL_RENAME_DOES_D_MOVE  FS_RENAME_DOES_D_MOVE
 #else
@@ -620,5 +608,24 @@ 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
+
+/* Using kernel fls(). Userspace will use one defined in user-bitops.h. */
+#ifndef __fls
+#define __fls fls
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _COMPAT25_H */