Whamcloud - gitweb
LU-9855 obd: use ldo_process_config for mdc and osc layer 06/34106/7
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 24 Jan 2019 16:59:32 +0000 (11:59 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 3 Mar 2019 00:21:20 +0000 (00:21 +0000)
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 <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/34106
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_request.c
lustre/osc/osc_dev.c
lustre/osc/osc_request.c

index 3565f2b..348f763 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <obd_class.h>
 #include <lustre_osc.h>
 
 #include <obd_class.h>
 #include <lustre_osc.h>
+#include <uapi/linux/lustre/lustre_param.h>
 
 #include "mdc_internal.h"
 
 
 #include "mdc_internal.h"
 
@@ -1454,15 +1455,17 @@ struct lu_object *mdc_object_alloc(const struct lu_env *env,
        return obj;
 }
 
        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,
 }
 
 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,
 };
 
        .ldo_recovery_complete = NULL,
 };
 
index 36ce3b6..553063e 100644 (file)
@@ -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_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;
 
 
 struct obd_client_handle;
 
index 4941f06..0cd273b 100644 (file)
@@ -53,7 +53,6 @@
 #include <lustre_kernelcomm.h>
 #include <lustre_lmv.h>
 #include <lustre_log.h>
 #include <lustre_kernelcomm.h>
 #include <lustre_lmv.h>
 #include <lustre_log.h>
-#include <uapi/linux/lustre/lustre_param.h>
 #include <lustre_swab.h>
 #include <obd_class.h>
 #include <lustre_osc.h>
 #include <lustre_swab.h>
 #include <obd_class.h>
 #include <lustre_osc.h>
@@ -2742,15 +2741,6 @@ static int mdc_cleanup(struct obd_device *obd)
        return osc_cleanup_common(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,
 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_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,
 };
         .o_get_uuid         = mdc_get_uuid,
         .o_quotactl         = mdc_quotactl,
 };
index cbddab5..68d8a17 100644 (file)
@@ -39,6 +39,7 @@
 /* class_name2obd() */
 #include <obd_class.h>
 #include <lustre_osc.h>
 /* class_name2obd() */
 #include <obd_class.h>
 #include <lustre_osc.h>
+#include <uapi/linux/lustre/lustre_param.h>
 
 #include "osc_internal.h"
 
 
 #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);
 
 /* 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,
 }
 
 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
 };
 
         .ldo_recovery_complete = NULL
 };
 
index 0bdb7b7..43b5d47 100644 (file)
@@ -41,7 +41,6 @@
 #include <uapi/linux/lustre/lustre_ioctl.h>
 #include <lustre_net.h>
 #include <lustre_obdo.h>
 #include <uapi/linux/lustre/lustre_ioctl.h>
 #include <lustre_net.h>
 #include <lustre_obdo.h>
-#include <uapi/linux/lustre/lustre_param.h>
 #include <obd.h>
 #include <obd_cksum.h>
 #include <obd_class.h>
 #include <obd.h>
 #include <obd_cksum.h>
 #include <obd_class.h>
@@ -3340,18 +3339,6 @@ int osc_cleanup_common(struct obd_device *obd)
 }
 EXPORT_SYMBOL(osc_cleanup_common);
 
 }
 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,
 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_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,
 };
 
         .o_quotactl             = osc_quotactl,
 };