Whamcloud - gitweb
LU-7782 scrub: handle slave obj of striped directory
[fs/lustre-release.git] / lustre / include / lustre_lmv.h
index 6c13fe7..1cf102a 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2014, Intel Corporation.
+ * Copyright (c) 2014, 2015, Intel Corporation.
  */
 /*
  * lustre/include/lustre_lmv.h
@@ -130,13 +130,11 @@ lmv_hash_all_chars(unsigned int count, const char *name, int namelen)
 static inline unsigned int
 lmv_hash_fnv1a(unsigned int count, const char *name, int namelen)
 {
-       __u64   hash;
+       __u64 hash;
 
        hash = lustre_hash_fnv_1a_64(name, namelen);
 
-       hash = hash % count;
-
-       return hash;
+       return do_div(hash, count);
 }
 
 static inline int lmv_name_to_stripe_index(__u32 lmv_hash_type,