list_del_init(&req->rq_link);
if (req->rq_oi.oi_oa)
- OBDO_FREE(req->rq_oi.oi_oa);
- if (req->rq_oi.oi_md)
- OBD_FREE_LARGE(req->rq_oi.oi_md, req->rq_buflen);
- if (req->rq_oi.oi_osfs)
- OBD_FREE(req->rq_oi.oi_osfs,
- sizeof(*req->rq_oi.oi_osfs));
- OBD_FREE(req, sizeof(*req));
+ kmem_cache_free(obdo_cachep, req->rq_oi.oi_oa);
+ kfree(req->rq_oi.oi_osfs);
+ kfree(req);
}
-
- if (set->set_pga) {
- int len = set->set_oabufs * sizeof(*set->set_pga);
- OBD_FREE_LARGE(set->set_pga, len);
- }
- if (set->set_lockh)
- lov_llh_put(set->set_lockh);
-
- OBD_FREE(set, sizeof(*set));
+ kfree(set);
}
int lov_set_finished(struct lov_request_set *set, int idempotent)
if (!atomic_read(&set->set_success))
return -EIO;
- OBDO_ALLOC(tmp_oa);
+ tmp_oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
if (tmp_oa == NULL) {
rc = -ENOMEM;
goto out;
memcpy(set->set_oi->oi_oa, tmp_oa, sizeof(*set->set_oi->oi_oa));
out:
if (tmp_oa)
- OBDO_FREE(tmp_oa);
+ kmem_cache_free(obdo_cachep, tmp_oa);
return rc;
}
struct lov_obd *lov = &exp->exp_obd->u.lov;
int rc = 0, i;
- OBD_ALLOC(set, sizeof(*set));
- if (set == NULL)
+ set = kzalloc(sizeof(*set), GFP_NOFS);
+ if (!set)
return -ENOMEM;
lov_init_set(set);
continue;
}
- OBD_ALLOC(req, sizeof(*req));
- if (req == NULL) {
+ req = kzalloc(sizeof(*req), GFP_NOFS);
+ if (!req) {
rc = -ENOMEM;
goto out_set;
}
req->rq_stripe = i;
req->rq_idx = loi->loi_ost_idx;
- OBDO_ALLOC(req->rq_oi.oi_oa);
+ req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
+ GFP_NOFS | __GFP_ZERO);
if (req->rq_oi.oi_oa == NULL) {
- OBD_FREE(req, sizeof(*req));
+ kfree(req);
rc = -ENOMEM;
goto out_set;
}
sizeof(*req->rq_oi.oi_oa));
req->rq_oi.oi_oa->o_oi = loi->loi_oi;
req->rq_oi.oi_cb_up = cb_getattr_update;
- req->rq_oi.oi_capa = oinfo->oi_capa;
lov_set_add_req(req, set);
}
struct lov_obd *lov = &exp->exp_obd->u.lov;
int rc = 0, i;
- OBD_ALLOC(set, sizeof(*set));
- if (set == NULL)
+ set = kzalloc(sizeof(*set), GFP_NOFS);
+ if (!set)
return -ENOMEM;
lov_init_set(set);
continue;
}
- OBD_ALLOC(req, sizeof(*req));
- if (req == NULL) {
+ req = kzalloc(sizeof(*req), GFP_NOFS);
+ if (!req) {
rc = -ENOMEM;
goto out_set;
}
req->rq_stripe = i;
req->rq_idx = loi->loi_ost_idx;
- OBDO_ALLOC(req->rq_oi.oi_oa);
+ req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
+ GFP_NOFS | __GFP_ZERO);
if (req->rq_oi.oi_oa == NULL) {
- OBD_FREE(req, sizeof(*req));
+ kfree(req);
rc = -ENOMEM;
goto out_set;
}
struct lov_obd *lov = &exp->exp_obd->u.lov;
int rc = 0, i;
- OBD_ALLOC(set, sizeof(*set));
- if (set == NULL)
+ set = kzalloc(sizeof(*set), GFP_NOFS);
+ if (!set)
return -ENOMEM;
lov_init_set(set);
continue;
}
- OBD_ALLOC(req, sizeof(*req));
- if (req == NULL) {
+ req = kzalloc(sizeof(*req), GFP_NOFS);
+ if (!req) {
rc = -ENOMEM;
goto out_set;
}
req->rq_stripe = i;
req->rq_idx = loi->loi_ost_idx;
- OBDO_ALLOC(req->rq_oi.oi_oa);
+ req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
+ GFP_NOFS | __GFP_ZERO);
if (req->rq_oi.oi_oa == NULL) {
- OBD_FREE(req, sizeof(*req));
+ kfree(req);
rc = -ENOMEM;
goto out_set;
}
req->rq_oi.oi_oa->o_oi = loi->loi_oi;
req->rq_oi.oi_oa->o_stripe_idx = i;
req->rq_oi.oi_cb_up = cb_setattr_update;
- req->rq_oi.oi_capa = oinfo->oi_capa;
if (oinfo->oi_oa->o_valid & OBD_MD_FLSIZE) {
int off = lov_stripe_offset(oinfo->oi_md,
if (tmp & 1) {
if (quit)
break;
- else
- quit = 1;
+ quit = 1;
shift = 0;
}
tmp >>= 1;
struct lov_obd *lov = &obd->u.lov;
int rc = 0, i;
- OBD_ALLOC(set, sizeof(*set));
- if (set == NULL)
+ set = kzalloc(sizeof(*set), GFP_NOFS);
+ if (!set)
return -ENOMEM;
lov_init_set(set);
continue;
}
- OBD_ALLOC(req, sizeof(*req));
- if (req == NULL) {
+ req = kzalloc(sizeof(*req), GFP_NOFS);
+ if (!req) {
rc = -ENOMEM;
goto out_set;
}
- OBD_ALLOC(req->rq_oi.oi_osfs, sizeof(*req->rq_oi.oi_osfs));
- if (req->rq_oi.oi_osfs == NULL) {
- OBD_FREE(req, sizeof(*req));
+ req->rq_oi.oi_osfs = kzalloc(sizeof(*req->rq_oi.oi_osfs),
+ GFP_NOFS);
+ if (!req->rq_oi.oi_osfs) {
+ kfree(req);
rc = -ENOMEM;
goto out_set;
}