unsigned long dummy;
};
-static cfs_mem_cache_t *echo_page_kmem;
static cfs_mem_cache_t *echo_lock_kmem;
static cfs_mem_cache_t *echo_object_kmem;
static cfs_mem_cache_t *echo_thread_kmem;
static struct lu_kmem_descr echo_caches[] = {
{
- .ckd_cache = &echo_page_kmem,
- .ckd_name = "echo_page_kmem",
- .ckd_size = sizeof (struct echo_page)
- },
- {
.ckd_cache = &echo_lock_kmem,
.ckd_name = "echo_lock_kmem",
.ckd_size = sizeof (struct echo_lock)
cfs_atomic_dec(&eco->eo_npages);
page_cache_release(vmpage);
- OBD_SLAB_FREE_PTR(ep, echo_page_kmem);
EXIT;
}
*
* @{
*/
-static struct cl_page *echo_page_init(const struct lu_env *env,
- struct cl_object *obj,
- struct cl_page *page, cfs_page_t *vmpage)
+static int echo_page_init(const struct lu_env *env, struct cl_object *obj,
+ struct cl_page *page, cfs_page_t *vmpage)
{
- struct echo_page *ep;
+ struct echo_page *ep = cl_object_page_slice(obj, page);
+ struct echo_object *eco = cl2echo_obj(obj);
ENTRY;
- OBD_SLAB_ALLOC_PTR_GFP(ep, echo_page_kmem, CFS_ALLOC_IO);
- if (ep != NULL) {
- struct echo_object *eco = cl2echo_obj(obj);
- ep->ep_vmpage = vmpage;
- page_cache_get(vmpage);
- mutex_init(&ep->ep_lock);
- cl_page_slice_add(page, &ep->ep_cl, obj, &echo_page_ops);
- cfs_atomic_inc(&eco->eo_npages);
- }
- RETURN(ERR_PTR(ep ? 0 : -ENOMEM));
+ ep->ep_vmpage = vmpage;
+ page_cache_get(vmpage);
+ mutex_init(&ep->ep_lock);
+ cl_page_slice_add(page, &ep->ep_cl, obj, &echo_page_ops);
+ cfs_atomic_inc(&eco->eo_npages);
+ RETURN(0);
}
static int echo_io_init(const struct lu_env *env, struct cl_object *obj,
eco->eo_dev = ed;
cfs_atomic_set(&eco->eo_npages, 0);
+ cl_object_page_init(lu2cl(obj), sizeof(struct echo_page));
spin_lock(&ec->ec_lock);
cfs_list_add_tail(&eco->eo_obj_chain, &ec->ec_objects);
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
RETURN(ERR_PTR(rc));
}
+ /* In the function below, .hs_keycmp resolves to
+ * lu_obj_hop_keycmp() */
+ /* coverity[overrun-buffer-val] */
child = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
RETURN(child);
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
int rc = 0;
int i;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
return -ENXIO;
RETURN(ERR_PTR(rc));
}
+ /* In the function below, .hs_keycmp resolves to
+ * lu_obj_hop_keycmp() */
+ /* coverity[overrun-buffer-val] */
parent = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
if (IS_ERR(parent)) {
CERROR("Can not find the parent "DFID": rc = %ld\n",
if (cfs_copy_to_user(data->ioc_pbuf1, &seq, data->ioc_plen1))
return -EFAULT;
- max_count = LUSTRE_SEQ_MAX_WIDTH;
- if (cfs_copy_to_user(data->ioc_pbuf2, &max_count,
- data->ioc_plen2))
- return -EFAULT;
- GOTO(out, rc);
+ max_count = LUSTRE_METADATA_SEQ_MAX_WIDTH;
+ if (cfs_copy_to_user(data->ioc_pbuf2, &max_count,
+ data->ioc_plen2))
+ return -EFAULT;
+ GOTO(out, rc);
}
case OBD_IOC_DESTROY:
if (!cfs_capable(CFS_CAP_SYS_ADMIN))