From 98d605000b8fb23805ea13daaf53ddbb22ae480e Mon Sep 17 00:00:00 2001 From: green Date: Thu, 13 Nov 2008 02:16:05 +0000 Subject: [PATCH] b=16823 r=adilger,shadow Remove 4G limit for stripe_size * num_stripes. 4G limit on stripe_size is still in place, though. --- lustre/lov/lov_internal.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index 46fa422..3e53cba 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -327,4 +327,34 @@ struct pool_desc *lov_find_pool(struct lov_obd *lov, char *poolname); int lov_check_index_in_pool(__u32 idx, 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 -- 1.8.3.1