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>
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);
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);
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);
ptr = mti->mti_params;
while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
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",
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",
/* LCFG_ADD_UUID command found. Let's skip original command
and add passed nids */
ptr = mrd->target.mti_params;
/* 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), "");
if (!mrd->nodeuuid) {
rc = name_create(&mrd->nodeuuid,
libcfs_nid2str(nid), "");
if (mrd->failover) {
ptr = mrd->failover;
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),
if (mrd->nodeuuid == NULL) {
rc = name_create(&mrd->nodeuuid,
libcfs_nid2str(nid),
/*
* Pull failnid info out of params string, which may contain something
/*
* 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.
*/
* 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) {
char nidstr[LNET_NIDSTR_SIZE];
if (failnodeuuid == NULL) {
}
EXPORT_SYMBOL(class_match_param);
}
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)
switch (opc) {
default:
LBUG();
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);
break;
case CLASS_PARSE_NET:
rc = parse_net(buf, value);
-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)
{
int class_parse_net(char *buf, __u32 *net, char **endh)
{
* please restrict to the NIDs pertaining to
* the specified NIDs
*/
* 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;
}
if (tmp == nid)
return 1;
}
/* mount -o mgsnode=nid */
ptr = lsi->lsi_lmd->lmd_mgs;
if (lsi->lsi_lmd->lmd_mgs &&
/* 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;
i++;
} else if (IS_MGS(lsi)) {
struct lnet_processid id;
} else { /* client */
/* Use NIDs from mount line: uml1,1@elan:uml2,2@elan:/lustre */
ptr = lsi->lsi_lmd->lmd_dev;
} 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)
* Multiple NIDs on one MGS node are separated
* by commas.
*/
* 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)
rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
niduuid, NULL, NULL, NULL);
if (rc == 0)
} else { /* client */
/* Use NIDs from mount line: uml1,1@elan:uml2,2@elan:/lustre */
ptr = lsi->lsi_lmd->lmd_dev;
} 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)
rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
niduuid, NULL, NULL, NULL);
if (rc == 0)
/* New failover node */
sprintf(niduuid, "%s_%x", mgcname, i);
j = 0;
/* 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)
rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
niduuid, NULL, NULL, NULL);
if (rc == 0)
int oldlen = 0;
/* Find end of NID-list */
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;
; /* do nothing */
length = tail - *ptr;