staging: lustre: replace OBDO_ALLOC with kmem_cache_alloc
Use direct call to kmem_cache_alloc instead of wrapping macro Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4490ff89b1
commit
131637b811
6 changed files with 14 additions and 10 deletions
|
@ -1260,7 +1260,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct lov_stripe_md *lsm = NULL, *lsm2;
|
struct lov_stripe_md *lsm = NULL, *lsm2;
|
||||||
|
|
||||||
OBDO_ALLOC(oa);
|
oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (oa == NULL)
|
if (oa == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
|
||||||
inode->i_ino, inode->i_generation,
|
inode->i_ino, inode->i_generation,
|
||||||
lli->lli_flags);
|
lli->lli_flags);
|
||||||
|
|
||||||
OBDO_ALLOC(oa);
|
oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (!oa) {
|
if (!oa) {
|
||||||
CERROR("can't allocate memory for Size-on-MDS update.\n");
|
CERROR("can't allocate memory for Size-on-MDS update.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -1776,7 +1776,8 @@ int ll_iocontrol(struct inode *inode, struct file *file,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBDO_ALLOC(oinfo.oi_oa);
|
oinfo.oi_oa = kmem_cache_alloc(obdo_cachep,
|
||||||
|
GFP_NOFS | __GFP_ZERO);
|
||||||
if (!oinfo.oi_oa) {
|
if (!oinfo.oi_oa) {
|
||||||
ccc_inode_lsm_put(inode, lsm);
|
ccc_inode_lsm_put(inode, lsm);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -903,7 +903,7 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
|
||||||
}
|
}
|
||||||
LASSERT(rc >= sizeof(*lsm));
|
LASSERT(rc >= sizeof(*lsm));
|
||||||
|
|
||||||
OBDO_ALLOC(oa);
|
oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (oa == NULL) {
|
if (oa == NULL) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto out_free_memmd;
|
goto out_free_memmd;
|
||||||
|
|
|
@ -202,7 +202,7 @@ static int common_attr_done(struct lov_request_set *set)
|
||||||
if (!atomic_read(&set->set_success))
|
if (!atomic_read(&set->set_success))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
OBDO_ALLOC(tmp_oa);
|
tmp_oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (tmp_oa == NULL) {
|
if (tmp_oa == NULL) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -309,7 +309,8 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
|
||||||
req->rq_stripe = i;
|
req->rq_stripe = i;
|
||||||
req->rq_idx = loi->loi_ost_idx;
|
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) {
|
if (req->rq_oi.oi_oa == NULL) {
|
||||||
kfree(req);
|
kfree(req);
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
@ -391,7 +392,8 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
|
||||||
req->rq_stripe = i;
|
req->rq_stripe = i;
|
||||||
req->rq_idx = loi->loi_ost_idx;
|
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) {
|
if (req->rq_oi.oi_oa == NULL) {
|
||||||
kfree(req);
|
kfree(req);
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
@ -506,7 +508,8 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
|
||||||
req->rq_stripe = i;
|
req->rq_stripe = i;
|
||||||
req->rq_idx = loi->loi_ost_idx;
|
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) {
|
if (req->rq_oi.oi_oa == NULL) {
|
||||||
kfree(req);
|
kfree(req);
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
|
|
@ -1877,7 +1877,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBDO_ALLOC(oa);
|
oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (oa == NULL) {
|
if (oa == NULL) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -2917,7 +2917,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
|
||||||
|
|
||||||
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
|
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
|
||||||
aa = ptlrpc_req_async_args(req);
|
aa = ptlrpc_req_async_args(req);
|
||||||
OBDO_ALLOC(oa);
|
oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
|
||||||
if (!oa) {
|
if (!oa) {
|
||||||
ptlrpc_req_finished(req);
|
ptlrpc_req_finished(req);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue