Whamcloud - gitweb
LU-1389 lov: standardize lov_do_div64() usage
[fs/lustre-release.git] / lustre / lov / lov_internal.h
index de21e5a..2c2214e 100644 (file)
@@ -38,6 +38,7 @@
 #define LOV_INTERNAL_H
 
 #include <obd_class.h>
+#include <obd_lov.h>
 #include <lustre/lustre_user.h>
 
 struct lov_lock_handles {
@@ -332,34 +333,4 @@ struct pool_desc *lov_find_pool(struct lov_obd *lov, char *poolname);
 int lov_check_index_in_pool(__u32 idx, struct pool_desc *pool);
 void lov_pool_putref(struct pool_desc *pool);
 
-#if BITS_PER_LONG == 64
-# define ll_do_div64(n,base) ({                                 \
-        uint64_t __base = (base);                               \
-        uint64_t __rem;                                         \
-        __rem = ((uint64_t)(n)) % __base;                       \
-        (n) = ((uint64_t)(n)) / __base;                         \
-        __rem;                                                  \
-  })
-#elif BITS_PER_LONG == 32
-# define ll_do_div64(n,base) ({                                 \
-        uint64_t __rem;                                         \
-        if ((sizeof(base) > 4) && (((base)&0xffffffff00000000ULL) != 0)) { \
-                int __remainder;                                \
-                LASSERTF(!((base) & (LOV_MIN_STRIPE_SIZE - 1)), "64 bit lov "\
-                          "division %llu / %llu\n", (n), (base)); \
-                __remainder = (n) & (LOV_MIN_STRIPE_SIZE - 1);  \
-                (n) >>= LOV_MIN_STRIPE_BITS;                    \
-                (base) >>= LOV_MIN_STRIPE_BITS;                 \
-                __rem = do_div(n, base);                        \
-                __rem <<= LOV_MIN_STRIPE_BITS;                  \
-                __rem += __remainder;                           \
-        } else {                                                \
-                __rem = do_div(n, base);                        \
-        }                                                       \
-        __rem;                                                  \
-  })
-#else
-#error Unsupported architecture.
-#endif
-
 #endif