@@ -281,21 +281,22 @@
* - OST_IO_MAXREQSIZE must be at least 1 page of cookies plus some spillover
* - Must be a multiple of 1024
*/
-#define _OST_MAXREQSIZE_BASE (sizeof(struct lustre_msg) + \
+#define _OST_MAXREQSIZE_BASE ((unsigned long)(sizeof(struct lustre_msg) + \
sizeof(struct ptlrpc_body) + \
sizeof(struct obdo) + \
sizeof(struct obd_ioobj) + \
- sizeof(struct niobuf_remote))
-#define _OST_MAXREQSIZE_SUM (_OST_MAXREQSIZE_BASE + \
+ sizeof(struct niobuf_remote)))
+#define _OST_MAXREQSIZE_SUM ((unsigned long)(_OST_MAXREQSIZE_BASE + \
sizeof(struct niobuf_remote) * \
- (DT_MAX_BRW_PAGES - 1))
+ (DT_MAX_BRW_PAGES - 1)))
/**
* FIEMAP request can be 4K+ for now
*/
-#define OST_MAXREQSIZE (16 * 1024)
-#define OST_IO_MAXREQSIZE max_t(int, OST_MAXREQSIZE, \
- (((_OST_MAXREQSIZE_SUM - 1) | (1024 - 1)) + 1))
+#define OST_MAXREQSIZE (16UL * 1024UL)
+#define OST_IO_MAXREQSIZE max(OST_MAXREQSIZE, \
+ ((_OST_MAXREQSIZE_SUM - 1) | \
+ (1024 - 1)) + 1)
/* Safe estimate of free space in standard RPC, provides upper limit for # of
* bytes of i/o to pack in RPC (skipping bulk transfer).
@@ -186,19 +186,22 @@ struct lsm_operations {
})
#elif BITS_PER_LONG == 32
# define lov_do_div64(n, base) ({ \
+ u64 __num = (n); \
u64 __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), (u64)(base)); \
- __remainder = (n) & (LOV_MIN_STRIPE_SIZE - 1); \
- (n) >>= LOV_MIN_STRIPE_BITS; \
- __rem = do_div(n, (base) >> LOV_MIN_STRIPE_BITS); \
+ LASSERTF(!((base) & (LOV_MIN_STRIPE_SIZE - 1)), \
+ "64 bit lov division %llu / %llu\n", \
+ __num, (u64)(base)); \
+ __remainder = __num & (LOV_MIN_STRIPE_SIZE - 1); \
+ __num >>= LOV_MIN_STRIPE_BITS; \
+ __rem = do_div(__num, (base) >> LOV_MIN_STRIPE_BITS); \
__rem <<= LOV_MIN_STRIPE_BITS; \
__rem += __remainder; \
} else { \
- __rem = do_div(n, base); \
+ __rem = do_div(__num, base); \
} \
+ (n) = __num; \
__rem; \
})
#endif