X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_dev.c;h=68d8a17ec9a1d1e42dd6f0b73f4291fc89ef3b82;hb=8151daa2c8d97917b37b9271c5d6936a75b48328;hp=b95bdac1dcf207cd8f57a0ca5f0547dbe7b70db4;hpb=036d987c6d716d2e3d8f5a12800b44f3cd01bb9c;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_dev.c b/lustre/osc/osc_dev.c index b95bdac..68d8a17 100644 --- a/lustre/osc/osc_dev.c +++ b/lustre/osc/osc_dev.c @@ -23,7 +23,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2015, Intel Corporation. + * Copyright (c) 2012, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -39,6 +39,7 @@ /* class_name2obd() */ #include #include +#include #include "osc_internal.h" @@ -47,11 +48,15 @@ */ struct kmem_cache *osc_lock_kmem; +EXPORT_SYMBOL(osc_lock_kmem); struct kmem_cache *osc_object_kmem; +EXPORT_SYMBOL(osc_object_kmem); + struct kmem_cache *osc_thread_kmem; struct kmem_cache *osc_session_kmem; struct kmem_cache *osc_extent_kmem; struct kmem_cache *osc_quota_kmem; +struct kmem_cache *osc_obdo_kmem; struct lu_kmem_descr osc_caches[] = { { @@ -85,8 +90,13 @@ struct lu_kmem_descr osc_caches[] = { .ckd_size = sizeof(struct osc_quota_info) }, { - .ckd_cache = NULL - } + .ckd_cache = &osc_obdo_kmem, + .ckd_name = "osc_obdo_kmem", + .ckd_size = sizeof(struct obdo) + }, + { + .ckd_cache = NULL + } }; /***************************************************************************** @@ -120,6 +130,7 @@ struct lu_context_key osc_key = { .lct_init = osc_key_init, .lct_fini = osc_key_fini }; +EXPORT_SYMBOL(osc_key); static void *osc_session_init(const struct lu_context *ctx, struct lu_context_key *key) @@ -144,44 +155,49 @@ struct lu_context_key osc_session_key = { .lct_init = osc_session_init, .lct_fini = osc_session_fini }; +EXPORT_SYMBOL(osc_session_key); /* type constructor/destructor: osc_type_{init,fini,start,stop}(). */ LU_TYPE_INIT_FINI(osc, &osc_key, &osc_session_key); -static int osc_cl_process_config(const struct lu_env *env, - struct lu_device *d, struct lustre_cfg *cfg) +static int osc_process_config(const struct lu_env *env, struct lu_device *d, + struct lustre_cfg *cfg) { - ENTRY; - RETURN(osc_process_config_base(d->ld_obd, cfg)); + ssize_t count = class_modify_config(cfg, PARAM_OSC, + &d->ld_obd->obd_kset.kobj); + return count > 0 ? 0 : count; } static const struct lu_device_operations osc_lu_ops = { .ldo_object_alloc = osc_object_alloc, - .ldo_process_config = osc_cl_process_config, + .ldo_process_config = osc_process_config, .ldo_recovery_complete = NULL }; -static int osc_device_init(const struct lu_env *env, struct lu_device *d, - const char *name, struct lu_device *next) +int osc_device_init(const struct lu_env *env, struct lu_device *d, + const char *name, struct lu_device *next) { RETURN(0); } +EXPORT_SYMBOL(osc_device_init); -static struct lu_device *osc_device_fini(const struct lu_env *env, - struct lu_device *d) +struct lu_device *osc_device_fini(const struct lu_env *env, + struct lu_device *d) { return NULL; } +EXPORT_SYMBOL(osc_device_fini); -static struct lu_device *osc_device_free(const struct lu_env *env, - struct lu_device *d) +struct lu_device *osc_device_free(const struct lu_env *env, + struct lu_device *d) { - struct osc_device *od = lu2osc_dev(d); + struct osc_device *od = lu2osc_dev(d); - cl_device_fini(lu2cl_dev(d)); - OBD_FREE_PTR(od); - return NULL; + cl_device_fini(lu2cl_dev(d)); + OBD_FREE_PTR(od); + return NULL; } +EXPORT_SYMBOL(osc_device_free); static struct lu_device *osc_device_alloc(const struct lu_env *env, struct lu_device_type *t,