Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / obdclass / mea.c
index 10ab6ca..a7bd3e4 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
+#include <obd_class.h>
 #ifdef __KERNEL__
 #include <linux/kmod.h>   /* for request_module() */
 #include <linux/module.h>
-#include <obd_class.h>
 #include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #else
 #include <liblustre.h>
-#include <obd_class.h>
 #include <obd.h>
 #endif
 #include <lprocfs_status.h>
 
 #ifdef __KERNEL__
 #include <linux/jbd.h>
+#ifdef HAVE_SERVER_SUPPORT
 /* LDISKFS_SB() */
 #include <linux/ldiskfs_fs.h>
 #endif
+#endif
 static int mea_last_char_hash(int count, char *name, int namelen)
 {
         unsigned int c;
@@ -116,8 +117,8 @@ static __u32 hash_build(const char *name, int namelen)
 {
         __u32 hash;
 
-        hash = (hash_build0(name, namelen) << 1) & MAX_HASH_SIZE;
-        if (hash > MAX_HASH_SIZE - HASH_GRAY_AREA)
+        hash = (hash_build0(name, namelen) << 1) & MAX_HASH_SIZE_32;
+        if (hash > MAX_HASH_SIZE_32 - HASH_GRAY_AREA)
                 hash &= HASH_GRAY_AREA - 1;
         return hash;
 }
@@ -126,9 +127,9 @@ static int mea_hash_segment(int count, const char *name, int namelen)
 {
         __u32 hash;
 
-        LASSERT(IS_PO2(MAX_HASH_SIZE + 1));
+        LASSERT(IS_PO2(MAX_HASH_SIZE_32 + 1));
 
-        hash = hash_build(name, namelen) / (MAX_HASH_SIZE / count);
+        hash = hash_build(name, namelen) / (MAX_HASH_SIZE_32 / count);
         LASSERTF(hash < count, "hash %x count %d \n", hash, count);
 
         return hash;