示例#1
0
文件: lov_dev.c 项目: Chong-Li/cse522
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;
}
示例#2
0
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;
}
示例#3
0
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;
}
示例#4
0
文件: vvp_req.c 项目: acton393/linux
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;
}