Whamcloud - gitweb
LU-1399 config: check lustre_cfg_new() return
[fs/lustre-release.git] / lustre / mgc / mgc_request.c
index 347590f..9f2d005 100644 (file)
@@ -96,7 +96,8 @@ int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type)
 }
 EXPORT_SYMBOL(mgc_fsname2resid);
 
-int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, int type)
+static int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id,
+                            int type)
 {
        char *name_end;
        int len;
@@ -1174,9 +1175,9 @@ static int mgc_target_register(struct obd_export *exp,
         RETURN(rc);
 }
 
-int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
-                       obd_count keylen, void *key, obd_count vallen,
-                       void *val, struct ptlrpc_request_set *set)
+static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
+                             obd_count keylen, void *key, obd_count vallen,
+                             void *val, struct ptlrpc_request_set *set)
 {
         int rc = -EINVAL;
         ENTRY;
@@ -1527,12 +1528,11 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 
                 lustre_cfg_bufs_set_string(&bufs, 1, params);
 
-                rc = -ENOMEM;
-                lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
-                if (lcfg == NULL) {
-                        CERROR("mgc: cannot allocate memory\n");
-                        break;
-                }
+               lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
+               if (lcfg == NULL) {
+                       rc = -ENOMEM;
+                       break;
+               }
 
                 CDEBUG(D_INFO, "ir apply logs "LPD64"/"LPD64" for %s -> %s\n",
                        prev_version, max_version, obdname, params);
@@ -2034,7 +2034,7 @@ out:
         RETURN(rc);
 }
 
-struct obd_ops mgc_obd_ops = {
+static struct obd_ops mgc_obd_ops = {
         .o_owner        = THIS_MODULE,
         .o_setup        = mgc_setup,
         .o_precleanup   = mgc_precleanup,
@@ -2049,7 +2049,7 @@ struct obd_ops mgc_obd_ops = {
         .o_process_config = mgc_process_config,
 };
 
-int __init mgc_init(void)
+static int __init mgc_init(void)
 {
        return class_register_type(&mgc_obd_ops, NULL, true, NULL,
                                   LUSTRE_MGC_NAME, NULL);