lsm_size = lov_stripe_md_size(1);
LASSERT(*lsmp == NULL);
- OBD_ALLOC(*lsmp, lsm_size);
+ *lsmp = kzalloc(lsm_size, GFP_NOFS);
if (*lsmp == NULL)
return -ENOMEM;
- OBD_ALLOC((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
+ (*lsmp)->lsm_oinfo[0] = kzalloc(sizeof(struct lov_oinfo), GFP_NOFS);
if ((*lsmp)->lsm_oinfo[0] == NULL) {
- OBD_FREE(*lsmp, lsm_size);
+ kfree(*lsmp);
return -ENOMEM;
}
lsm_size = lov_stripe_md_size(1);
LASSERT(*lsmp != NULL);
- OBD_FREE((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
- OBD_FREE(*lsmp, lsm_size);
+ kfree((*lsmp)->lsm_oinfo[0]);
+ kfree(*lsmp);
*lsmp = NULL;
return 0;
}
int rc;
int cleanup = 0;
- OBD_ALLOC_PTR(ed);
+ ed = kzalloc(sizeof(*ed), GFP_NOFS);
if (ed == NULL) {
rc = -ENOMEM;
goto out;
case 2:
cl_device_fini(&ed->ed_cl);
case 1:
- OBD_FREE_PTR(ed);
+ kfree(ed);
case 0:
default:
break;
LASSERT(ed->ed_site == lu2cl_site(d->ld_site));
echo_site_fini(env, ed);
cl_device_fini(&ed->ed_cl);
- OBD_FREE_PTR(ed);
+ kfree(ed);
return NULL;
}
if (rw == OBD_BRW_WRITE)
brw_flags = OBD_BRW_ASYNC;
- OBD_ALLOC(pga, npages * sizeof(*pga));
+ pga = kcalloc(npages, sizeof(*pga), GFP_NOFS);
if (pga == NULL)
return -ENOMEM;
- OBD_ALLOC(pages, npages * sizeof(*pages));
+ pages = kcalloc(npages, sizeof(*pages), GFP_NOFS);
if (pages == NULL) {
- OBD_FREE(pga, npages * sizeof(*pga));
+ kfree(pga);
return -ENOMEM;
}
}
OBD_PAGE_FREE(pgp->pg);
}
- OBD_FREE(pga, npages * sizeof(*pga));
- OBD_FREE(pages, npages * sizeof(*pages));
+ kfree(pga);
+ kfree(pages);
return rc;
}
npages = batch >> PAGE_CACHE_SHIFT;
tot_pages = count >> PAGE_CACHE_SHIFT;
- OBD_ALLOC(lnb, npages * sizeof(struct niobuf_local));
- OBD_ALLOC(rnb, npages * sizeof(struct niobuf_remote));
+ lnb = kcalloc(npages, sizeof(struct niobuf_local), GFP_NOFS);
+ rnb = kcalloc(npages, sizeof(struct niobuf_remote), GFP_NOFS);
if (lnb == NULL || rnb == NULL) {
ret = -ENOMEM;
out:
if (lnb)
- OBD_FREE(lnb, npages * sizeof(struct niobuf_local));
+ kfree(lnb);
if (rnb)
- OBD_FREE(rnb, npages * sizeof(struct niobuf_remote));
+ kfree(rnb);
return ret;
}
if (rc < 0)
return rc;
- OBD_ALLOC_PTR(env);
+ env = kzalloc(sizeof(*env), GFP_NOFS);
if (env == NULL)
return -ENOMEM;
out:
lu_env_fini(env);
- OBD_FREE_PTR(env);
+ kfree(env);
/* XXX this should be in a helper also called by target_send_reply */
for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4;
ec->ec_unique = 0;
ec->ec_nstripes = 0;
- OBD_ALLOC(ocd, sizeof(*ocd));
+ ocd = kzalloc(sizeof(*ocd), GFP_NOFS);
if (ocd == NULL) {
CERROR("Can't alloc ocd connecting to %s\n",
lustre_cfg_string(lcfg, 1));
spin_unlock(&tgt->obd_dev_lock);
}
- OBD_FREE(ocd, sizeof(*ocd));
+ kfree(ocd);
if (rc != 0) {
CERROR("fail to connect to device %s\n",