static int lov_req_init(const struct lu_env *env, struct cl_device *dev, struct cl_req *req) { struct lov_req *lr; int result; lr = kmem_cache_alloc(lov_req_kmem, GFP_NOFS | __GFP_ZERO); if (lr != NULL) { cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops); result = 0; } else result = -ENOMEM; return result; }
static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev, struct cl_req *req) { struct lovsub_req *lsr; int result; OBD_SLAB_ALLOC_PTR_GFP(lsr, lovsub_req_kmem, GFP_NOFS); if (lsr != NULL) { cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops); result = 0; } else result = -ENOMEM; return result; }
int osc_req_init(const struct lu_env *env, struct cl_device *dev, struct cl_req *req) { struct osc_req *or; int result; OBD_SLAB_ALLOC_PTR_GFP(or, osc_req_kmem, GFP_NOFS); if (or != NULL) { cl_req_slice_add(req, &or->or_cl, dev, &osc_req_ops); result = 0; } else result = -ENOMEM; return result; }
int vvp_req_init(const struct lu_env *env, struct cl_device *dev, struct cl_req *req) { struct vvp_req *vrq; int result; vrq = kmem_cache_zalloc(vvp_req_kmem, GFP_NOFS); if (vrq) { cl_req_slice_add(req, &vrq->vrq_cl, dev, &vvp_req_ops); result = 0; } else { result = -ENOMEM; } return result; }