oti_alloc_cookies(set->set_oti, set->set_count);
if (set->set_oti->oti_logcookies) {
memcpy(set->set_oti->oti_logcookies, cookies, newsize);
- OBD_FREE(cookies, oldsize);
+ OBD_FREE_LARGE(cookies, oldsize);
set->set_cookies = set->set_oti->oti_logcookies;
} else {
CWARN("'leaking' %d bytes\n", oldsize - newsize);
LASSERT(lsm->lsm_stripe_count >= set->set_count);
newsize = lov_stripe_md_size(set->set_count);
- OBD_ALLOC(lsm_new, newsize);
+ OBD_ALLOC_LARGE(lsm_new, newsize);
if (lsm_new != NULL) {
int i;
memcpy(lsm_new, lsm, sizeof(*lsm));
sizeof(struct lov_oinfo));
}
lsm_new->lsm_stripe_count = set->set_count;
- OBD_FREE(lsm, sizeof(struct lov_stripe_md) +
- lsm->lsm_stripe_count * sizeof(struct lov_oinfo *));
+ OBD_FREE_LARGE(lsm, sizeof(struct lov_stripe_md) +
+ lsm->lsm_stripe_count*sizeof(struct lov_oinfo*));
set->set_oi->oi_md = lsm_new;
} else {
CWARN("'leaking' few bytes\n");
stripe_cnt - (stripe_cnt / 4) : stripe_cnt);
}
-#define LOV_CREATE_RESEED_MULT 4
-#define LOV_CREATE_RESEED_MIN 1000
+#define LOV_CREATE_RESEED_MULT 30
+#define LOV_CREATE_RESEED_MIN 2000
/* Allocate objects on osts with round-robin algorithm */
static int alloc_rr(struct lov_obd *lov, int *idx_arr, int *stripe_cnt,
char *poolname, int flags)
GOTO(out, rc);
if (--lqr->lqr_start_count <= 0) {
- lqr->lqr_start_idx = ll_rand() % osts->op_count;
+ lqr->lqr_start_idx = cfs_rand() % osts->op_count;
lqr->lqr_start_count =
(LOV_CREATE_RESEED_MIN / max(osts->op_count, 1U) +
LOV_CREATE_RESEED_MULT) * max(osts->op_count, 1U);
if (total_weight) {
#if BITS_PER_LONG == 32
- rand = ll_rand() % (unsigned)total_weight;
+ rand = cfs_rand() % (unsigned)total_weight;
/* If total_weight > 32-bit, first generate the high
* 32 bits of the random number, then add in the low
* 32 bits (truncated to the upper limit, if needed) */
if (total_weight > 0xffffffffULL)
- rand = (__u64)(ll_rand() %
+ rand = (__u64)(cfs_rand() %
(unsigned)(total_weight >> 32)) << 32;
else
rand = 0;
if (rand == (total_weight & 0xffffffff00000000ULL))
- rand |= ll_rand() % (unsigned)total_weight;
+ rand |= cfs_rand() % (unsigned)total_weight;
else
- rand |= ll_rand();
+ rand |= cfs_rand();
#else
- rand = ((__u64)ll_rand() << 32 | ll_rand()) %
+ rand = ((__u64)cfs_rand() << 32 | cfs_rand()) %
total_weight;
#endif
} else {
lov_set_add_req(req, set);
req->rq_buflen = sizeof(*req->rq_oi.oi_md);
- OBD_ALLOC(req->rq_oi.oi_md, req->rq_buflen);
+ OBD_ALLOC_LARGE(req->rq_oi.oi_md, req->rq_buflen);
if (req->rq_oi.oi_md == NULL)
GOTO(out_err, rc = -ENOMEM);