Whamcloud - gitweb
LU-10391 lustre: rename class_parse_nid to class_parse_nid4 88/50088/8
authorMr NeilBrown <neilb@suse.de>
Tue, 10 May 2022 02:53:02 +0000 (12:53 +1000)
committerOleg Drokin <green@whamcloud.com>
Tue, 11 Apr 2023 20:02:37 +0000 (20:02 +0000)
Use the name "nid4" for class_parse_nid(), class_parse_nid_quiet(),
parse_nid() and CLASS_PARSE_NID.  This will allow a new
class_parse_nid which handle larger nids.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2766634ac55ae7bd30c72549decc1cfd99471bfd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50088
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_class.h
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_llog.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c

index 4b1d04e..e59bcc4 100644 (file)
@@ -174,8 +174,8 @@ struct cfg_interop_param *class_find_old_param(const char *param,
                                               struct cfg_interop_param *ptr);
 int class_get_next_param(char **params, char *copy);
 int class_match_param(char *buf, const char *key, char **valp);
-int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
-int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
+int class_parse_nid4(char *buf, lnet_nid_t *nid4, char **endh);
+int class_parse_nid4_quiet(char *buf, lnet_nid_t *nid4, char **endh);
 int class_parse_net(char *buf, u32 *net, char **endh);
 int class_match_nid(char *buf, char *key, lnet_nid_t nid);
 int class_match_net(char *buf, char *key, u32 net);
index d1aba9f..20201ca 100644 (file)
@@ -313,7 +313,7 @@ static int mgs_check_failover_reg(struct mgs_target_info *mti)
 
        ptr = mti->mti_params;
        while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
