static struct lu_device_operations cmm_lu_ops = {
.ldo_object_alloc = cmm_object_alloc,
- .ldo_object_free = cmm_object_free,
.ldo_process_config = cmm_process_config
};
/* cmm_object.c */
struct lu_object *cmm_object_alloc(const struct lu_context *ctx,
struct lu_device *);
-void cmm_object_free(const struct lu_context *ctx, struct lu_object *o);
-
#endif /* __KERNEL__ */
#endif /* _CMM_INTERNAL_H */
RETURN(lo);
}
-void cmm_object_free(const struct lu_context *ctx, struct lu_object *lo)
+static void cmm_object_free(const struct lu_context *ctx, struct lu_object *lo)
{
struct cmm_object *co = lu2cmm_obj(lo);
lu_object_fini(lo);
OBD_FREE_PTR(co);
}
-int cmm_object_init(const struct lu_context *ctx, struct lu_object *lo)
+static int cmm_object_init(const struct lu_context *ctx, struct lu_object *lo)
{
struct cmm_device *cd = lu2cmm_dev(lo->lo_dev);
struct lu_device *c_dev;
static struct lu_object_operations cmm_obj_ops = {
.loo_object_init = cmm_object_init,
+ .loo_object_free = cmm_object_free,
.loo_object_print = cmm_object_print,
.loo_object_exists = cmm_object_exists
};
static struct lu_device_operations mdc_lu_ops = {
.ldo_object_alloc = mdc_object_alloc,
- .ldo_object_free = mdc_object_free,
.ldo_process_config = mdc_process_config
};
return container_of0(ld, struct mdc_device, mc_md_dev.md_lu_dev);
}
-int mdc_object_init(const struct lu_context *, struct lu_object*);
struct lu_object *mdc_object_alloc(const struct lu_context *,
struct lu_device *);
-void mdc_object_free(const struct lu_context *, struct lu_object *);
-void mdc_object_release(const struct lu_context *, struct lu_object *);
-
#endif /* __KERNEL__ */
#endif /* _CMM_MDC_INTERNAL_H */
RETURN(NULL);
}
-int mdc_object_init(const struct lu_context *ctx, struct lu_object *lo)
+static int mdc_object_init(const struct lu_context *ctx, struct lu_object *lo)
{
//struct mdc_device *d = lu2mdc_dev(o->lo_dev);
//struct lu_device *under;
RETURN(0);
}
-void mdc_object_free(const struct lu_context *ctx, struct lu_object *lo)
+static void mdc_object_free(const struct lu_context *ctx, struct lu_object *lo)
{
struct mdc_object *mco = lu2mdc_obj(lo);
lu_object_fini(lo);
OBD_FREE_PTR(mco);
}
-void mdc_object_release(const struct lu_context *ctx, struct lu_object *lo)
+static void mdc_object_release(const struct lu_context *ctx,
+ struct lu_object *lo)
{
return;
}
static struct lu_object_operations mdc_obj_ops = {
.loo_object_init = mdc_object_init,
.loo_object_release = mdc_object_release,
+ .loo_object_free = mdc_object_free,
.loo_object_print = mdc_object_print,
.loo_object_exists = mdc_object_exists
};
struct lu_object *(*ldo_object_alloc)(const struct lu_context *ctx,
struct lu_device *d);
/*
- * Dual to ->ldo_object_alloc(). Called when object is removed from
- * memory.
- */
- void (*ldo_object_free)(const struct lu_context *ctx, struct lu_object *o);
-
- /*
* process config specific for device
*/
int (*ldo_process_config)(const struct lu_context *ctx,
int (*loo_object_init)(const struct lu_context *ctx,
struct lu_object *o);
/*
- * Called before ->ldo_object_free() to signal that object is being
+ * Called before ->loo_object_free() to signal that object is being
* destroyed. Dual to ->loo_object_init().
*/
void (*loo_object_delete)(const struct lu_context *ctx,
struct lu_object *o);
/*
+ * Dual to ->ldo_object_alloc(). Called when object is removed from
+ * memory.
+ */
+ void (*loo_object_free)(const struct lu_context *ctx,
+ struct lu_object *o);
+
+ /*
* Called when last active reference to the object is released (and
* object returns to the cache).
*/
static struct lu_device_operations mdd_lu_ops = {
.ldo_object_alloc = mdd_object_alloc,
- .ldo_object_free = mdd_object_free,
.ldo_process_config = mdd_process_config
};
static struct lu_object_operations mdd_lu_obj_ops = {
.loo_object_init = mdd_object_init,
.loo_object_release = mdd_object_release,
+ .loo_object_free = mdd_object_free,
.loo_object_print = mdd_object_print,
.loo_object_exists = mdd_object_exists
};
static struct lu_device_operations mdt_lu_ops = {
.ldo_object_alloc = mdt_object_alloc,
- .ldo_object_free = mdt_object_free,
.ldo_process_config = mdt_process_config
};
static struct lu_object_operations mdt_obj_ops = {
.loo_object_init = mdt_object_init,
.loo_object_release = mdt_object_release,
+ .loo_object_free = mdt_object_free,
.loo_object_print = mdt_object_print,
.loo_object_exists = mdt_object_exists
};
-- o->lo_dev->ld_site->ls_total;
/*
* Then, splice object layers into stand-alone list, and call
- * ->ldo_object_free() on all layers to free memory. Splice is
+ * ->loo_object_free() on all layers to free memory. Splice is
* necessary, because lu_object_header is freed together with the
* top-level slice.
*/
while (!list_empty(&splice)) {
o = container_of0(splice.next, struct lu_object, lo_linkage);
list_del_init(&o->lo_linkage);
- LASSERT(lu_object_ops(o)->ldo_object_free != NULL);
- lu_object_ops(o)->ldo_object_free(ctx, o);
+ LASSERT(o->lo_ops->loo_object_free != NULL);
+ o->lo_ops->loo_object_free(ctx, o);
}
}
.loo_object_init = osd_object_init,
.loo_object_delete = osd_object_delete,
.loo_object_release = osd_object_release,
+ .loo_object_free = osd_object_free,
.loo_object_print = osd_object_print,
.loo_object_exists = osd_object_exists
};
static struct lu_device_operations osd_lu_ops = {
.ldo_object_alloc = osd_object_alloc,
- .ldo_object_free = osd_object_free,
.ldo_process_config = osd_process_config
};