Whamcloud - gitweb
LU-17844 obdclass: remove all LCONSOLE_ERROR_MSG() 34/55134/3
authorTimothy Day <timday@amazon.com>
Fri, 17 May 2024 00:15:25 +0000 (00:15 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jun 2024 01:11:52 +0000 (01:11 +0000)
These magic numbers aren't so magical anymore. Just
use LCONSOLE_ERROR().

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ib5310f65cda7a3537837e8a38801e6d1771d4759
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55134
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/genops.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c

index 413d134..e64ad42 100644 (file)
@@ -125,8 +125,7 @@ SERVER_ONLY struct obd_type *class_get_type(const char *name)
                if (!request_module("%s", modname)) {
                        CDEBUG(D_INFO, "Loaded module '%s'\n", modname);
                } else {
-                       LCONSOLE_ERROR_MSG(0x158, "Can't load module '%s'\n",
-                                          modname);
+                       LCONSOLE_ERROR("Can't load module '%s'\n", modname);
                }
                rcu_read_lock();
                type = class_search_type(name);
index ed6fa85..2cbc6e7 100644 (file)
@@ -415,7 +415,7 @@ static int parse_nid(char *buf, void *value, int quiet)
                return 0;
 
        if (!quiet)
-               LCONSOLE_ERROR_MSG(0x159, "Can't parse NID '%s'\n", buf);
+               LCONSOLE_ERROR("Can't parse NID '%s'\n", buf);
        return -EINVAL;
 }
 
@@ -1484,7 +1484,7 @@ int class_process_config(struct lustre_cfg *lcfg)
                GOTO(out, err = 0);
        }
        case LCFG_SET_UPCALL: {
-               LCONSOLE_ERROR_MSG(0x15a, "recovery upcall is deprecated\n");
+               LCONSOLE_ERROR("recovery upcall is deprecated\n");
                /* COMPAT_146 Don't fail on old configs */
                GOTO(out, err = 0);
        }
index 00c545f..a6dbb44 100644 (file)
@@ -103,13 +103,11 @@ out:
        OBD_FREE_PTR(bufs);
 
        if (rc == -EINVAL)
-               LCONSOLE_ERROR_MSG(0x15b,
-                                  "%s: Configuration from log %s failed from MGS %d. Check client and MGS are on compatible version.\n",
-                                  mgc->obd_name, logname, rc);
+               LCONSOLE_ERROR("%s: Configuration from log %s failed from MGS %d. Check client and MGS are on compatible version.\n",
+                              mgc->obd_name, logname, rc);
        else if (rc != 0)
-               LCONSOLE_ERROR_MSG(0x15c,
-                                  "%s: Confguration from log %s failed from MGS %d. Communication error between node & MGS, a bad configuration, or other errors. See syslog for more info\n",
-                                  mgc->obd_name, logname, rc);
+               LCONSOLE_ERROR("%s: Confguration from log %s failed from MGS %d. Communication error between node & MGS, a bad configuration, or other errors. See syslog for more info\n",
+                              mgc->obd_name, logname, rc);
 
        RETURN(rc);
 }
@@ -1180,7 +1178,7 @@ static int lmd_parse_mgs(struct lustre_mount_data *lmd, char *ptr, char **tail)
        if (next && next != *tail)
                length += *tail - next + 1;
        if (length == 0) {
-               LCONSOLE_ERROR_MSG(0x159, "Can't parse NID '%s'\n", ptr);
+               LCONSOLE_ERROR("Can't parse NID '%s'\n", ptr);
                return -EINVAL;
        }
 
@@ -1429,16 +1427,14 @@ int lmd_parse(char *options, struct lustre_mount_data *lmd)
        ENTRY;
        LASSERT(lmd);
        if (!options) {
-               LCONSOLE_ERROR_MSG(0x162,
-                                  "Missing mount data: check /sbin/mount.lustre_tgt is installed.\n");
+               LCONSOLE_ERROR("Missing mount data: check /sbin/mount.lustre_tgt is installed.\n");
                RETURN(-EINVAL);
        }
 
        /* Options should be a string - try to detect old lmd data */
        if ((raw->lmd_magic & 0xffffff00) == (LMD_MAGIC & 0xffffff00)) {
-               LCONSOLE_ERROR_MSG(0x163,
-                                  "Using an old version of /sbin/mount.lustre. Please install version %s\n",
-                                  LUSTRE_VERSION_STRING);
+               LCONSOLE_ERROR("Using an old version of /sbin/mount.lustre. Please install version %s\n",
+                              LUSTRE_VERSION_STRING);
                RETURN(-EINVAL);
        }
        lmd->lmd_magic = LMD_MAGIC;
@@ -1688,8 +1684,7 @@ bad_string:
                GOTO(invalid, rc);
 
        if (!devname) {
-               LCONSOLE_ERROR_MSG(0x164,
-                                  "Can't find device name (need mount option 'device=...')\n");
+               LCONSOLE_ERROR("Can't find device name (need mount option 'device=...')\n");
                GOTO(invalid, rc = -ENODEV);
        }