@@ -179,6 +179,15 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
return rc;
}
+static int do_lcfg_nid(char *cfgname, struct lnet_nid *nid, int cmd,
+ char *s1)
+{
+ if (nid_is_nid4(nid))
+ return do_lcfg(cfgname, lnet_nid_to_nid4(nid), cmd, s1,
+ NULL, NULL, NULL);
+ return -EINVAL;
+}
+
/** Call class_attach and class_setup. These methods in turn call
* obd type-specific methods.
*/
@@ -218,7 +227,7 @@ int lustre_start_mgc(struct super_block *sb)
struct obd_export *exp;
struct obd_uuid *uuid = NULL;
uuid_t uuidc;
- lnet_nid_t nid;
+ struct lnet_nid nid;
char nidstr[LNET_NIDSTR_SIZE];
char *mgcname = NULL, *niduuid = NULL, *mgssec = NULL;
char *ptr;
@@ -228,7 +237,7 @@ int lustre_start_mgc(struct super_block *sb)
/* Use nids from mount line: uml1,1@elan:uml2,2@elan:/lustre */
ptr = lsi->lsi_lmd->lmd_dev;
- if (class_parse_nid4(ptr, &nid, &ptr) == 0)
+ if (class_parse_nid(ptr, &nid, &ptr) == 0)
i++;
if (i == 0) {
CERROR("No valid MGS nids found.\n");
@@ -237,7 +246,7 @@ int lustre_start_mgc(struct super_block *sb)
mutex_lock(&mgc_start_lock);
- libcfs_nid2str_r(nid, nidstr, sizeof(nidstr));
+ libcfs_nidstr_r(&nid, nidstr, sizeof(nidstr));
mgcname = kasprintf(GFP_NOFS,
"%s%s", LUSTRE_MGC_OBDNAME, nidstr);
niduuid = kasprintf(GFP_NOFS, "%s_%x", mgcname, 0);
@@ -314,10 +323,9 @@ int lustre_start_mgc(struct super_block *sb)
i = 0;
/* Use nids from mount line: uml1,1@elan:uml2,2@elan:/lustre */
ptr = lsi->lsi_lmd->lmd_dev;
- while (class_parse_nid4(ptr, &nid, &ptr) == 0) {
- rc = do_lcfg(mgcname, nid,
- LCFG_ADD_UUID, niduuid, NULL, NULL, NULL);
- if (!rc)
+ while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+ rc = do_lcfg_nid(mgcname, &nid, LCFG_ADD_UUID, niduuid);
+ if (rc == 0)
i++;
/* Stop at the first failover nid */
if (*ptr == ':')
@@ -354,10 +362,10 @@ int lustre_start_mgc(struct super_block *sb)
/* New failover node */
sprintf(niduuid, "%s_%x", mgcname, i);
j = 0;
- while (class_parse_nid4_quiet(ptr, &nid, &ptr) == 0) {
- rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID, niduuid,
- NULL, NULL, NULL);
- if (!rc)
+ while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
+ rc = do_lcfg_nid(mgcname, &nid, LCFG_ADD_UUID,
+ niduuid);
+ if (rc == 0)
++j;
if (*ptr == ':')
break;
@@ -863,14 +871,14 @@ static int lmd_parse_string(char **handle, char *ptr)
/* Collect multiple values for mgsnid specifiers */
static int lmd_parse_mgs(struct lustre_mount_data *lmd, char **ptr)
{
- lnet_nid_t nid;
+ struct lnet_nid nid;
char *tail = *ptr;
char *mgsnid;
int length;
int oldlen = 0;
/* Find end of nidlist */
- while (class_parse_nid4_quiet(tail, &nid, &tail) == 0)
+ while (class_parse_nid_quiet(tail, &nid, &tail) == 0)
;
length = tail - *ptr;
if (length == 0) {