Whamcloud - gitweb
LU-1399 config: check lustre_cfg_new() return
[fs/lustre-release.git] / lustre / obdclass / obd_config.c
index aecfbd1..05505c3 100644 (file)
@@ -786,7 +786,7 @@ EXPORT_SYMBOL(class_add_conn);
 
 /** Remove a failover nid location.
  */
-int class_del_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
+static int class_del_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct obd_import *imp;
         struct obd_uuid uuid;
@@ -816,7 +816,7 @@ int class_del_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
         RETURN(rc);
 }
 
-struct list_head lustre_profile_list =
+static struct list_head lustre_profile_list =
        LIST_HEAD_INIT(lustre_profile_list);
 
 struct lustre_profile *class_get_profile(const char * prof)
@@ -837,8 +837,8 @@ EXPORT_SYMBOL(class_get_profile);
  * This defines the mdc and osc names to use for a client.
  * This also is used to define the lov to be used by a mdt.
  */
-int class_add_profile(int proflen, char *prof, int osclen, char *osc,
-                      int mdclen, char *mdc)
+static int class_add_profile(int proflen, char *prof, int osclen, char *osc,
+                            int mdclen, char *mdc)
 {
         struct lustre_profile *lprof;
         int err = 0;
@@ -1016,7 +1016,6 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
        lustre_cfg_bufs_set_string(bufs, 1, new_param);
 
        new_cfg = lustre_cfg_new(cfg->lcfg_command, bufs);
-
        OBD_FREE(new_param, new_len);
        OBD_FREE_PTR(bufs);
        if (new_cfg == NULL)
@@ -1348,8 +1347,6 @@ int class_process_proc_param(char *prefix, struct lprocfs_seq_vars *lvars,
 }
 EXPORT_SYMBOL(class_process_proc_param);
 
-extern int lustre_check_exclusion(struct super_block *sb, char *svname);
-
 /*
  * Supplemental functions for config logs, it allocates lustre_cfg
  * buffers plus initialized llog record header at the beginning.
@@ -1655,7 +1652,7 @@ parse_out:
 }
 EXPORT_SYMBOL(class_config_parse_llog);
 
-struct lcfg_type_data {
+static struct lcfg_type_data {
        __u32    ltd_type;
        char    *ltd_name;
        char    *ltd_bufs[4];
@@ -1768,7 +1765,7 @@ int class_config_yaml_output(struct llog_rec_hdr *rec, char *buf, int size)
  * This is separated from class_config_dump_handler() to use
  * for ioctl needs as well
  */
-int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
+static int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
 {
        struct lustre_cfg       *lcfg = (struct lustre_cfg *)(rec + 1);
        char                    *ptr = buf;
@@ -1891,11 +1888,11 @@ int class_manual_cleanup(struct obd_device *obd)
         CDEBUG(D_CONFIG, "Manual cleanup of %s (flags='%s')\n",
                obd->obd_name, flags);
 
-        lustre_cfg_bufs_reset(&bufs, obd->obd_name);
-        lustre_cfg_bufs_set_string(&bufs, 1, flags);
-        lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
-        if (!lcfg)
-                RETURN(-ENOMEM);
+       lustre_cfg_bufs_reset(&bufs, obd->obd_name);
+       lustre_cfg_bufs_set_string(&bufs, 1, flags);
+       lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
+       if (lcfg == NULL)
+               RETURN(-ENOMEM);
 
         rc = class_process_config(lcfg);
         if (rc) {