static const struct lu_object_operations mdt_obj_ops;
+/* Slab for MDT object allocation */
+static cfs_mem_cache_t *mdt_object_kmem;
+
+static struct lu_kmem_descr mdt_caches[] = {
+ {
+ .ckd_cache = &mdt_object_kmem,
+ .ckd_name = "mdt_obj",
+ .ckd_size = sizeof(struct mdt_object)
+ },
+ {
+ .ckd_cache = NULL
+ }
+};
+
int mdt_get_disposition(struct ldlm_reply *rep, int flag)
{
if (!rep)
ENTRY;
- OBD_ALLOC_PTR(mo);
+ OBD_SLAB_ALLOC_PTR_GFP(mo, mdt_object_kmem, CFS_ALLOC_IO);
if (mo != NULL) {
struct lu_object *o;
struct lu_object_header *h;
lu_object_fini(o);
lu_object_header_fini(h);
- OBD_FREE_PTR(mo);
+ OBD_SLAB_FREE_PTR(mo, mdt_object_kmem);
+
EXIT;
}
struct lprocfs_static_vars lvars;
int rc;
+ rc = lu_kmem_init(mdt_caches);
+ if (rc)
+ return rc;
+
if (mdt_num_threads != 0 && mds_num_threads == 0) {
LCONSOLE_INFO("mdt_num_threads module parameter is deprecated,"
"use mds_num_threads instead or unset both for"
lvars.module_vars, LUSTRE_MDT_NAME,
&mdt_device_type);
+ if (rc)
+ lu_kmem_fini(mdt_caches);
return rc;
}
static void __exit mdt_mod_exit(void)
{
class_unregister_type(LUSTRE_MDT_NAME);
+ lu_kmem_fini(mdt_caches);
}