init_options(struct lustre_mount_data *lmd)
{
memset(lmd, 0, sizeof(lmd));
+ lmd->lmd_magic = LMD_MAGIC;
lmd->lmd_server_nid = PTL_NID_ANY;
lmd->lmd_local_nid = PTL_NID_ANY;
lmd->lmd_port = 988; /* XXX define LUSTRE_DEFAULT_PORT */
int val;
char *opt;
char * opteq;
-
+
/* parsing ideas here taken from util-linux/mount/nfsmount.c */
for (opt = strtok(options, ","); opt; opt = strtok(NULL, ",")) {
if ((opteq = strchr(opt, '='))) {
return rc;
}
} else if (lmd->lmd_nal == QSWNAL) {
-#if MULTIRAIL_EKC
char *pfiles[] = {"/proc/qsnet/elan3/device0/position",
"/proc/qsnet/elan4/device0/position",
+ "/proc/elan/device0/position",
NULL};
-#else
- char *pfiles[] = {"/proc/elan/device0/position",
- NULL};
-#endif
int i = 0;
do {
rc = get_local_elan_id(pfiles[i], buf);
- } while (rc != 0 &&
- pfiles[++i] != NULL);
-
+ } while (rc != 0 && pfiles[++i] != NULL);
+
if (rc != 0) {
- fprintf(stderr, "mount: can't read elan ID"
- " from /proc\n");
+ fprintf(stderr,
+ "mount: can't read Elan ID from /proc\n");
return -1;
}
}
if (ptl_parse_nid (&nid, buf) != 0) {
- fprintf (stderr, "mount: can't parse NID %s\n",
- buf);
+ fprintf (stderr, "mount: can't parse NID %s\n", buf);
return (-1);
}
char *s;
int rc;
+ if (lmd_bad_magic(lmd))
+ return -EINVAL;
+
if (strlen(source) > sizeof(target) + 1) {
fprintf(stderr, "mount: "
"exessively long host:/mds/profile argument\n");
}
strcpy(lmd->lmd_profile, profile);
-
if (verbose)
print_options(lmd);
return 0;