-               while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
+               while (class_parse_nid4_quiet(ptr, &nid, &ptr) == 0) {
                        for (i = 0; i < mti->mti_nid_count; i++) {
                                if (nid == mti->mti_nids[i]) {
                                        LCONSOLE_WARN("Denying initial registration attempt from nid %s, specified as failover\n",
index 2acf21c..009ba94 100644 (file)
@@ -1135,7 +1135,7 @@ static int process_command(const struct lu_env *env, struct lustre_cfg *lcfg,
                /* LCFG_ADD_UUID command found. Let's skip original command
                   and add passed nids */
                ptr = mrd->target.mti_params;
-               while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+               while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
                        if (!mrd->nodeuuid) {
                                rc = name_create(&mrd->nodeuuid,
                                                 libcfs_nid2str(nid), "");
@@ -1202,7 +1202,7 @@ static int process_command(const struct lu_env *env, struct lustre_cfg *lcfg,
 
                if (mrd->failover) {
                        ptr = mrd->failover;
-                       while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+                       while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
                                if (mrd->nodeuuid == NULL) {
                                        rc =  name_create(&mrd->nodeuuid,
                                                          libcfs_nid2str(nid),
@@ -2500,12 +2500,12 @@ static int mgs_write_log_failnids(const struct lu_env *env,
 
        /*
         * Pull failnid info out of params string, which may contain something
-        * like "<nid1>,<nid2>:<nid3>,<nid4>".  class_parse_nid() does not
+        * like "<nid1>,<nid2>:<nid3>,<nid4>".  class_parse_nid4() does not
         * complain about abnormal inputs like ",:<nid1>", "<nid1>:,<nid2>",
         * etc.  However, convert_hostnames() should have caught those.
         */
-        while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
-                while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+       while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
+               while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
                        char nidstr[LNET_NIDSTR_SIZE];
 
                        if (failnodeuuid == NULL) {
index 56dacf7..555176f 100644 (file)
@@ -408,12 +408,12 @@ int class_match_param(char *buf, const char *key, char **valp)
 }
 EXPORT_SYMBOL(class_match_param);
 
-static int parse_nid(char *buf, void *value, int quiet)
+static int parse_nid4(char *buf, void *value, int quiet)
 {
-       lnet_nid_t *nid = (lnet_nid_t *)value;
+       lnet_nid_t *nid4 = (lnet_nid_t *)value;
 
-       *nid = libcfs_str2nid(buf);
-       if (*nid != LNET_NID_ANY)
+       *nid4 = libcfs_str2nid(buf);
+       if (*nid4 != LNET_NID_ANY)
                return 0;
 
        if (!quiet)
@@ -431,7 +431,7 @@ static int parse_net(char *buf, void *value)
 }
 
 enum {
-       CLASS_PARSE_NID = 1,
+       CLASS_PARSE_NID4 = 1,
        CLASS_PARSE_NET,
 };
 
@@ -465,8 +465,8 @@ static int class_parse_value(char *buf, int opc, void *value, char **endh,
        switch (opc) {
        default:
                LBUG();
-       case CLASS_PARSE_NID:
-               rc = parse_nid(buf, value, quiet);
+       case CLASS_PARSE_NID4:
+               rc = parse_nid4(buf, value, quiet);
                break;
        case CLASS_PARSE_NET:
                rc = parse_net(buf, value);
@@ -480,17 +480,17 @@ static int class_parse_value(char *buf, int opc, void *value, char **endh,
        return 0;
 }
 
-int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh)
+int class_parse_nid4(char *buf, lnet_nid_t *nid4, char **endh)
 {
-       return class_parse_value(buf, CLASS_PARSE_NID, (void *)nid, endh, 0);
+       return class_parse_value(buf, CLASS_PARSE_NID4, (void *)nid4, endh, 0);
 }
-EXPORT_SYMBOL(class_parse_nid);
+EXPORT_SYMBOL(class_parse_nid4);
 
-int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh)
+int class_parse_nid4_quiet(char *buf, lnet_nid_t *nid4, char **endh)
 {
-       return class_parse_value(buf, CLASS_PARSE_NID, (void *)nid, endh, 1);
+       return class_parse_value(buf, CLASS_PARSE_NID4, (void *)nid4, endh, 1);
 }
-EXPORT_SYMBOL(class_parse_nid_quiet);
+EXPORT_SYMBOL(class_parse_nid4_quiet);
 
 int class_parse_net(char *buf, __u32 *net, char **endh)
 {
@@ -512,7 +512,7 @@ int class_match_nid(char *buf, char *key, lnet_nid_t nid)
                 * please restrict to the NIDs pertaining to
                 * the specified NIDs
                 */
-               while (class_parse_nid(buf, &tmp, &buf) == 0) {
+               while (class_parse_nid4(buf, &tmp, &buf) == 0) {
                        if (tmp == nid)
                                return 1;
                }
index d2f4fe5..95f06e7 100644 (file)
@@ -237,7 +237,7 @@ int lustre_start_mgc(struct super_block *sb)
                /* mount -o mgsnode=nid */
                ptr = lsi->lsi_lmd->lmd_mgs;
                if (lsi->lsi_lmd->lmd_mgs &&
-                   (class_parse_nid(lsi->lsi_lmd->lmd_mgs, &nid, &ptr) == 0)) {
+                   (class_parse_nid4(lsi->lsi_lmd->lmd_mgs, &nid, &ptr) == 0)) {
                        i++;
                } else if (IS_MGS(lsi)) {
                        struct lnet_processid id;
@@ -253,7 +253,7 @@ int lustre_start_mgc(struct super_block *sb)
        } else { /* client */
                /* Use NIDs from mount line: uml1,1@elan:uml2,2@elan:/lustre */
                ptr = lsi->lsi_lmd->lmd_dev;
-               if (class_parse_nid(ptr, &nid, &ptr) == 0)
+               if (class_parse_nid4(ptr, &nid, &ptr) == 0)
                        i++;
        }
        if (i == 0) {
@@ -370,7 +370,7 @@ int lustre_start_mgc(struct super_block *sb)
                         * Multiple NIDs on one MGS node are separated
                         * by commas.
                         */
-                       while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+                       while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
                                rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
                                             niduuid, NULL, NULL, NULL);
                                if (rc == 0)
@@ -383,7 +383,7 @@ int lustre_start_mgc(struct super_block *sb)
        } else { /* client */
                /* Use NIDs from mount line: uml1,1@elan:uml2,2@elan:/lustre */
                ptr = lsi->lsi_lmd->lmd_dev;
-               while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+               while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
                        rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
                                     niduuid, NULL, NULL, NULL);
                        if (rc == 0)
@@ -421,7 +421,7 @@ int lustre_start_mgc(struct super_block *sb)
                /* New failover node */
                sprintf(niduuid, "%s_%x", mgcname, i);
                j = 0;
-               while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
+               while (class_parse_nid4_quiet(ptr, &nid, &ptr) == 0) {
                        rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
                                     niduuid, NULL, NULL, NULL);
                        if (rc == 0)
@@ -1155,7 +1155,7 @@ static int lmd_parse_mgs(struct lustre_mount_data *lmd, char **ptr)
        int oldlen = 0;
 
        /* Find end of NID-list */
-       while (class_parse_nid_quiet(tail, &nid, &tail) == 0)
+       while (class_parse_nid4_quiet(tail, &nid, &tail) == 0)
                ; /* do nothing */
 
        length = tail - *ptr;