From d12959c69fd486054619d52dbb32d7ea91327f94 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 24 Jan 2019 11:59:32 -0500 Subject: [PATCH] LU-9855 obd: use ldo_process_config for mdc and osc layer Both the mdc and osc layer use the lu_device infrastructure but we don't use ldo_process_config() which is preferred over the currently used obd_process_config() handling. Migrate to the lu_device ldo_process_config() for both mdc and osc layer. Change-Id: I4d5e84c48377283148133e6338ef7257c44b89a3 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/34106 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Ben Evans Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/mdc/mdc_dev.c | 11 +++++++---- lustre/mdc/mdc_internal.h | 1 - lustre/mdc/mdc_request.c | 11 ----------- lustre/osc/osc_dev.c | 12 +++++++----- lustre/osc/osc_request.c | 14 -------------- 5 files changed, 14 insertions(+), 35 deletions(-) diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index 3565f2b..348f763 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -34,6 +34,7 @@ #include #include +#include #include "mdc_internal.h" @@ -1454,15 +1455,17 @@ struct lu_object *mdc_object_alloc(const struct lu_env *env, return obj; } -static int mdc_cl_process_config(const struct lu_env *env, - struct lu_device *d, struct lustre_cfg *cfg) +static int mdc_process_config(const struct lu_env *env, struct lu_device *d, + struct lustre_cfg *cfg) { - return mdc_process_config(d->ld_obd, 0, cfg); + size_t count = class_modify_config(cfg, PARAM_MDC, + &d->ld_obd->obd_kset.kobj); + return count > 0 ? 0 : count; } const struct lu_device_operations mdc_lu_ops = { .ldo_object_alloc = mdc_object_alloc, - .ldo_process_config = mdc_cl_process_config, + .ldo_process_config = mdc_process_config, .ldo_recovery_complete = NULL, }; diff --git a/lustre/mdc/mdc_internal.h b/lustre/mdc/mdc_internal.h index 36ce3b6..553063e 100644 --- a/lustre/mdc/mdc_internal.h +++ b/lustre/mdc/mdc_internal.h @@ -96,7 +96,6 @@ int mdc_save_lovea(struct ptlrpc_request *req, int mdc_fid_alloc(const struct lu_env *env, struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data); int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg); -int mdc_process_config(struct obd_device *obd, size_t len, void *buf); struct obd_client_handle; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 4941f06..0cd273b 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -2742,15 +2741,6 @@ static int mdc_cleanup(struct obd_device *obd) return osc_cleanup_common(obd); } -int mdc_process_config(struct obd_device *obd, size_t len, void *buf) -{ - struct lustre_cfg *lcfg = buf; - size_t count = class_modify_config(lcfg, PARAM_MDC, - &obd->obd_kset.kobj); - - return count > 0 ? 0 : count; -} - static struct obd_ops mdc_obd_ops = { .o_owner = THIS_MODULE, .o_setup = mdc_setup, @@ -2769,7 +2759,6 @@ static struct obd_ops mdc_obd_ops = { .o_fid_alloc = mdc_fid_alloc, .o_import_event = mdc_import_event, .o_get_info = mdc_get_info, - .o_process_config = mdc_process_config, .o_get_uuid = mdc_get_uuid, .o_quotactl = mdc_quotactl, }; diff --git a/lustre/osc/osc_dev.c b/lustre/osc/osc_dev.c index cbddab5..68d8a17 100644 --- a/lustre/osc/osc_dev.c +++ b/lustre/osc/osc_dev.c @@ -39,6 +39,7 @@ /* class_name2obd() */ #include #include +#include #include "osc_internal.h" @@ -159,16 +160,17 @@ 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 }; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 0bdb7b7..43b5d47 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -3340,18 +3339,6 @@ int osc_cleanup_common(struct obd_device *obd) } EXPORT_SYMBOL(osc_cleanup_common); -int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg) -{ - ssize_t count = class_modify_config(lcfg, PARAM_OSC, - &obd->obd_kset.kobj); - return count > 0 ? 0 : count; -} - -static int osc_process_config(struct obd_device *obd, size_t len, void *buf) -{ - return osc_process_config_base(obd, buf); -} - static struct obd_ops osc_obd_ops = { .o_owner = THIS_MODULE, .o_setup = osc_setup, @@ -3371,7 +3358,6 @@ static struct obd_ops osc_obd_ops = { .o_iocontrol = osc_iocontrol, .o_set_info_async = osc_set_info_async, .o_import_event = osc_import_event, - .o_process_config = osc_process_config, .o_quotactl = osc_quotactl, }; -- 1.8.3.1