#include "obdctl.h"
#include "mount_utils.h"
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
-/*
- * LU-1783
- * We only #include a kernel level include file here because
- * important MS_ flag #defines are missing from the SLES version
- * of sys/mount.h
- * In the future if SLES updates sys/mount.h to have a more complete
- * set of flag #defines we should stop including linux/fs.h
- */
-#if !defined(MS_RDONLY)
-#include <linux/fs.h>
-#endif
-#endif
-
#ifdef HAVE_LIBMOUNT
# define WITH_LIBMOUNT "(libmount)"
#else
#define MAXNIDSTR 1024
static char *convert_hostnames(char *s1)
{
- char *converted, *s2 = 0, *c;
- char sep;
- int left = MAXNIDSTR;
- lnet_nid_t nid;
-
- converted = malloc(left);
- if (converted == NULL) {
- fprintf(stderr, "out of memory: needed %d bytes\n",
- MAXNIDSTR);
- return NULL;
- }
- c = converted;
- while ((left > 0) && (*s1 != '/')) {
- s2 = strpbrk(s1, ",:");
- if (!s2)
- goto out_free;
- sep = *s2;
- *s2 = '\0';
- nid = libcfs_str2nid(s1);
- *s2 = sep; /* back to original string */
- if (nid == LNET_NID_ANY)
- goto out_free;
- c += snprintf(c, left, "%s%c", libcfs_nid2str(nid), sep);
- left = converted + MAXNIDSTR - c;
- s1 = s2 + 1;
- }
- snprintf(c, left, "%s", s1);
- return converted;
+ char *converted, *s2 = 0, *c;
+ char sep;
+ int left = MAXNIDSTR;
+ lnet_nid_t nid;
+
+ converted = malloc(left);
+ if (converted == NULL) {
+ fprintf(stderr, "out of memory: needed %d bytes\n",
+ MAXNIDSTR);
+ return NULL;
+ }
+ c = converted;
+ while ((left > 0) && (*s1 != '/')) {
+ s2 = strpbrk(s1, ",:");
+ if (!s2)
+ goto out_free;
+ sep = *s2;
+ *s2 = '\0';
+ nid = libcfs_str2nid(s1);
+ *s2 = sep; /* back to original string */
+ if (nid == LNET_NID_ANY)
+ goto out_free;
+ c += scnprintf(c, left, "%s%c", libcfs_nid2str(nid), sep);
+ left = converted + MAXNIDSTR - c;
+ s1 = s2 + 1;
+ }
+ snprintf(c, left, "%s", s1);
+ return converted;
out_free:
- fprintf(stderr, "%s: Can't parse NID '%s'\n", progname, s1);
- free(converted);
- return NULL;
+ fprintf(stderr, "%s: Can't parse NID '%s'\n", progname, s1);
+ free(converted);
+ return NULL;
}
/*****************************************************************************